use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class TableColumnElementTest method table_returnsTableElement.
@Test
public void table_returnsTableElement() {
WebElementWrapper webElement = mock(WebElementWrapper.class);
AbstractTableElement<TableRowElement<TableColumnElement>, TableColumnElement> mockedTable = mock(AbstractTableElement.class);
TableColumnElement tableColumnElement = new TableColumnElement(webElement, mockedTable);
assertThat(tableColumnElement.table).isSameAs(mockedTable);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class TableElementTest method createColumn_returnsTableColumnElement.
@Test
public void createColumn_returnsTableColumnElement() {
WebElementWrapper mockedWebElement = mock(WebElementWrapper.class);
TableElement table = new TableElement(mockedWebElement);
TableColumnElement column = table.createColumn(mockedWebElement);
assertThat(column).isNotNull();
assertThat(column.webElement()).isSameAs(mockedWebElement);
assertThat(column.table).isSameAs(table);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class FindRowByColumnTest method beforeEach.
@Before
public void beforeEach() {
tableWebElement = mock(WebElement.class);
columnWebElement = mock(WebElement.class);
rowWebElement = mock(WebElement.class);
when(rowWebElement.findElements(By.tagName("td"))).thenReturn(Collections.singletonList(columnWebElement));
when(tableWebElement.findElements(By.tagName("tr"))).thenReturn(Collections.singletonList(rowWebElement));
table = new TableElement(new WebElementWrapper(tableWebElement));
row = table.row(0);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper 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.element.WebElementWrapper 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