use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedValue.
@Test(groups = { "ut" })
public void testSelectedValue() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
String txt = select.getSelectedValue();
Assert.assertEquals(txt, "opti1");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedValuesNoSelection.
@Test(groups = { "ut" })
public void testSelectedValuesNoSelection() throws IOException {
SelectList select = new SelectList("", By.id("select"));
String[] txt = select.getSelectedValues();
Assert.assertEquals(txt.length, 0);
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testGetFirstSelectedOption.
@Test(groups = { "ut" })
public void testGetFirstSelectedOption() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
WebElement option = select.getFirstSelectedOption();
Assert.assertEquals(option.getText(), "opt1");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testGetOptions.
@Test(groups = { "ut" })
public void testGetOptions() throws IOException {
SelectList select = new SelectList("", By.id("select"));
List<WebElement> options = select.getOptions();
Assert.assertEquals(options.size(), 2);
Assert.assertTrue(select.getSelectImplementation() instanceof NativeSelect);
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByText.
@Test(groups = { "ut" })
public void testSelectByText() throws IOException {
when(option1.isSelected()).thenReturn(false);
when(option2.isSelected()).thenReturn(true);
when(element.getAttribute("multiple")).thenReturn("true");
SelectList select = new SelectList("", By.id("select"));
select.selectByText("opt1");
verify(option1).click();
verify(option2, never()).click();
}
Aggregations