use of org.definitylabs.flue2ent.Website in project flue2ent by DefinityLabs.
the class WaiterPluginTest method expectedCondition_until_callsWaitUntil.
@Test
public void expectedCondition_until_callsWaitUntil() {
WaiterPlugin waiter = new WaiterPlugin(website);
WebElement mockedElement = mock(WebElement.class);
when(wait.until(any())).thenReturn(mockedElement);
ExpectedCondition<WebElement> expectedCondition = driver -> mockedElement;
WebElement element = waiter.until(expectedCondition);
verify(wait).until(same(expectedCondition));
assertThat(element).isSameAs(mockedElement);
}
use of org.definitylabs.flue2ent.Website in project flue2ent by DefinityLabs.
the class PageObjectTest method init_isCalledAfterSetWebsite.
@Test
public void init_isCalledAfterSetWebsite() {
Website mockedWebsite = mock(Website.class);
doAnswer(invocationOnMock -> invocationOnMock.callRealMethod()).when(webContentDsl).init();
webContentDsl.setWebsite(mockedWebsite);
verify(webContentDsl).init();
}
use of org.definitylabs.flue2ent.Website in project flue2ent by DefinityLabs.
the class PageObjectTest method driver_returnsDriver.
@Test
public void driver_returnsDriver() {
Website mockedWebsite = mock(Website.class);
WebDriver mockedDriver = mock(WebDriver.class);
when(mockedWebsite.getDriver()).thenReturn(mockedDriver);
webContentDsl.setWebsite(mockedWebsite);
WebDriver driver = webContentDsl.driver();
assertThat(driver).isSameAs(mockedDriver);
}
use of org.definitylabs.flue2ent.Website in project flue2ent by DefinityLabs.
the class PageObjectTest method website_returnsWebsite.
@Test
public void website_returnsWebsite() {
Website mockedWebsite = mock(Website.class);
webContentDsl.setWebsite(mockedWebsite);
Website website = webContentDsl.website();
assertThat(website).isSameAs(mockedWebsite);
}
use of org.definitylabs.flue2ent.Website in project flue2ent by DefinityLabs.
the class WaiterPluginTest method driver_until_callsWaitUntil.
@Test
public void driver_until_callsWaitUntil() {
WaiterPlugin waiter = new WaiterPlugin(website);
WebElement mockedElement = mock(WebElement.class);
when(wait.until(any())).thenReturn(mockedElement);
Function<WebDriver, WebElement> function = driver -> mockedElement;
WebElement element = waiter.driver().until(function);
verify(wait).until(same(function));
assertThat(element).isSameAs(mockedElement);
}
Aggregations