use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class TemplateIT method testElementReferencedByReflection.
@Test
public void testElementReferencedByReflection() {
SpanElement span = $(ReflectivelyReferencedComponent.TAG).first().$(SpanElement.class).first();
Assert.assertEquals("ReflectivelyReferencedComponent contents", span.getText());
}
use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class ApplicationThemeComponentIT method validateEmbeddedComponent.
private void validateEmbeddedComponent(TestBenchElement themedComponent, String target) {
Assert.assertEquals(target + " didn't contain the background image", "url(\"" + getRootURL() + "/VAADIN/static/themes/embedded-theme/img/bg.jpg\")", themedComponent.getCssValue("background-image"));
Assert.assertEquals(target + " didn't contain font-family", "Ostrich", themedComponent.getCssValue("font-family"));
final TestBenchElement embeddedComponent = themedComponent.$(DivElement.class).id(EMBEDDED_ID);
final SpanElement handElement = embeddedComponent.$(SpanElement.class).id(HAND_ID);
Assert.assertEquals("Color should have been applied", "rgba(0, 128, 0, 1)", handElement.getCssValue("color"));
}
use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class CustomRouteIT method testCustomErrorView.
@Test
public void testCustomErrorView() {
getDriver().get(getRootURL() + "/none");
final SpanElement error = $(SpanElement.class).id("error");
Assert.assertEquals("Requested route was simply not found!", error.getText());
}
use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class UtilityClassNameIT method lumoUtils_customStylesHaveBeenExpanded.
@Test
public void lumoUtils_customStylesHaveBeenExpanded() {
open();
checkLogsForErrors();
SpanElement primary = $(SpanElement.class).id("primary");
Assert.assertEquals("rgba(0, 128, 0, 1)", primary.getCssValue("color"));
}
use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class CustomRouteIT method CustomRegistry_hasExpectedErrorHandlers.
@Test
public void CustomRegistry_hasExpectedErrorHandlers() {
getDriver().get(getRootURL());
final SpanElement notFoundException = $(SpanElement.class).id("NotFoundException");
Assert.assertEquals("Wrong error handler registered", "NotFoundException :: CustomNotFoundView", notFoundException.getText());
try {
$(SpanElement.class).id("IllegalAccessException");
Assert.fail("Found IllegalAccessException error handler even though it should not be registered");
} catch (NoSuchElementException nsee) {
// NO-OP as this should throw element not found
}
}
Aggregations