Search in sources :

Example 1 with GridNodeConfiguration

use of org.openqa.grid.internal.utils.configuration.GridNodeConfiguration in project zalenium by zalando.

the class TestUtils method getNewBasicRemoteProxy.

public static DockerSeleniumRemoteProxy getNewBasicRemoteProxy(String browser, String url, GridRegistry registry) throws MalformedURLException {
    GridNodeConfiguration config = new GridNodeConfiguration();
    URL u = new URL(url);
    config.host = u.getHost();
    config.port = u.getPort();
    config.role = "webdriver";
    RegistrationRequest req = RegistrationRequest.build(config);
    req.getConfiguration().capabilities.clear();
    DesiredCapabilities capability = new DesiredCapabilities();
    capability.setBrowserName(browser);
    req.getConfiguration().capabilities.add(capability);
    return createProxy(registry, req);
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) GridNodeConfiguration(org.openqa.grid.internal.utils.configuration.GridNodeConfiguration) RegistrationRequest(org.openqa.grid.common.RegistrationRequest) URL(java.net.URL)

Example 2 with GridNodeConfiguration

use of org.openqa.grid.internal.utils.configuration.GridNodeConfiguration in project zalenium by zalando.

the class TestUtils method getRegistrationRequestForTesting.

public static RegistrationRequest getRegistrationRequestForTesting(final int port, String proxyClass) {
    GridNodeConfiguration nodeConfiguration = new GridNodeConfiguration();
    nodeConfiguration.role = "wd";
    nodeConfiguration.hub = "http://localhost:4444";
    nodeConfiguration.host = "localhost";
    nodeConfiguration.port = port;
    nodeConfiguration.proxy = proxyClass;
    nodeConfiguration.registerCycle = 5000;
    nodeConfiguration.cleanUpCycle = 5000;
    nodeConfiguration.maxSession = 5;
    new JCommander(nodeConfiguration);
    return RegistrationRequest.build(nodeConfiguration);
}
Also used : JCommander(com.beust.jcommander.JCommander) GridNodeConfiguration(org.openqa.grid.internal.utils.configuration.GridNodeConfiguration)

Aggregations

GridNodeConfiguration (org.openqa.grid.internal.utils.configuration.GridNodeConfiguration)2 JCommander (com.beust.jcommander.JCommander)1 URL (java.net.URL)1 RegistrationRequest (org.openqa.grid.common.RegistrationRequest)1 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)1