*/
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;
$(ButtonElement.class).first().click();
- Assert.assertFalse(
- "Error notification with client side exception is shown",
- isElementPresent(By.className("v-Notification-error")));
+ assertNoErrorNotifications();
}
+
}
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",
*/
package com.vaadin.tests.components.popupview;
-import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;
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();
}
}
*/
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;
Actions actions = new Actions(driver);
actions.clickAndHold(source).moveToElement(target).release();
- Assert.assertFalse(isElementPresent(By
- .className("v-Notification-error")));
+ assertNoErrorNotifications();
}
}
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"));
+ }
+
}