use of org.openqa.selenium.HasCapabilities in project FluentLenium by FluentLenium.
the class FluentDriverWrappedCapabilitiesProviderTest method shouldReturnInnerMostWrappedDriverCapabilities.
@Test
public void shouldReturnInnerMostWrappedDriverCapabilities() {
when(((WrapsDriver) webDriverNotHaveCapabilities).getWrappedDriver()).thenReturn(webDriverHasCapabilities);
when(((HasCapabilities) webDriverHasCapabilities).getCapabilities()).thenReturn(wrappedCapabilities);
Capabilities capabilities = capabilitiesProvider.getCapabilities(webDriverNotHaveCapabilities);
assertThat(capabilities).isSameAs(wrappedCapabilities);
}
use of org.openqa.selenium.HasCapabilities in project vividus by vividus-framework.
the class DelegatingWebDriverTests method testGetCapabilities.
@Test
void testGetCapabilities() {
WebDriver driverWithCapabilities = Mockito.mock(WebDriver.class, withSettings().extraInterfaces(HasCapabilities.class));
Capabilities capabilities = Mockito.mock(Capabilities.class);
when(((HasCapabilities) driverWithCapabilities).getCapabilities()).thenReturn(capabilities);
assertEquals(capabilities, new DelegatingWebDriver(driverWithCapabilities).getCapabilities());
}
use of org.openqa.selenium.HasCapabilities in project vividus by vividus-framework.
the class ApplicationActionsTests method mockCapabilities.
private HasCapabilities mockCapabilities() {
HasCapabilities hasCapabilities = mock(HasCapabilities.class);
when(hasCapabilities.getCapabilities()).thenReturn(new MutableCapabilities(Map.of(APP, APP_NAME)));
when(webDriverProvider.getUnwrapped(HasCapabilities.class)).thenReturn(hasCapabilities);
return hasCapabilities;
}
use of org.openqa.selenium.HasCapabilities in project vividus by vividus-framework.
the class ApplicationActions method reinstallApplication.
/**
* Reinstall the application.
* @param bundleId bundle identifier of the application to reinstall.
*/
public void reinstallApplication(String bundleId) {
InteractsWithApps interactor = webDriverProvider.getUnwrapped(InteractsWithApps.class);
HasCapabilities hasCapabilities = webDriverProvider.getUnwrapped(HasCapabilities.class);
String appPath = hasCapabilities.getCapabilities().getCapability("app").toString();
Validate.isTrue(interactor.removeApp(bundleId), "Unable to remove mobile application with the bundle identifier '%s'", bundleId);
interactor.installApp(appPath);
}
use of org.openqa.selenium.HasCapabilities in project vividus by vividus-framework.
the class ApplicationSteps method startMobileApplication.
/**
* Starts mobile application
*/
@Given("I start mobile application")
public void startMobileApplication() {
HasCapabilities driverWithCapabilities = webDriverProvider.getUnwrapped(HasCapabilities.class);
LOGGER.atInfo().addArgument(() -> CapabilityHelpers.getCapability(driverWithCapabilities.getCapabilities(), "app", String.class)).log("Started application located at {}");
}
Aggregations