use of org.linkki.samples.playground.pageobjects.LinkkiTextElement in project linkki by linkki-framework.
the class TC001UILabelTest method testLabel_NotHtmlContent.
@Test
void testLabel_NotHtmlContent() {
LinkkiTextElement label = $(LinkkiTextElement.class).id("notHtmlContentLabel");
assertThat(label.getText()).isEqualTo("<b>NOT</b> HTML Content");
assertThat(label.findElements(By.tagName("b"))).isEmpty();
assertThat(label.getHTMLContent()).isEqualTo("<b>NOT</b> HTML Content");
}
use of org.linkki.samples.playground.pageobjects.LinkkiTextElement in project linkki by linkki-framework.
the class TC001UILabelTest method testLabel_WithCustomStyle.
@Test
void testLabel_WithCustomStyle() {
LinkkiTextElement label = $(LinkkiTextElement.class).id("styledLabel");
assertThat(label.getCssValue("color")).isEqualTo("rgba(0, 128, 0, 1)");
}
use of org.linkki.samples.playground.pageobjects.LinkkiTextElement in project linkki by linkki-framework.
the class TC010UIButtonTest method testShortcutKey_InSingleLineInput_WithEnter.
@Test
void testShortcutKey_InSingleLineInput_WithEnter() {
TextFieldElement textField = $(TextFieldElement.class).id("contentAsTextField");
LinkkiTextElement counter = getCounter();
assertThat(counter.getText()).isEqualTo("Counter: 0");
assertThat($(LinkkiTextElement.class).id("contentAsText").getText()).isEmpty();
textField.focus();
sendKeys(null, "Enter!");
sendKeys(null, Keys.ENTER);
assertThat(counter.getText()).describedAs("Button shortcut should be triggered").isEqualTo("Counter: 1");
assertThat($(LinkkiTextElement.class).id("contentAsText").getText()).as("New value of the input should have been sent to server").isEqualTo("Enter!");
}
use of org.linkki.samples.playground.pageobjects.LinkkiTextElement in project linkki by linkki-framework.
the class TC010UIButtonTest method testOnClick.
@Test
void testOnClick() {
LinkkiTextElement counter = getCounter();
ButtonElement increaseCounterButton = $(ButtonElement.class).id("increaseCounter");
assertThat(counter.getText()).isEqualTo("Counter: 0");
IntStream.range(0, 10).forEach(i -> increaseCounterButton.click());
assertThat(counter.getText()).isEqualTo("Counter: 10");
}
use of org.linkki.samples.playground.pageobjects.LinkkiTextElement in project linkki by linkki-framework.
the class TC010UIButtonTest method testShortcutKey_FocusOnShortcutButton.
@Disabled("LIN-2620")
@Test
void testShortcutKey_FocusOnShortcutButton() {
LinkkiTextElement counter = getCounter();
assertThat(counter.getText()).isEqualTo("Counter: 0");
ButtonElement increaseCounterButton = $(ButtonElement.class).id("buttonWithEnter");
increaseCounterButton.focus();
sendKeys(null, Keys.ENTER);
assertThat(counter.getText()).as("Button should not be triggered twice if the shortcut is triggered while focusing the button").isEqualTo("Counter: 1");
}
Aggregations