Skip to content

Improve selector for finding elements by tag and content#9992

Merged
christian-bromann merged 5 commits intomainfrom
cb-fix-element-with-text-selector
Mar 17, 2023
Merged

Improve selector for finding elements by tag and content#9992
christian-bromann merged 5 commits intomainfrom
cb-fix-element-with-text-selector

Conversation

@christian-bromann
Copy link
Member

Proposed changes

Using a selector like:

await $('div=some content')

Fetches a wrong element if the DOM structure is something like this:

<div>
  <div>some content</div>
</div>

The current behavior would select the outer div rather than the desired inner div. This patch should fix it.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

n/a

Reviewers: @webdriverio/project-committers

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Mar 16, 2023
@christian-bromann christian-bromann requested a review from a team March 16, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant