use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectAllNotMultiple.
@Test(groups = { "ut" }, expectedExceptions = UnsupportedOperationException.class)
public void testDeselectAllNotMultiple() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(false);
when(element.getAttribute("multiple")).thenReturn("false");
SelectList select = new SelectList("", By.id("select"));
select.deselectAll();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testGetAllSelectedOption.
@Test(groups = { "ut" })
public void testGetAllSelectedOption() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
List<WebElement> options = select.getAllSelectedOptions();
Assert.assertEquals(options.size(), 2);
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByValue.
@Test(groups = { "ut" })
public void testSelectByValue() throws IOException {
when(option1.isSelected()).thenReturn(false);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
select.selectByValue("opti1");
verify(option1).click();
verify(option2, never()).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedTextNoSelection.
@Test(groups = { "ut" })
public void testSelectedTextNoSelection() throws IOException {
SelectList select = new SelectList("", By.id("select"));
String txt = select.getSelectedText();
Assert.assertEquals(txt, "");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectAll.
@Test(groups = { "ut" })
public void testDeselectAll() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(false);
when(element.getAttribute("multiple")).thenReturn("true");
SelectList select = new SelectList("", By.id("select"));
select.deselectAll();
verify(option1).click();
verify(option2, never()).click();
}
Aggregations