use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByClassName_getBirthday_returnsWebElementValueAttribute.
@Test
public void findByClassName_getBirthday_returnsWebElementValueAttribute() {
when(website.findElement(By.className("birthday"))).thenReturn(new WebElementWrapper(webElement));
when(webElement.getAttribute("value")).thenReturn("birthday");
MyPage myPage = newInstance(MyPage.class, website);
String birthday = myPage.getBirthday();
assertThat(birthday).isEqualTo("birthday");
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByCss_birthday_returnsWebElement.
@Test
public void findByCss_birthday_returnsWebElement() {
when(website.findElement(By.cssSelector(".birthday"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper birthday = myPage.birthday();
assertThat(birthday.webElement()).isEqualTo(webElement);
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByWithoutArguments_nothing_whenCanHandleIsTrue_returnsNull.
@Test
public void findByWithoutArguments_nothing_whenCanHandleIsTrue_returnsNull() {
when(webElementProxy.canHandle(any(Method.class))).thenReturn(true);
MyPage myPage = newInstance(MyPage.class, website);
String undefined = myPage.nothing();
assertThat(undefined).isNull();
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findById_getName_returnsWebElementText.
@Test
public void findById_getName_returnsWebElementText() {
when(website.findElement(By.id("name"))).thenReturn(new WebElementWrapper(webElement));
when(webElement.getText()).thenReturn("name");
MyPage myPage = newInstance(MyPage.class, website);
String name = myPage.getName();
assertThat(name).isEqualTo("name");
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByPartialLinkText_address_returnsTableElement.
@Test
public void findByPartialLinkText_address_returnsTableElement() {
when(website.findElement(By.partialLinkText("Address"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper address = myPage.address();
assertThat(address.webElement()).isSameAs(webElement);
}
Aggregations