Skip to content

Commit

Permalink
selenide#2288 Fix error messages in tests
Browse files Browse the repository at this point in the history
Before the change the clicked element had to be `interactable`, but after the change it must be `clickable: interactable and enabled`
  • Loading branch information
Au6ojlut committed May 20, 2023
1 parent 81ffd42 commit 8f215cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void actionWithVisibilityWaiting_WhenCollectionElementByIndex_WithIndexOutOfRang
assertThatThrownBy(() -> element.click())
.isInstanceOf(ElementNotFound.class)
.hasMessageStartingWith("Element not found {ul li[10]}")
.hasMessageContaining("Expected: interactable")
.hasMessageContaining("Expected: clickable: interactable and enabled")
.has(screenshot())
.getCause()
.isInstanceOf(IndexOutOfBoundsException.class)
Expand Down Expand Up @@ -165,7 +165,7 @@ void actionWithVisibilityWaiting_WhenInnerElement_WithNonExistentInnerElement()
assertThatThrownBy(() -> element.doubleClick())
.isInstanceOf(ElementNotFound.class)
.hasMessageStartingWith("Element not found {ul/.nonexistent}")
.hasMessageContaining("Expected: interactable")
.hasMessageContaining("Expected: clickable: interactable and enabled")
.has(screenshot())
.getCause()
.isInstanceOf(NoSuchElementException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void clickHiddenElement() {
)
.isInstanceOf(ElementShould.class)
.hasMessageMatching(String.format(
"Element should be interactable \\{#theHiddenElement}%n" +
"Element should be clickable: interactable and enabled \\{#theHiddenElement}%n" +
"Element: '<div id=\"theHiddenElement\" displayed:false></div>'%n" +
"Actual value: hidden, opacity=1%n" +
"Screenshot: " + path + png() + "%n" +
Expand Down Expand Up @@ -179,7 +179,7 @@ void clickUnexistingWrappedElement() {
$(pageObject.categoryDropdown).click()
).isInstanceOf(ElementNotFound.class)
.hasMessageMatching(String.format("Element not found \\{By.id: invalid_id}%n" +
"Expected: interactable%n" +
"Expected: clickable: interactable and enabled%n" +
"Screenshot: %s%s%n" +
"Page source: %s%s%n" +
"Timeout: 15 ms.%n" +
Expand Down

0 comments on commit 8f215cc

Please sign in to comment.