use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method deselectByVisibleText_callsDeselectByVisibleText.
@Test
public void deselectByVisibleText_callsDeselectByVisibleText() {
String text = "text";
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectElement result = selectElement.deselectByVisibleText(text);
verify(select).deselectByVisibleText(text);
assertThat(result).isSameAs(selectElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SimpleWebElementDecoratorProxyTest method findElements_rows_returnsWebElementList.
@Test
public void findElements_rows_returnsWebElementList() {
WebElement rowElementOne = mock(WebElement.class);
WebElement rowElementTwo = mock(WebElement.class);
when(webElement.findElements(By.className("row"))).thenReturn(Arrays.asList(rowElementOne, rowElementTwo));
WebElementWrapper webElementWrapper = new WebElementWrapper(webElement);
FakeTableElement fakeTableElement = SimpleWebElementDecoratorProxy.newInstance(FakeTableElement.class, webElementWrapper);
List<WebElementWrapper> rows = fakeTableElement.rows();
assertThat(rows).hasSize(2);
assertThat(rows.get(0).webElement()).isSameAs(rowElementOne);
assertThat(rows.get(1).webElement()).isSameAs(rowElementTwo);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SimpleWebElementDecoratorProxyTest method webElement_returnsWebElementWrapperFromDecorator.
@Test
public void webElement_returnsWebElementWrapperFromDecorator() {
WebElementWrapper webElementWrapper = new WebElementWrapper(webElement);
FakeTableElement fakeTableElement = SimpleWebElementDecoratorProxy.newInstance(FakeTableElement.class, webElementWrapper);
WebElementWrapper fakeTableWebElement = fakeTableElement.webElement();
assertThat(fakeTableWebElement).isSameAs(webElementWrapper);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class TableColumnElementTest method text_returnsWebElementText.
@Test
public void text_returnsWebElementText() {
WebElement webElement = mock(WebElement.class);
String elementText = "element text";
when(webElement.getText()).thenReturn(elementText);
WebElementWrapper webElementWrapper = new WebElementWrapper(webElement);
AbstractTableElement<TableRowElement<TableColumnElement>, TableColumnElement> mockedTable = mock(AbstractTableElement.class);
TableColumnElement tableColumnElement = new TableColumnElement(webElementWrapper, mockedTable);
String text = tableColumnElement.text();
assertThat(text).isEqualTo(elementText);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class TableElementTest method createRow_returnsTableRowElement.
@Test
public void createRow_returnsTableRowElement() {
WebElementWrapper mockedWebElement = mock(WebElementWrapper.class);
TableElement table = new TableElement(mockedWebElement);
TableRowElement<TableColumnElement> row = table.createRow(mockedWebElement);
assertThat(row).isNotNull();
assertThat(row.webElement()).isSameAs(mockedWebElement);
assertThat(row.table).isSameAs(table);
}
Aggregations