use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByWithoutArguments_undefined_throwsException.
@Test
public void findByWithoutArguments_undefined_throwsException() {
MyPage myPage = newInstance(MyPage.class, website);
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("element path is not defined");
myPage.undefined();
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method args_elementByClassNameAndIndex_returnsWebElement.
@Test
public void args_elementByClassNameAndIndex_returnsWebElement() {
WebElement sessionOneElement = mock(WebElement.class);
WebElement sessionTwoElement = mock(WebElement.class);
when(website.findElement(By.cssSelector(".session:nth-child(1)"))).thenReturn(new WebElementWrapper(sessionOneElement));
when(website.findElement(By.cssSelector(".session:nth-child(2)"))).thenReturn(new WebElementWrapper(sessionTwoElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper sessionOne = myPage.elementByClassNameAndIndex("session", 1);
WebElementWrapper sessionTwo = myPage.elementByClassNameAndIndex("session", 2);
assertThat(sessionOne.webElement()).isSameAs(sessionOneElement);
assertThat(sessionTwo.webElement()).isSameAs(sessionTwoElement);
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByPlaceholder_email_returnsWebElement.
@Test
public void findByPlaceholder_email_returnsWebElement() {
when(website.findElement(ExtendedBy.byPlaceholder("Email"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper email = myPage.email();
assertThat(email.webElement()).isSameAs(webElement);
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByTextLink_failedLink_throwsException.
@Test
public void findByTextLink_failedLink_throwsException() {
when(website.findElement(By.linkText("link"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
expectedException.expect(RuntimeException.class);
expectedException.expectMessage("Cannot create instance of org.definitylabs.flue2ent.element.WebElementDecorator");
myPage.failedLink();
}
use of org.definitylabs.flue2ent.data.MyPage in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method findByValue_male_returnsWebElement.
@Test
public void findByValue_male_returnsWebElement() {
when(website.findElement(ExtendedBy.byValue("MALE"))).thenReturn(new WebElementWrapper(webElement));
MyPage myPage = newInstance(MyPage.class, website);
WebElementWrapper genderMale = myPage.male();
assertThat(genderMale.webElement()).isSameAs(webElement);
}
Aggregations