Skip to content

Commit

Permalink
Make test work on all browsers (#13775)
Browse files Browse the repository at this point in the history
Change-Id: I282b3d5b14a5ec09060491bd9833c76f061bbf56
  • Loading branch information
Artur- authored and Vaadin Code Review committed Feb 5, 2015
1 parent 0ad0caa commit 4204410
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Expand Up @@ -38,6 +38,7 @@
import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeatures; import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeatures;
import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
import com.vaadin.tests.tb3.newelements.FixedNotificationElement;


public class GridEditorTest extends GridBasicFeaturesTest { public class GridEditorTest extends GridBasicFeaturesTest {


Expand Down Expand Up @@ -215,9 +216,9 @@ public void testInvalidEdition() {
intField.clear(); intField.clear();
intField.sendKeys("banana phone"); intField.sendKeys("banana phone");
editor.save(); editor.save();
WebElement n = $(NotificationElement.class).first(); FixedNotificationElement n = $(FixedNotificationElement.class).first();
assertEquals("Column 7: Could not convert value to Integer", assertEquals("Column 7: Could not convert value to Integer",
n.getText()); n.getCaption());
n.click(); n.click();
editor.cancel(); editor.cancel();


Expand Down
@@ -0,0 +1,16 @@
package com.vaadin.tests.tb3.newelements;

import org.openqa.selenium.WebElement;

import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.testbench.elements.ServerClass;

@ServerClass("com.vaadin.ui.Notification")
public class FixedNotificationElement extends NotificationElement {
public String getCaption() {
WebElement popup = findElement(By.className("popupContent"));
WebElement caption = popup.findElement(By.tagName("h1"));
return caption.getText();
}
}

0 comments on commit 4204410

Please sign in to comment.