Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust commands to use React selectors if element has isReactElement flag #4454

Merged
merged 5 commits into from Sep 6, 2019

Conversation

baruchvlz
Copy link
Member

Proposed changes

Correctly use react$$ when waiting for React element to exist in DOM.

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)

Further comments

Issue: #4442

Reviewers: @webdriverio/technical-committee

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some unit tests for it? Happy to help with these if you want.

@@ -41,5 +41,7 @@
*/

export default function isExisting () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth to cover other isSomething methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I'll take a look at how these methods and adjust them if needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other command I could find using this was isDisplayed. It has been adjusted in a50e10d .

@baruchvlz
Copy link
Member Author

@christian-bromann Will do, I'll ping you on gitter if any questions arise.

@codecov
Copy link

codecov bot commented Sep 5, 2019

Codecov Report

Merging #4454 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4454      +/-   ##
==========================================
+ Coverage   99.12%   99.13%   +<.01%     
==========================================
  Files         188      188              
  Lines        4711     4715       +4     
  Branches     1003     1007       +4     
==========================================
+ Hits         4670     4674       +4     
  Misses         37       37              
  Partials        4        4
Impacted Files Coverage Δ
...ackages/webdriverio/src/commands/browser/react$.js 100% <100%> (ø) ⬆️
...ckages/webdriverio/src/commands/browser/react$$.js 100% <100%> (ø) ⬆️
packages/webdriverio/src/utils/getElementObject.js 97.82% <100%> (+0.09%) ⬆️
...ges/webdriverio/src/commands/element/isExisting.js 100% <100%> (ø) ⬆️
...es/webdriverio/src/commands/element/isDisplayed.js 100% <100%> (ø) ⬆️
...ckages/webdriverio/src/commands/element/react$$.js 100% <100%> (ø) ⬆️
...ackages/webdriverio/src/commands/element/react$.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74e6a17...fa00de8. Read the comment docs.

@baruchvlz baruchvlz changed the title use correct selector method when waiting for React element to exist Adjust commands to use React selectors if element has isReactElement flag Sep 6, 2019
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Sep 6, 2019
@christian-bromann christian-bromann merged commit 73c19ba into webdriverio:master Sep 6, 2019
@baruchvlz baruchvlz mentioned this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 PRs that contain improvements on existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants