use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectByIndex.
@Test(groups = { "ut" })
public void testDeselectByIndex() 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.deselectByIndex(2);
verify(option1, never()).click();
verify(option2).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByCorrespondingText.
/**
* Check only one option is selected when one text is given
* @throws IOException
*/
@Test(groups = { "ut" })
public void testSelectByCorrespondingText() throws IOException {
when(option1.isSelected()).thenReturn(false);
when(option2.isSelected()).thenReturn(false);
SelectList select = new SelectList("", By.id("select"));
select.selectByCorrespondingText("Opt");
verify(option1).click();
verify(option2, never()).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectByTextNotSelected.
@Test(groups = { "ut" })
public void testDeselectByTextNotSelected() 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.deselectByText("opt1");
verify(option1, never()).click();
verify(option2, never()).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectByCorrespondingTexts.
/**
* Check only one option is selected when one text is given
* @throws IOException
*/
@Test(groups = { "ut" })
public void testSelectByCorrespondingTexts() 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.selectByCorrespondingText("PT1", "PT2");
verify(option1).click();
verify(option2).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectByCorrespondingText.
@Test(groups = { "ut" })
public void testDeselectByCorrespondingText() throws IOException {
when(option1.isSelected()).thenReturn(true);
when(option2.isSelected()).thenReturn(true);
when(element.getAttribute("multiple")).thenReturn("true");
SelectList select = new SelectList("", By.id("select"));
select.deselectByCorrespondingText("Pt2");
verify(option1, never()).click();
verify(option2).click();
}
Aggregations