Search in sources :

Example 1 with TableElement

use of org.definitylabs.flue2ent.element.table.TableElement in project flue2ent by DefinityLabs.

the class WebsiteTest method from_withClass_returnsFunction.

@Test
public void from_withClass_returnsFunction() {
    TableElement tableElement = mock(TableElement.class);
    Website website = mock(Website.class);
    when(website.at(TableElement.class)).thenReturn(tableElement);
    Function<Website, TableElement> from = Website.from(TableElement.class);
    TableElement response = from.apply(website);
    verify(website).at(TableElement.class);
    assertThat(response).isSameAs(tableElement);
}
Also used : TableElement(org.definitylabs.flue2ent.element.table.TableElement) Test(org.junit.Test)

Example 2 with TableElement

use of org.definitylabs.flue2ent.element.table.TableElement in project flue2ent by DefinityLabs.

the class AbstractWebElementProxyTest method findByTagName_results_returnsTableElement.

@Test
public void findByTagName_results_returnsTableElement() {
    when(website.findElement(By.tagName("table"))).thenReturn(new WebElementWrapper(webElement));
    MyPage myPage = newInstance(MyPage.class, website);
    TableElement results = myPage.results();
    assertThat(results.webElement().webElement()).isSameAs(webElement);
}
Also used : TableElement(org.definitylabs.flue2ent.element.table.TableElement) MyPage(org.definitylabs.flue2ent.data.MyPage) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 3 with TableElement

use of org.definitylabs.flue2ent.element.table.TableElement 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);
}
Also used : WebElement(org.openqa.selenium.WebElement) TableElement(org.definitylabs.flue2ent.element.table.TableElement) WebElementWrapper(org.definitylabs.flue2ent.element.WebElementWrapper) Before(org.junit.Before)

Aggregations

TableElement (org.definitylabs.flue2ent.element.table.TableElement)3 Test (org.junit.Test)2 MyPage (org.definitylabs.flue2ent.data.MyPage)1 WebElementWrapper (org.definitylabs.flue2ent.element.WebElementWrapper)1 Before (org.junit.Before)1 WebElement (org.openqa.selenium.WebElement)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1