use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class ActionsPluginTest method dragAndDrop_callsDragAndDrop.
@Test
public void dragAndDrop_callsDragAndDrop() throws Exception {
WebElement toWebElement = mock(WebElement.class);
WebElementWrapper toWebElementWrapper = new WebElementWrapper(toWebElement);
ActionsPlugin actionsPlugin = new ActionsPlugin(driver);
actionsPlugin.dragAndDrop(webElementWrapper, toWebElementWrapper);
verify(actions).dragAndDrop(webElement, toWebElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class ScrollPluginTest method to_element_executesJavascript.
@Test
public void to_element_executesJavascript() {
RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
ScrollPlugin scrollPlugin = new ScrollPlugin(mockedDriver);
WebElement webElement = mock(WebElement.class);
WebElementWrapper element = new WebElementWrapper(webElement);
ScrollPlugin result = scrollPlugin.to(element);
verify(mockedDriver).executeScript("arguments[0].scrollIntoView(true);", webElement);
assertThat(result).isSameAs(scrollPlugin);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method selectedItems_returnsSelectedItemsList.
@Test
public void selectedItems_returnsSelectedItemsList() {
WebElement optionOne = mock(WebElement.class);
when(optionOne.isSelected()).thenReturn(true);
WebElement optionTwo = mock(WebElement.class);
when(optionTwo.isSelected()).thenReturn(true);
WebElement optionThree = mock(WebElement.class);
when(optionThree.isSelected()).thenReturn(false);
when(webElement.findElements(By.tagName("option"))).thenReturn(Arrays.asList(optionOne, optionTwo, optionThree));
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
List<SelectOptionElement> optionElements = selectElement.selectedItems();
Assertions.assertThat(optionElements).hasSize(2);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method deselectByIndex_callsDeselectByIndex.
@Test
public void deselectByIndex_callsDeselectByIndex() {
int index = 1;
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectElement result = selectElement.deselectByIndex(index);
verify(select).deselectByIndex(index);
assertThat(result).isSameAs(selectElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method deselectAll_callsDeselectAll.
@Test
public void deselectAll_callsDeselectAll() {
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectElement result = selectElement.deselectAll();
verify(select).deselectAll();
assertThat(result).isSameAs(selectElement);
}
Aggregations