-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #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`
- Loading branch information
Showing
7 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Position click test</title> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<div id="page">THIS IS A TEST</div> | ||
<form> | ||
<label> Name: | ||
<input value="name" type="text"/> | ||
</label> | ||
<button id="submit" type="submit" disabled="disabled">SUBMIT</button> | ||
</form> | ||
</body> | ||
</html> |
26 changes: 26 additions & 0 deletions
26
statics/src/test/java/integration/ClickDisabledButtonTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package integration; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
||
final class ClickDisabledButtonTest extends IntegrationTest { | ||
@BeforeEach | ||
void openTestPage() { | ||
openFile("page_with_disabled_button_click.html"); | ||
} | ||
|
||
@Test | ||
void failToClickIfButtonIsDisabled() { | ||
assertThatThrownBy(() -> $("#submit").click()) | ||
.hasMessageStartingWith("Element should be clickable: interactable and enabled {#submit}"); | ||
} | ||
|
||
@Test | ||
void failToDoubleClickIfButtonIsDisabled() { | ||
assertThatThrownBy(() -> $("#submit").doubleClick()) | ||
.hasMessageStartingWith("Element should be clickable: interactable and enabled {#submit}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters