Skip to content

Commit bfdc598

Browse files
author
Mike Reiche
committed
Added tests to prove that #49 is fixed
1 parent 07f06da commit bfdc598

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

driver-ui/src/main/java/eu/tsystems/mms/tic/testframework/pageobjects/internal/core/AbstractWebDriverCore.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ private void pType(String text) {
383383

384384
@Override
385385
public void click() {
386-
By by = this.guiElementData.getLocate().getBy();
387386
this.findWebElement(webElement -> {
388387
// Start the StopWatch for measuring the loading time of a Page
389388
//StopWatch.startPageLoad(this.guiElementData.getWebDriver());
@@ -544,11 +543,6 @@ protected void highlightWebElement(WebElement webElement, Color color) {
544543
private void pMouseOver() {
545544
this.findWebElement(webElement -> {
546545
this.highlightWebElement(webElement, new Color(255, 255, 0));
547-
final Point location = webElement.getLocation();
548-
final int x = location.getX();
549-
final int y = location.getY();
550-
webElement.getSize();
551-
log().debug("MouseOver: " + toString() + " at x: " + x + " y: " + y);
552546

553547
Actions action = new Actions(guiElementData.getWebDriver());
554548
action.moveToElement(webElement).build().perform();

integration-tests/src/main/java/eu/tsystems/mms/tic/testframework/core/pageobjects/testdata/WebTestPage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,12 @@ public TestableUiElement notVisibleElement() {
120120
public InteractiveUiElement nonExistentElement() {
121121
return findById("schnullifacks");
122122
}
123+
124+
public TestableUiElement uniqueElement() {
125+
return find(LOCATE.by(By.id("1")).unique());
126+
}
127+
128+
public TestableUiElement notUniqueElement() {
129+
return find(LOCATE.by(By.tagName("div")).unique());
130+
}
123131
}

integration-tests/src/test/java/eu/tsystems/mms/tic/testframework/test/guielement/UiElementTests.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,26 @@ public void test_UiElement_clear() {
5454
}
5555

5656
@Test(expectedExceptions = TimeoutException.class)
57-
public void test_UiElement_click_fails() {
57+
public void test_nonExistent_UiElement_click_fails() {
5858
WebTestPage page = getPage();
5959
page.nonExistentElement().click();
6060
}
6161

62+
@Test
63+
public void test_nonExistent_UiElement_foundElements() {
64+
getPage().nonExistentElement().expect().foundElements().is(0);
65+
}
66+
67+
@Test
68+
public void test_unique_UiElement_foundElements() {
69+
getPage().uniqueElement().expect().foundElements().is(1);
70+
}
71+
72+
@Test
73+
public void test_not_unique_UiElement_foundElements() {
74+
getPage().notUniqueElement().expect().foundElements().isNot(1);
75+
}
76+
6277
@Test
6378
public void test_UiElement_displayed_false() {
6479
WebTestPage page = getPage();

0 commit comments

Comments
 (0)