use of com.seleniumtests.uipage.htmlelements.LabelElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testLabelElementOutsideFrame.
@Test(groups = { "ut" })
public void testLabelElementOutsideFrame() throws Exception {
LabelElement el = new LabelElement("", By.id("el"));
el.click();
verify(locator, times(0)).frame(any(WebElement.class));
}
use of com.seleniumtests.uipage.htmlelements.LabelElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testLabelElementInsideFrame.
@Test(groups = { "ut" })
public void testLabelElementInsideFrame() throws Exception {
FrameElement frame = new FrameElement("", By.id("frameId"));
LabelElement el = new LabelElement("", By.id("el"), frame);
el.click();
verify(locator).frame(any(WebElement.class));
verify(locator).defaultContent();
}
use of com.seleniumtests.uipage.htmlelements.LabelElement in project seleniumRobot by bhecquet.
the class TestLabelElement method testLabelElement.
@Test(groups = { "ut" })
public void testLabelElement() throws Exception {
PowerMockito.mockStatic(WebUIDriver.class);
Mockito.when(WebUIDriver.getWebDriver(anyBoolean())).thenReturn(driver);
Mockito.when(driver.findElement(By.id("label"))).thenReturn(element);
Mockito.when(element.getText()).thenReturn("textual label");
Mockito.when(driver.switchTo()).thenReturn(locator);
LabelElement el = Mockito.spy(new LabelElement("label", By.id("label")));
Assert.assertEquals(el.getText(), "textual label");
// check we called getDriver before using it
PowerMockito.verifyPrivate(el, Mockito.times(1)).invoke("updateDriver");
}
Aggregations