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

fix: .select() by index works if <options> have same value (run ci) #25016

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

BlueWinds
Copy link
Contributor

User facing changelog

Fix an issue where .select(index) would fail when multiple <option> elements have the same value property.

Additional details

<select data-test-id="scp_dropdown">
    <option value="[object Object]">AHA Bug bash</option>
    <option value="[object Object]">cairo</option>
    <option value="[object Object]">Frankfurt</option>
    <option value="[object Object]">cairo</option>
</select>

cy.get('[data-test-id="scp_dropdown"]').select(2);

would previously result in selecting "AHA Bug bash" (index 0) rather than "Frankfurt" (index 2), because they share the same value property.

Steps to test

See the included driver test for a live example of this fix in action.

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 6, 2022

Thanks for taking the time to open a PR!

@BlueWinds BlueWinds marked this pull request as ready for review December 6, 2022 22:31
@cypress
Copy link

cypress bot commented Dec 6, 2022



Test summary

24855 0 2489 0Flakiness 22


Run details

Project cypress
Status Passed
Commit f381dc2
Started Dec 6, 2022 10:44 PM
Ended Dec 6, 2022 11:02 PM
Duration 18:10 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/e2e/origin/cookie_behavior.cy.ts Flakiness
1 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
2 ... > same site / cross origin > fetch > sets same-site cookies if "include" credentials option is specified from request, but does not attach same-site cookies to request by default (same-origin)
3 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
4 ... > same site / cross origin > fetch > sets same-site cookies if "include" credentials option is specified from request, but does not attach same-site cookies to request by default (same-origin)
5 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
This comment includes only the first 5 flaky tests. See all 22 flaky tests in the Cypress Dashboard.

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

@BlueWinds BlueWinds merged commit b32a8af into develop Dec 8, 2022
@BlueWinds BlueWinds deleted the issue-24739-select-with-same-values branch December 8, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cy.select() not working properly if index is used
3 participants