use of org.definitylabs.flue2ent.element.list.SelectElement in project flue2ent by DefinityLabs.
the class AbstractWebElementProxyTest method list_rows_returnsWebElementList.
@Test
public void list_rows_returnsWebElementList() {
WebElement selectOne = mock(WebElement.class);
WebElement selectTwo = mock(WebElement.class);
when(website.findElements(By.tagName("select"))).thenReturn(Arrays.asList(new WebElementWrapper(selectOne), new WebElementWrapper(selectTwo)));
MyPage myPage = newInstance(MyPage.class, website);
List<SelectElement> selects = myPage.selects();
assertThat(selects).hasSize(2);
assertThat(selects.get(0).webElement().webElement()).isSameAs(selectOne);
assertThat(selects.get(1).webElement().webElement()).isSameAs(selectTwo);
}
use of org.definitylabs.flue2ent.element.list.SelectElement in project flue2ent by DefinityLabs.
the class WebElementConverterTest method convertTo_whenAttributeIsEmptyAndReturnTypeIsSelectElement_returnsSelectElement.
@Test
public void convertTo_whenAttributeIsEmptyAndReturnTypeIsSelectElement_returnsSelectElement() throws Exception {
WebElement webElement = mock(WebElement.class);
WebElementWrapper webElementWrapper = new WebElementWrapper(webElement);
Select select = mock(Select.class);
PowerMockito.whenNew(Select.class).withAnyArguments().thenReturn(select);
SelectElement selectElement = (SelectElement) WebElementConverter.convertTo(webElementWrapper, "", SelectElement.class);
assertThat(selectElement.webElement()).isEqualTo(webElementWrapper);
}
Aggregations