use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class ComponentAddedViaInitListenerIT method componentAddedViaInitListenerIsLoaded.
@Test
public void componentAddedViaInitListenerIsLoaded() {
open();
TestBenchElement component = $("init-listener-component").first();
TestBenchElement div = component.$("div").first();
org.junit.Assert.assertEquals("Init Listener Component", div.getText());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class MultipleNpmPackageAnnotationsIT method pageShouldContainTwoPaperComponents.
@Test
public void pageShouldContainTwoPaperComponents() {
TestBenchElement paperInput = $("paper-input").first();
TestBenchElement paperCheckbox = $("paper-checkbox").first();
// check that elements are on the page
Assert.assertNotNull(paperInput);
Assert.assertNotNull(paperCheckbox);
// verify that the paper components are upgraded
Assert.assertNotNull(paperInput.$("paper-input-container"));
Assert.assertNotNull(paperCheckbox.$("checkboxContainer"));
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class SessionValueIT method sessionValuePreservedOnReload.
@Test
public void sessionValuePreservedOnReload() throws InterruptedException {
open();
TestBenchElement div = $("div").id("customAttribute");
String customAttribute = div.getText().replace("The custom value in the session is: ", "");
// trigger reload
findElement(By.id(WebpackDevServerPortView.TRIGGER_RELOAD_ID)).click();
waitForElementPresent(By.id("customAttribute"));
div = $("div").id("customAttribute");
String customAttributeAfterReload = div.getText().replace("The custom value in the session is: ", "");
Assert.assertEquals(customAttribute, customAttributeAfterReload);
// trigger reload
findElement(By.id(WebpackDevServerPortView.TRIGGER_RELOAD_ID)).click();
waitForElementPresent(By.id("customAttribute"));
div = $("div").id("customAttribute");
String customAttributeAfterSecondReload = div.getText().replace("The custom value in the session is: ", "");
Assert.assertEquals(customAttribute, customAttributeAfterSecondReload);
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class NoThemeComponentIT method themeIsNotApplied.
@Test
public void themeIsNotApplied() {
open();
TestBenchElement link = $("a").first();
String text = link.getText();
Assert.assertEquals("Hello notheme", text);
String color = link.getCssValue("color");
Assert.assertEquals("Unexpected color for a link. " + "@NoTheme should not theme a link anyhow.", "rgba(0, 0, 0, 1)", color);
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class SecurityIT method assertAdminPageShown.
private void assertAdminPageShown(String fullName) {
assertPathShown("admin");
TestBenchElement welcome = waitUntil(driver -> $("*").id("welcome"));
String welcomeText = welcome.getText();
Assert.assertEquals("Welcome to the admin page, " + fullName, welcomeText);
}
Aggregations