use of com.vaadin.flow.component.radiobutton.testbench.RadioButtonGroupElement in project linkki by linkki-framework.
the class TC001AbstractLayoutTest method testRadioButton_HasLabel.
@Test
void testRadioButton_HasLabel() {
RadioButtonGroupElement field = getTestCaseSection().$(RadioButtonGroupElement.class).id("enumValueRadioButton");
WebElement label = field.findElement(By.xpath("./label"));
assertThat(label.getText()).contains("RadioButtons");
}
use of com.vaadin.flow.component.radiobutton.testbench.RadioButtonGroupElement in project linkki by linkki-framework.
the class TS001AbstractBasicElementsLayoutTest method testRadioButtons_IsSelectable.
@Order(50)
@Test
void testRadioButtons_IsSelectable() {
RadioButtonGroupElement radioButtons = //
testCaseSection.getContentWrapper().$(RadioButtonGroupElement.class).id("enumValueRadioButton");
// precondition
assertThat(radioButtons.getSelectedText()).isNull();
// action
radioButtons.selectByText(SampleEnum.VALUE3.getName());
// postcondition
assertThat(radioButtons.getSelectedText()).isEqualTo(SampleEnum.VALUE3.getName());
}
use of com.vaadin.flow.component.radiobutton.testbench.RadioButtonGroupElement in project linkki by linkki-framework.
the class TC010UIButtonTest method testShortcut_InMultiLineInput_WithCrtlEnter.
@Disabled("LIN-2621")
@Test
void testShortcut_InMultiLineInput_WithCrtlEnter() {
TextAreaElement textArea = getTextArea();
LinkkiTextElement counter = getCounter();
RadioButtonGroupElement radioButtonGroup = $(RadioButtonGroupElement.class).id("testBehaviorWithTextArea");
radioButtonGroup.selectByText(ButtonPmo.TestShortcutBehavior.BUTTON_WITH_CRTL_ENTER.toString());
assertThat(counter.getText()).isEqualTo("Counter: 0");
textArea.focus();
sendKeys(null, "Crtl+Enter!");
sendKeys(Keys.CONTROL, Keys.ENTER);
assertThat(textArea.getValue()).describedAs("Crtl+Enter should not add new line").isEqualTo("Crtl+Enter!");
assertThat(counter.getText()).isEqualTo("Counter: 1");
assertThat($(DivElement.class).id("contentAsText").getText()).as("Value of the text area should have been sent to server").isEqualTo("Crtl+Enter!");
}
use of com.vaadin.flow.component.radiobutton.testbench.RadioButtonGroupElement in project linkki by linkki-framework.
the class TC010UIButtonTest method testShortcutKey_InSingleLineInput_WithEnterIfNotEmpty.
@Test
void testShortcutKey_InSingleLineInput_WithEnterIfNotEmpty() {
TextFieldElement textField = $(TextFieldElement.class).id("contentAsTextField");
LinkkiTextElement counter = getCounter();
RadioButtonGroupElement radioButtonGroup = $(RadioButtonGroupElement.class).id("testBehaviorWithTextArea");
radioButtonGroup.selectByText(ButtonPmo.TestShortcutBehavior.BUTTON_DISABLED_IF_EMPTY.toString());
assertThat(counter.getText()).isEqualTo("Counter: 0");
assertThat($(LinkkiTextElement.class).id("contentAsText").getText()).isEmpty();
assertThat($(ButtonElement.class).id("buttonWithEnterIfNotEmpty").isEnabled()).isFalse();
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!");
}
Aggregations