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
feat(driver): add select by index #18201
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…s-io/cypress into issue-757-select-by-index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great and well tested. Nice first PR.
- Users passing in an option of an index that doesn't exist in the select needs to be considered.
<select>
<option>zero</option>
<select>
cy.select(3)
The error message here is confusing as it says it's looking for text/value of 3 and can't find it.
- This is actually not within the scope of work outlined (this is an existing issue before this PR), so perhaps you could make a new issue for this, but if you call
cy.select()
with no value then there's a weird error. It should say something along the lines of -cy.select wasn't called with any value, text, index, etc etc
.
I'm not sure why Percy is failing here. Should be able to be ignored though since this definitely doesn't touch the UI that Percy is checking. |
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Co-authored-by: Jennifer Shehane <jennifer@cypress.io> Co-authored-by: Zach Bloomquist <github@chary.us>
Closes #757
User facing changelog
Users now have the ability to select an option by index within the
.select()
command.Additional details
These are now the updated accepted arguments for the
.select()
command:value
can be the value, index, or text content of the option to be selectedvalues
is an array of values, indexes, or text contents of the options to be selectedUpdated documentation: cypress-io/cypress-documentation#4105
Tests
Additional tests added include:
PR Tasks
cypress-documentation
? Add Select By Index cypress-documentation#4105type definitions
?cypress.schema.json
?