use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testGetFirstSelectedOptionNoneSelected.
@Test(groups = { "ut" })
public void testGetFirstSelectedOptionNoneSelected() throws IOException {
SelectList select = new SelectList("", By.id("select"));
WebElement option = select.getFirstSelectedOption();
Assert.assertNull(option);
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectByText.
@Test(groups = { "ut" })
public void testDeselectByText() 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("opt2");
verify(option1, never()).click();
verify(option2).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testDeselectByValue.
@Test(groups = { "ut" })
public void testDeselectByValue() 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.deselectByValue("opti2");
verify(option1, never()).click();
verify(option2).click();
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestSelectList method testSelectedValueNoSelection.
@Test(groups = { "ut" })
public void testSelectedValueNoSelection() throws IOException {
SelectList select = new SelectList("", By.id("select"));
String txt = select.getSelectedValue();
Assert.assertEquals(txt, "");
}
use of com.seleniumtests.uipage.htmlelements.SelectList in project seleniumRobot by bhecquet.
the class TestFrameElement method testSelectListOutsideFrame.
@Test(groups = { "ut" })
public void testSelectListOutsideFrame() throws Exception {
when(element.getTagName()).thenReturn("select");
SelectList el = new SelectList("", By.id("el"));
el.getSelectedText();
verify(locator, times(0)).frame(any(WebElement.class));
}
Aggregations