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
#2635 Add ability to perform click at disabled elements #2636
Conversation
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.
.
c9a6d05
to
60d7e69
Compare
CHANGELOG.md
Outdated
@@ -4,6 +4,7 @@ | |||
* #2550 Implement downloading files via CDP or BiDi (#2567) - thanks to Sergey Brit! | |||
* #2612 don't set page load timeout in mobile tests (#2628) | |||
* #2617 User can safely add the same proxy filter many times (#2630) | |||
* #2635 Add ability to perform click at disabled elements (#2636) |
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.
* #2635 Add ability to perform click at disabled elements (#2636) | |
* #2635 Add the ability to skip checks before clicking an element (#2636) |
*/ | ||
@CheckReturnValue | ||
@Nonnull | ||
public ClickOptions allowDisabled() { |
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.
public ClickOptions allowDisabled() { | |
public ClickOptions force() { |
@Test | ||
void clickingDisabledButtonMayBeAllowed() { | ||
assertThatNoException().isThrownBy(() -> | ||
$("#submit").click(usingDefaultMethod().allowDisabled()) |
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.
$("#submit").click(usingDefaultMethod().allowDisabled()) | |
$("#submit").click(usingDefaultMethod().force()) |
@Test | ||
void doubleClickingDisabledButtonMayBeAllowed() { | ||
assertThatNoException().isThrownBy(() -> | ||
$("#submit").doubleClick(usingDefaultMethod().allowDisabled()) |
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.
$("#submit").doubleClick(usingDefaultMethod().allowDisabled()) | |
$("#submit").doubleClick(usingDefaultMethod().force()) |
NB! It's important to call `e.click()`, not `actions.moveToElement(e, 0, 0).click().perform()` because the latter doesn't check that the element is covered by other element, and doesn't throw "element is not clickable at point. Other element would receive the click" error.
... to avoid the risk that the following click misses the element because it's still moving
89f56a4
to
a07a9fb
Compare
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
In this PR, we added parameter
force
to click: