New Expected Condition elements_not_overlapping
User description
I have added the new expected condition "elements_not_overlapping". This condition checks that two elements are not overlapping on the dom based on their .rect specs.
Description
- Created the function elements_not_overlapping. This EC returns true if two WebElements are not overlapping based on their .rect specs or at least one element is stale.
- Added a pytest test_expected_conditions_elements_not_overlapping to ensure functionality runs as expected
- Gave the parent div of "clickToShow" and "clickToHide" in JavascriptPage.html the id "clickToShowParent"
Motivation and Context
This update provides added functionality and checks for cases where two elements overlap in the DOM temporarily. Examples include: elements dynamically overlapping during scrolling, multiple instances of loading screens occurring simultaneously on the page, etc.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
PR Type
Enhancement, Tests
Description
- Added a new expected condition
elements_not_overlappingto check if two elements do not overlap based on their rectangle specifications. - Implemented a test case
test_expected_condition_elements_not_overlappingto ensure the new condition works as expected. - Updated
javascriptPage.htmlto include anidattribute for adivelement to facilitate testing.
Changes walkthrough 📝
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
| ||||
| Tests |
|
💡 PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.
:white_check_mark: shbenzer
:x: Simon Benzer
Simon Benzer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
PR Reviewer Guide 🔍
| ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
| 🧪 PR contains tests |
| 🔒 No security concerns identified |
| ⚡ Key issues to review Code Clarity Error Handling |
PR Code Suggestions ✨
| Category | Suggestion | Score |
| Possible bug |
Add null checks for
| 9 |
Use
| 8 | |
| Enhancement |
Refactor overlapping logic into a separate function for better clarity and reusabilityRefactor the overlapping logic into a separate function to improve code reusability py/selenium/webdriver/support/expected_conditions.py [403-406]
Suggestion importance[1-10]: 7Why: Refactoring the overlapping logic into a separate function improves code clarity and reusability, but it does not address any immediate functional issues. | 7 |
| Maintainability |
Improve code readability by adding a space after the comma in the function definitionConsider adding a space after the comma in the function definition for py/selenium/webdriver/support/expected_conditions.py [389]
Suggestion importance[1-10]: 5Why: This suggestion improves code readability and maintains consistent code style, but it does not address any functional issues. | 5 |
I'm not sure why it thinks two people committed these changes; Simon Benzer is shbenzer is me
EC support not currently being considered - can reopen/recreate later if necessary