use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedText.
@Test(groups = { "ut" })
public void testSelectedText() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
String txt = select.getSelectedText();
Assert.assertEquals(txt, "opt1");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedValues.
@Test(groups = { "ut" })
public void testSelectedValues() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
String[] txt = select.getSelectedValues();
Assert.assertEquals(txt[0], "opti1");
Assert.assertEquals(txt[1], "opti2");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedTexts.
@Test(groups = { "ut" })
public void testSelectedTexts() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
SelectList select = new SelectList("", By.id("select"));
String[] txt = select.getSelectedTexts();
Assert.assertEquals(txt[0], "opt1");
Assert.assertEquals(txt[1], "opt2");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByTexts.
@Test(groups = { "ut" })
public void testSelectByTexts() throws IOException {
when(option1.isSelected()).thenReturn(false);
when(option2.isSelected()).thenReturn(false);
when(element.getAttribute("multiple")).thenReturn("true");
SelectList select = new SelectList("", By.id("select"));
select.selectByText("opt1", "opt2");
verify(option1).click();
verify(option2).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByIndexes.
@Test(groups = { "ut" })
public void testSelectByIndexes() 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.selectByIndex(1, 2);
verify(option1).click();
verify(option2, never()).click();
}
Aggregations