use of com.seleniumtests.uipage.htmlelements.RadioButtonElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testRadioButtonElementOutsideFrame.
@Test(groups = { "ut" })
public void testRadioButtonElementOutsideFrame() throws Exception {
RadioButtonElement el = new RadioButtonElement("", By.id("el"));
el.check();
verify(locator, times(0)).frame(any(WebElement.class));
}
use of com.seleniumtests.uipage.htmlelements.RadioButtonElement in project seleniumRobot by bhecquet.
the class PageObject method assertNotChecked.
@GenericStep
public <T extends PageObject> T assertNotChecked(String fieldName) {
Element element = getElement(fieldName);
if (element instanceof CheckBoxElement || element instanceof RadioButtonElement) {
Assert.assertTrue(((HtmlElement) element).isElementPresent(0), String.format(ERROR_ELEMENT_NOT_PRESENT, fieldName));
Assert.assertFalse(((HtmlElement) element).isSelected(), String.format("Element %s is checked", fieldName));
} else {
throw new ScenarioException(String.format("Element %s is not an CheckBoxElement/RadioButtonElement", fieldName));
}
return (T) this;
}
use of com.seleniumtests.uipage.htmlelements.RadioButtonElement in project seleniumRobot by bhecquet.
the class PageObject method assertChecked.
@GenericStep
public <T extends PageObject> T assertChecked(String fieldName) {
Element element = getElement(fieldName);
if (element instanceof CheckBoxElement || element instanceof RadioButtonElement) {
Assert.assertTrue(((HtmlElement) element).isElementPresent(0), String.format(ERROR_ELEMENT_NOT_PRESENT, fieldName));
Assert.assertTrue(((HtmlElement) element).isSelected(), String.format("Element %s is unchecked", fieldName));
} else {
throw new ScenarioException(String.format("Element %s is not an CheckBoxElement/RadioButtonElement", fieldName));
}
return (T) this;
}
use of com.seleniumtests.uipage.htmlelements.RadioButtonElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testRadioButtonElementInsideFrame.
@Test(groups = { "ut" })
public void testRadioButtonElementInsideFrame() throws Exception {
FrameElement frame = new FrameElement("", By.id("frameId"));
RadioButtonElement el = new RadioButtonElement("", By.id("el"), frame);
el.check();
verify(locator).frame(any(WebElement.class));
verify(locator).defaultContent();
}
Aggregations