Search in sources :

Example 1 with ButtonElement

use of com.seleniumtests.uipage.htmlelements.ButtonElement in project seleniumRobot by bhecquet.

the class TestFrameElement method testButtonElementOutsideFrame.

@Test(groups = { "ut" })
public void testButtonElementOutsideFrame() throws Exception {
    ButtonElement el = new ButtonElement("", By.id("el"));
    el.submit();
    verify(locator, times(0)).frame(any(WebElement.class));
}
Also used : ButtonElement(com.seleniumtests.uipage.htmlelements.ButtonElement) RadioButtonElement(com.seleniumtests.uipage.htmlelements.RadioButtonElement) WebElement(org.openqa.selenium.WebElement) RemoteWebElement(org.openqa.selenium.remote.RemoteWebElement) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 2 with ButtonElement

use of com.seleniumtests.uipage.htmlelements.ButtonElement in project seleniumRobot by bhecquet.

the class TestFrameElement method testButtonElementInsideFrame.

/* tests for each element defined in framework */
/**
 * check we switched to default content and frame
 * @throws Exception
 */
@Test(groups = { "ut" })
public void testButtonElementInsideFrame() throws Exception {
    FrameElement frame = new FrameElement("", By.id("frameId"));
    ButtonElement el = new ButtonElement("", By.id("el"), frame);
    el.submit();
    verify(locator).frame(any(WebElement.class));
    verify(locator).defaultContent();
}
Also used : ButtonElement(com.seleniumtests.uipage.htmlelements.ButtonElement) RadioButtonElement(com.seleniumtests.uipage.htmlelements.RadioButtonElement) FrameElement(com.seleniumtests.uipage.htmlelements.FrameElement) WebElement(org.openqa.selenium.WebElement) RemoteWebElement(org.openqa.selenium.remote.RemoteWebElement) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Aggregations

MockitoTest (com.seleniumtests.MockitoTest)2 ButtonElement (com.seleniumtests.uipage.htmlelements.ButtonElement)2 RadioButtonElement (com.seleniumtests.uipage.htmlelements.RadioButtonElement)2 WebElement (org.openqa.selenium.WebElement)2 RemoteWebElement (org.openqa.selenium.remote.RemoteWebElement)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 Test (org.testng.annotations.Test)2 FrameElement (com.seleniumtests.uipage.htmlelements.FrameElement)1