Java Code Examples for org.openqa.selenium.safari.SafariOptions#merge()

The following examples show how to use org.openqa.selenium.safari.SafariOptions#merge() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SafariDriverHandler.java    From selenium-jupiter with Apache License 2.0 6 votes vote down vote up
@Override
public void resolve() {
    try {
        Optional<Object> testInstance = context.getTestInstance();
        Optional<Capabilities> capabilities = annotationsReader
                .getCapabilities(parameter, testInstance);
        SafariOptions safariOptions = (SafariOptions) getOptions(parameter,
                testInstance);
        if (capabilities.isPresent()) {
            safariOptions.merge(capabilities.get());
        }
        object = new SafariDriver(safariOptions);
    } catch (Exception e) {
        handleException(e);
    }
}
 
Example 2
Source File: SetProxyForWebDriver.java    From neodymium-library with MIT License 5 votes vote down vote up
@Test
public void testSafari()
{
    DesiredCapabilities capabilities = createCapabilitiesWithProxy();
    SafariOptions options = new SafariOptions();
    options.merge(capabilities);

    Assert.assertTrue(options.getCapability(CapabilityType.PROXY) != null);
}
 
Example 3
Source File: CustomDriverProvider.java    From akita with Apache License 2.0 5 votes vote down vote up
/**
 * Задает options для запуска Safari драйвера
 * options можно передавать, как системную переменную, например -Doptions=--load-extension=my-custom-extension
 *
 * @return SafariOptions
 */
private SafariOptions getSafariDriverOptions(DesiredCapabilities capabilities) {
    log.info("---------------Safari Driver---------------------");
    SafariOptions safariOptions = new SafariOptions();
    safariOptions.setCapability(CapabilityType.BROWSER_VERSION, loadSystemPropertyOrDefault(CapabilityType.BROWSER_VERSION, VERSION_LATEST));
    safariOptions.merge(capabilities);
    return safariOptions;
}