|
40 | 40 |
|
41 | 41 | public enum Browser {
|
42 | 42 | ALL(new ImmutableCapabilities(), "any", false),
|
43 |
| - CHROME(new ChromeOptions(), new ChromeDriverInfo().getDisplayName(), true), |
44 |
| - EDGE(new EdgeOptions(), new EdgeDriverInfo().getDisplayName(), true), |
| 43 | + CHROME(new ChromeOptions(), new ChromeDriverInfo().getDisplayName(), true) { |
| 44 | + @Override |
| 45 | + public Capabilities getCapabilities() { |
| 46 | + String binary = System.getProperty("webdriver.chrome.binary"); |
| 47 | + |
| 48 | + return binary == null ? new ChromeOptions() : new ChromeOptions().setBinary(binary); |
| 49 | + } |
| 50 | + }, |
| 51 | + EDGE(new EdgeOptions(), new EdgeDriverInfo().getDisplayName(), true) { |
| 52 | + @Override |
| 53 | + public Capabilities getCapabilities() { |
| 54 | + String binary = System.getProperty("webdriver.edge.binary"); |
| 55 | + |
| 56 | + return binary == null ? new EdgeOptions() : new EdgeOptions().setBinary(binary); |
| 57 | + } |
| 58 | + }, |
45 | 59 | HTMLUNIT(new ImmutableCapabilities(BROWSER_NAME, BrowserType.HTMLUNIT), "HtmlUnit", false),
|
46 | 60 | LEGACY_FIREFOX_XPI(new FirefoxOptions().setLegacy(true), new XpiDriverInfo().getDisplayName(), false),
|
47 | 61 | IE(new InternetExplorerOptions(), new InternetExplorerDriverInfo().getDisplayName(), false),
|
48 |
| - FIREFOX(new FirefoxOptions(), new GeckoDriverInfo().getDisplayName(), false), |
| 62 | + FIREFOX(new FirefoxOptions(), new GeckoDriverInfo().getDisplayName(), false) { |
| 63 | + @Override |
| 64 | + public Capabilities getCapabilities() { |
| 65 | + String binary = System.getProperty("webdriver.firefox.bin"); |
| 66 | + |
| 67 | + return binary == null ? new FirefoxOptions() : new FirefoxOptions().setBinary(binary); |
| 68 | + } |
| 69 | + }, |
49 | 70 | LEGACY_OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
|
50 | 71 | OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
|
51 | 72 | SAFARI(new SafariOptions(), new SafariDriverInfo().getDisplayName(), false);
|
|
0 commit comments