ソースを参照

Extract duplciated logic for checking for error notifications

Change-Id: I1cc630e9c21b3e73d135129ba3d86f7b22019e0f
tags/7.6.0.alpha2
Leif Åstrand 9年前
コミット
ca15c5bb99

+ 2
- 5
uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveComponentTest.java ファイルの表示

@@ -15,9 +15,7 @@
*/
package com.vaadin.tests.components.accordion;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -36,8 +34,7 @@ public class AccordionRemoveComponentTest extends MultiBrowserTest {

$(ButtonElement.class).first().click();

Assert.assertFalse(
"Error notification with client side exception is shown",
isElementPresent(By.className("v-Notification-error")));
assertNoErrorNotifications();
}

}

+ 1
- 3
uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java ファイルの表示

@@ -38,9 +38,7 @@ public class ReadOnlyOptionGroupTest extends MultiBrowserTest {
WebElement checkboxInput = checkbox.findElement(By.tagName("input"));
checkboxInput.click();

Assert.assertFalse("There is a client side exception after unset "
+ "readonly mode for option group",
isElementPresent(By.className("v-Notification-error")));
assertNoErrorNotifications();

Assert.assertFalse("Radio button in option group is still disabled "
+ "after unset reaonly",

+ 1
- 5
uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java ファイルの表示

@@ -15,7 +15,6 @@
*/
package com.vaadin.tests.components.popupview;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;

@@ -38,10 +37,7 @@ public class PopupViewWithExtensionTest extends MultiBrowserTest {
WebElement view = driver.findElement(By.className("v-popupview"));
view.click();

Assert.assertFalse(
"Popup view with extension should not throw an exception. "
+ "(Error notification window is shown).",
isElementPresent(By.className("v-Notification-error")));
assertNoErrorNotifications();
}

}

+ 1
- 3
uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java ファイルの表示

@@ -15,7 +15,6 @@
*/
package com.vaadin.tests.components.table;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
@@ -42,8 +41,7 @@ public class DndEmptyTableTest extends MultiBrowserTest {
Actions actions = new Actions(driver);
actions.clickAndHold(source).moveToElement(target).release();

Assert.assertFalse(isElementPresent(By
.className("v-Notification-error")));
assertNoErrorNotifications();
}

}

+ 17
- 0
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java ファイルの表示

@@ -1065,4 +1065,21 @@ public abstract class AbstractTB3Test extends ParallelTest {
Assert.assertFalse("Element is present", isElementPresent(by));
}

/**
* Asserts that no error notifications are shown. Requires the use of
* "?debug" as exceptions are otherwise not shown as notifications.
*/
protected void assertNoErrorNotifications() {
Assert.assertTrue(
"Debug window must be open to be able to see error notifications",
isDebugWindowOpen());
Assert.assertFalse(
"Error notification with client side exception is shown",
isElementPresent(By.className("v-Notification-error")));
}

private boolean isDebugWindowOpen() {
return isElementPresent(By.className("v-debugwindow"));
}

}

読み込み中…
キャンセル
保存