Java 类org.openqa.selenium.edge.EdgeOptions 实例源码

项目:givemeadriver    文件:EdgeCapabilitiesConverterTest.java   
@Test
public void settingBrowserSize() {
    // given
    WebDriverProperties properties = new WebDriverProperties();
    properties.setProperty("browserSize", "1690x1000");

    // when
    Capabilities convertedCapabilities = edgeCapabilitiesConverter.convert(properties);

    // then
    // expected safari options
    EdgeOptions expectedEdgeOptions = new EdgeOptions();
    expectedEdgeOptions.setCapability(CAPABILITY_AUTOCLOSE, false);
    expectedEdgeOptions.setCapability(CAPABILITY_BROWSER_SIZE, "1690x1000");

    assertThat(convertedCapabilities.asMap()).isEqualTo(expectedEdgeOptions.asMap());

}
项目:selenium-jupiter    文件:EdgeDriverHandler.java   
@Override
public void resolve() {
    try {
        Optional<Object> testInstance = context.getTestInstance();
        Optional<Capabilities> capabilities = annotationsReader
                .getCapabilities(parameter, testInstance);
        EdgeOptions edgeOptions = (EdgeOptions) getOptions(parameter,
                testInstance);
        if (capabilities.isPresent()) {
            edgeOptions.merge(capabilities.get());
        }
        object = new EdgeDriver(edgeOptions);
    } catch (Exception e) {
        handleException(e);
    }
}
项目:webdriver-supplier    文件:CoreTests.java   
@Test
public void shouldRetrieveBrowserWithOptions() {
    final Map<String, String> edgeParameters = new HashMap<>();
    edgeParameters.put(BROWSER_NAME, "edge");

    final XmlConfig config = new XmlConfig(edgeParameters);
    final Browser edge = StreamEx.of(browsers)
                                   .findFirst(b -> b.name() == Browser.Name.Edge)
                                   .orElseThrow(() -> new AssertionError("Unable to retrieve Edge"));

    assertThat(edge.configuration(config)).isEqualTo(edge.merge(config, new EdgeOptions()));
}
项目:givemeadriver    文件:EdgeCapabilitiesConverter.java   
@Override
public Capabilities convert(WebDriverProperties properties) {
    EdgeOptions edgeOptions = new EdgeOptions();

    // general options for logging purpose
    edgeOptions.setCapability(CAPABILITY_AUTOCLOSE, properties.isAutoClose());
    addToEdgeOptionsIfNoEmptyValue(edgeOptions, CAPABILITY_DRIVER_VERSION, properties.getDriverVersion());
    addToEdgeOptionsIfNoEmptyValue(edgeOptions, CAPABILITY_BROWSER_SIZE, properties.getBrowserSize());

    return edgeOptions;
}
项目:selenium-jupiter    文件:EdgeAnnotationReaderTest.java   
@ParameterizedTest
@MethodSource("testClassProvider")
void testEdgeOptions(Class<?> testClass) throws Exception {
    Parameter parameter = testClass.getMethod("edgeTest", EdgeDriver.class)
            .getParameters()[0];
    Optional<Object> testInstance = Optional.of(testClass.newInstance());
    EdgeOptions edgeOptions = (EdgeOptions) annotationsReader
            .getOptions(parameter, testInstance);
    assertThat(edgeOptions.getCapability("pageLoadStrategy"),
            equalTo("eager"));
}
项目:webdriver-supplier    文件:Edge.java   
@Override
public Capabilities configuration(final XmlConfig context) {
    return merge(context, new EdgeOptions());
}
项目:selenium-components    文件:EdgeWebDriverFactory.java   
protected EdgeOptions createOptions()
{
    return new EdgeOptions();
}
项目:givemeadriver    文件:EdgeCapabilitiesConverter.java   
private void addToEdgeOptionsIfNoEmptyValue(EdgeOptions edgeOptions, String key, String value) {
    if (isNotEmpty(value)) {
        edgeOptions.setCapability(key, value);
    }
}
项目:givemeadriver    文件:EdgeDriverFactory.java   
@Override
public WebDriver createDriver(Capabilities capabilities) {
    String driverVersion = (String) capabilities.getCapability(CAPABILITY_DRIVER_VERSION);
    EdgeDriverManager.getInstance().version(driverVersion).setup();
    return new EdgeDriver((EdgeOptions) capabilities);
}
项目:easyium-java    文件:EdgeDriver.java   
/**
 * Creates a new EdgeDriver instance with the specified options.
 *
 * @param options The options to use.
 * @see #EdgeDriver(EdgeDriverService, EdgeOptions)
 */
public EdgeDriver(EdgeOptions options) {
    super(new org.openqa.selenium.edge.EdgeDriver(options));
}
项目:easyium-java    文件:EdgeDriver.java   
/**
 * Creates a new EdgeDriver instance with the specified options. The {@code service} will be
 * started along with the driver, and shutdown upon calling {@link #quit()}.
 *
 * @param service The service to use.
 * @param options The options to use.
 */
public EdgeDriver(EdgeDriverService service, EdgeOptions options) {
    super(new org.openqa.selenium.edge.EdgeDriver(service, options));
}