use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class ActionsPluginTest method beforeEach.
@Before
public void beforeEach() throws Exception {
PowerMockito.mockStatic(SeleniumElementCreator.class, invocationOnMock -> actions);
webElementWrapper = new WebElementWrapper(webElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class MousePluginTest method beforeEach.
@Before
public void beforeEach() {
when(website.actions()).thenReturn(actionsPlugin);
when(actionsPlugin.click(any())).thenReturn(actionsPlugin);
when(actionsPlugin.moveToElement(any())).thenReturn(actionsPlugin);
when(actionsPlugin.doubleClick(any())).thenReturn(actionsPlugin);
when(actionsPlugin.build()).thenReturn(action);
when(actionsPlugin.click()).thenReturn(actionsPlugin);
webElementWrapper = new WebElementWrapper(webElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method selectedItem_returnsFirstSelectedItem.
@Test
public void selectedItem_returnsFirstSelectedItem() {
WebElement optionOne = mock(WebElement.class);
when(optionOne.isSelected()).thenReturn(true);
WebElement optionTwo = mock(WebElement.class);
when(optionTwo.isSelected()).thenReturn(true);
when(webElement.findElements(By.tagName("option"))).thenReturn(Arrays.asList(optionOne, optionTwo));
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectOptionElement optionElement = selectElement.selectedItem();
assertThat(optionElement.webElement().webElement()).isSameAs(optionOne);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method selectByVisibleText_callsSelectByVisibleText.
@Test
public void selectByVisibleText_callsSelectByVisibleText() {
String text = "text";
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectElement result = selectElement.selectByVisibleText(text);
verify(select).selectByVisibleText(text);
assertThat(result).isSameAs(selectElement);
}
use of org.definitylabs.flue2ent.element.WebElementWrapper in project flue2ent by DefinityLabs.
the class SelectElementTest method deselectByValue_callsDeselectByValue.
@Test
public void deselectByValue_callsDeselectByValue() {
String value = "value";
SelectElement selectElement = new SelectElement(new WebElementWrapper(webElement));
SelectElement result = selectElement.deselectByValue(value);
verify(select).deselectByValue(value);
assertThat(result).isSameAs(selectElement);
}
Aggregations