use of org.definitylabs.flue2ent.data.SubPage in project flue2ent by DefinityLabs.
the class PageObjectProxyTest method webProxy_subPage_returnsWebElement.
@Test
public void webProxy_subPage_returnsWebElement() {
WebElement h1Element = mock(WebElement.class);
when(website.findElement(By.cssSelector(".subPage"))).thenReturn(new WebElementWrapper(webElement));
when(website.findElement(By.tagName("h1"))).thenReturn(new WebElementWrapper(h1Element));
MyPage myPage = PageObjectProxy.newInstance(MyPage.class, website);
SubPage subPage = myPage.subPage();
assertThat(subPage.title().webElement()).isSameAs(h1Element);
}
use of org.definitylabs.flue2ent.data.SubPage in project flue2ent by DefinityLabs.
the class PageObjectProxyTest method findByCssUsingProxy_nothing_returnsWebElement.
@Test
public void findByCssUsingProxy_nothing_returnsWebElement() {
WebElement h1Element = mock(WebElement.class);
when(website.findElement(By.cssSelector(".subPage"))).thenReturn(new WebElementWrapper(webElement));
when(website.findElement(By.tagName("h1"))).thenReturn(new WebElementWrapper(h1Element));
MyPage myPage = PageObjectProxy.newInstance(MyPage.class, website);
SubPage subPage = myPage.subPage();
assertThat(subPage.title().webElement()).isSameAs(h1Element);
}
Aggregations