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 for Select page object clickOption method. #2527

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

atmgrifter00
Copy link
Contributor

Pull Request

🤨 Rationale

When refactoring some tests for the notebook selector in SLE, I ran into some issues when trying to use the clickOption method on the page object for a dynamic filtering scenario. In this specific scenario, using the index-based click method was needed over clickOptionWithDisplayText, as the use-case had two options with the same display text (under different groups).

👩‍💻 Implementation

Essentially the issue is that it is unreliable to use the options member on the Select to query for the options that are visible, specifically when doing manual filtering (where it is expected that option elements are being removed from the DOM). Instead, it's more accurate to simply do a querySelectorAll for the options, and then filter on the same expected state.

🧪 Testing

Wrote some unit tests against the clickOption method on the page object.

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@atmgrifter00 atmgrifter00 enabled auto-merge (squash) January 30, 2025 00:33
@atmgrifter00 atmgrifter00 merged commit 74c078a into main Jan 30, 2025
14 checks passed
@atmgrifter00 atmgrifter00 deleted the select-page-object-clickOption-fix branch January 30, 2025 18:26
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.

2 participants