use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class TemplateIT method testElementIdMapping.
@Test
public void testElementIdMapping() {
final String initialValue = "Default";
SpanElement litSpan = $(LitComponent.TAG).first().$(SpanElement.class).first();
Assert.assertEquals(initialValue, litSpan.getText());
SpanElement polymerSpan = $(PolymerComponent.TAG).first().$(SpanElement.class).first();
Assert.assertEquals(initialValue, polymerSpan.getText());
SpanElement addonLitSpan = $(AddonLitComponent.TAG).first().$(SpanElement.class).first();
Assert.assertEquals(initialValue, addonLitSpan.getText());
final String newLabel = "New label";
$(InputTextElement.class).first().setValue(newLabel);
$(NativeButtonElement.class).first().click();
Assert.assertEquals(newLabel, litSpan.getText());
Assert.assertEquals(newLabel, polymerSpan.getText());
Assert.assertEquals(newLabel, addonLitSpan.getText());
}
use of com.vaadin.flow.component.html.testbench.SpanElement in project flow by vaadin.
the class ApplicationThemeComponentIT method documentCssFonts_fontsAreAppliedAndAvailable.
@Test
public void documentCssFonts_fontsAreAppliedAndAvailable() {
open();
checkLogsForErrors();
final TestBenchElement themedComponent = $("themed-component").first();
final TestBenchElement embeddedComponent = themedComponent.$(DivElement.class).id(EMBEDDED_ID);
final SpanElement handElement = embeddedComponent.$(SpanElement.class).id(HAND_ID);
Assert.assertEquals("Font family faulty", "\"Font Awesome 5 Free\"", handElement.getCssValue("font-family"));
Assert.assertEquals("Font weight faulty", "900", handElement.getCssValue("font-weight"));
Assert.assertEquals("display value faulty", "inline-block", handElement.getCssValue("display"));
getDriver().get(getRootURL() + "/path/VAADIN/static/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2");
Assert.assertFalse("Font resource should be available", driver.getPageSource().contains("HTTP ERROR 404 Not Found"));
}
Aggregations