use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class PageObjectProxyTest method findByElements_links_returnsWebElementList.
@Test
public void findByElements_links_returnsWebElementList() {
WebElement linkOne = mock(WebElement.class);
when(linkOne.getText()).thenReturn("Link One");
WebElement linkTwo = mock(WebElement.class);
when(linkTwo.getText()).thenReturn("Link Two");
when(website.findElements(By.tagName("a"))).thenReturn(Arrays.asList(new WebElementWrapper(linkOne), new WebElementWrapper(linkTwo)));
MyPage myPage = PageObjectProxy.newInstance(MyPage.class, website);
List<String> links = myPage.links();
assertThat(links).hasSize(2);
assertThat(links.get(0)).isEqualTo("Link One");
assertThat(links.get(1)).isEqualTo("Link Two");
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class ListElementTest method new_returnsListElement.
@Test
public void new_returnsListElement() {
ListElement listElement = new ListElement(new WebElementWrapper(webElement));
assertThat(listElement.byItem).isEqualTo(By.tagName("li"));
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class ListElementTest method createListItem_returnsNewListItemElement.
@Test
public void createListItem_returnsNewListItemElement() {
ListElement listElement = new ListElement(new WebElementWrapper(webElement));
WebElement webElementItem = mock(WebElement.class);
WebElementWrapper webElementWrapper = new WebElementWrapper(webElementItem);
ListItemElement listItem = listElement.createListItem(webElementWrapper);
assertThat(listItem.webElement()).isSameAs(webElementWrapper);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method isMultiple_callsIsMultiple.
@Test
public void isMultiple_callsIsMultiple() {
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
when(select.isMultiple()).thenReturn(true);
boolean multiple = selectElement.isMultiple();
verify(select).isMultiple();
assertThat(multiple).isTrue();
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class TableRowElementTest method beforeEach.
@Before
public void beforeEach() {
webElementWrapper = new WebElementWrapper(webElement);
table = new AbstractTableElement<TableRowElement<TableColumnElement>, TableColumnElement>(webElementWrapper) {
@Override
protected TableRowElement<TableColumnElement> createRow(WebElementWrapper webElement) {
return new TableRowElement<>(webElement, this);
}
@Override
protected TableColumnElement createColumn(WebElementWrapper webElement) {
return new TableColumnElement(webElement, this);
}
};
}
Aggregations