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

Clicking on disabled elements (buttons) should fail the same way as clicking on covered ones #2288

Closed
angryziber opened this issue May 17, 2023 · 2 comments · Fixed by #2290
Assignees
Labels
Milestone

Comments

@angryziber
Copy link
Contributor

angryziber commented May 17, 2023

The problem

Flaky test because of Selenide clicking disabled element and not failing.

Details

In our project, from time to time running post requests disable all submit buttons and then clicking those by Selenide just has no effect, making the test fail later on, which is harder to diagnose.

We propose failing the test if trying to click a disabled button (after the usual timeout of course).
There are no legitimate use cases of actually clicking disabled buttons, because it has no effect by design.
If somebody wants to check if the button is disabled or not, they can just use shouldBe(disabled)

Tell us about your environment

selenide:6.13.1

@jazzboy65
Copy link

Maybe we are talking about different things, but what happens in your attributes? had a similar case and helped shouldBe(Condition.atrribute(as Example "aria-disabled","true"))

@asolntsev
Copy link
Member

@jazzboy65 No, the point is that $.click() should check that the element is enabled.
Currently $.click() only checks that the element is visible.

Au6ojlut added a commit to Au6ojlut/selenide that referenced this issue May 20, 2023
Au6ojlut added a commit to Au6ojlut/selenide that referenced this issue May 20, 2023
Before the change the clicked element had to be `interactable`, but after the change it must be `clickable: interactable and enabled`
@asolntsev asolntsev self-assigned this May 23, 2023
@asolntsev asolntsev added this to the 6.15.0 milestone May 23, 2023
@asolntsev asolntsev linked a pull request May 23, 2023 that will close this issue
3 tasks
asolntsev pushed a commit that referenced this issue May 23, 2023
* #2288 Wait until element becomes enabled before click

Before the change the clicked element had to be `interactable`, but after the change it must be `clickable: interactable and enabled`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants