Skip to content

Commit

Permalink
changed web driver helper
Browse files Browse the repository at this point in the history
  • Loading branch information
plutasnyy committed Aug 16, 2018
1 parent e6e0101 commit b807121
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,22 @@
*/
public final class WebDriverHelper {

public static final String NAME = "name";

public static final String NAME_LABEL = "Name";

public static final String NAME_DESC = "Driver name that will be used by other services like Screenshot Collectors";

public static final String PATH = "path";

public static final String PATH_LABEL = "Path";

public static final String PATH_DESC = "Custom path to driver binary";

public static final String SELENIUM_GRID_URL_LABEL = "Selenium grid URL";

public static final String DEFAULT_SELENIUM_GRID_URL = "http://localhost:4444/wd/hub";

private WebDriverHelper() {
// restrict instantiation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,25 @@
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;

import static com.cognifide.aet.worker.drivers.WebDriverHelper.DEFAULT_SELENIUM_GRID_URL;
import static com.cognifide.aet.worker.drivers.WebDriverHelper.NAME_LABEL;
import static com.cognifide.aet.worker.drivers.WebDriverHelper.NAME_DESC;
import static com.cognifide.aet.worker.drivers.WebDriverHelper.SELENIUM_GRID_URL_LABEL;

@ObjectClassDefinition(name = "AET Chrome WebDriver Factory", description = "AET Chrome WebDriver Factory")
public @interface ChromeWebDriverFactoryConf {

String DEFAULT_BROWSER_NAME = "chrome";

String SELENIUM_GRID_URL_LABEL = "Selenium grid URL";
String SELENIUM_GRID_URL_DESC = "Url to selenium grid hub. When null local Chrome driver will be used. Local Chrome driver does not work on Linux";
String DEFAULT_SELENIUM_GRID_URL = "http://localhost:4444/wd/hub";

@AttributeDefinition(
name = NAME_LABEL,
description = NAME_DESC,
defaultValue = DEFAULT_BROWSER_NAME)
String name();

@AttributeDefinition(
name = ChromeWebDriverFactoryConf.SELENIUM_GRID_URL_LABEL,
description = ChromeWebDriverFactoryConf.SELENIUM_GRID_URL_DESC,
defaultValue = ChromeWebDriverFactoryConf.DEFAULT_SELENIUM_GRID_URL)
name = SELENIUM_GRID_URL_LABEL,
description = SELENIUM_GRID_URL_LABEL,
defaultValue = DEFAULT_SELENIUM_GRID_URL)
String seleniumGridUrl();
}

0 comments on commit b807121

Please sign in to comment.