use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method args_elementByClassName_throwsException.
@Test
public void args_elementByClassName_throwsException() {
MyPage myPage = newInstance(MyPage.class, website);
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("All parameters should be annotated with @Param");
myPage.elementByClassName("session");
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByValue_genderMale_returnsWebElement.
@Test
public void findByValue_genderMale_returnsWebElement() {
when(website.findElement(ExtendedBy.byValue("MALE"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper genderMale = myPage.genderMale();
assertThat(genderMale.webElement()).isSameAs(webElement);
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method list_links_returnsWebElementList.
@Test
public void list_links_returnsWebElementList() {
WebElement linkOne = mock(WebElement.class);
when(linkOne.getText()).thenReturn("Link One");
WebElement linkTwo = mock(WebElement.class);
when(linkTwo.getText()).thenReturn("Link Two");
when(website.findElements(By.tagName("a"))).thenReturn(Arrays.asList(new WebElementWrapper(linkOne), new WebElementWrapper(linkTwo)));
MyPage myPage = newInstance(MyPage.class, website);
List<String> links = myPage.links();
assertThat(links).hasSize(2);
assertThat(links.get(0)).isEqualTo("Link One");
assertThat(links.get(1)).isEqualTo("Link Two");
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByButton_submit_returnsWebElement.
@Test
public void findByButton_submit_returnsWebElement() {
when(website.findElement(ExtendedBy.byButton("Submit"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper submit = myPage.submit();
assertThat(submit.webElement()).isSameAs(webElement);
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class PageObjectProxyTest method findByElement_returnsWebElement.
@Test
public void findByElement_returnsWebElement() {
when(website.findElement(By.name("age"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = PageObjectProxy.newInstance(MyPage.class, website);
WebElementWrapper age = myPage.age();
assertThat(age.webElement()).isEqualTo(webElement);
}
Aggregations