Skip to content

Commit

Permalink
Close notification correctly in GridEditorTest
Browse files Browse the repository at this point in the history
Change-Id: Ibe5f1cab99025fa4760ebd1e6b9d11d739e1a435
  • Loading branch information
Teemu Suo-Anttila authored and Vaadin Code Review committed Feb 5, 2015
1 parent 37ae893 commit b66c005
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -219,7 +219,7 @@ public void testInvalidEdition() {
FixedNotificationElement n = $(FixedNotificationElement.class).first();
assertEquals("Column 7: Could not convert value to Integer",
n.getCaption());
n.click();
n.close();
editor.cancel();

selectMenuPath(EDIT_ITEM_100);
Expand Down
@@ -1,6 +1,8 @@
package com.vaadin.tests.tb3.newelements;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.NotificationElement;
Expand All @@ -13,4 +15,11 @@ public String getCaption() {
WebElement caption = popup.findElement(By.tagName("h1"));
return caption.getText();
}

public void close() {
click();
WebDriverWait wait = new WebDriverWait(getDriver(), 10);
wait.until(ExpectedConditions.not(ExpectedConditions
.presenceOfAllElementsLocatedBy(By.className("v-Notification"))));
}
}

0 comments on commit b66c005

Please sign in to comment.