|
1 | 1 | package com.nordstrom.automation.selenium.plugins;
|
2 | 2 |
|
| 3 | +import java.util.Collections; |
| 4 | +import java.util.HashMap; |
3 | 5 | import java.util.Map;
|
4 | 6 |
|
5 | 7 | import com.nordstrom.automation.selenium.SeleniumConfig;
|
6 | 8 |
|
7 |
| -public class OperaPlugin extends RemoteWebDriverPlugin { |
| 9 | +public class OperaPlugin extends AbstractAppiumPlugin { |
| 10 | + |
| 11 | + public static final String DRIVER_NAME = "Opera"; |
8 | 12 |
|
9 | 13 | public OperaPlugin() {
|
10 |
| - super(OperaCaps.DRIVER_NAME); |
| 14 | + super(DRIVER_NAME); |
11 | 15 | }
|
12 | 16 |
|
13 |
| - /** |
14 |
| - * <b>org.openqa.selenium.opera.OperaDriver</b> |
15 |
| - * |
16 |
| - * <pre><dependency> |
17 |
| - * <groupId>org.seleniumhq.selenium</groupId> |
18 |
| - * <artifactId>selenium-opera-driver</artifactId> |
19 |
| - * <version>3.141.59</version> |
20 |
| - *</dependency></pre> |
| 17 | + /* |
| 18 | + * Capability Default Description |
| 19 | + * appium:chromedriverPort 9515 The port to start WebDriver process on |
| 20 | + * appium:executable The absolute path to a WebDriver binary executable. If set, the driver will use that path instead of its own WebDriver |
| 21 | + * appium:executableDir A directory within which is found any number of WebDriver binaries. If set, the driver will search this directory for |
| 22 | + * WebDrivers of the appropriate version to use for your browser |
| 23 | + * appium:verbose false Set to true to add the --verbose flag when starting WebDriver |
| 24 | + * appium:logPath The path to use with the --log-path parameter directing WebDriver to write its log to that path, if set |
| 25 | + * appium:disableBuildCheck false Set to true to add the --disable-build-check flag when starting WebDriver |
| 26 | + * appium:autodownloadEnabled true Set to false to disable automatic downloading of Chromedrivers. |
| 27 | + * appium:useSystemExecutable false Set to true to use the version of WebDriver bundled with this driver, rather than attempting to download a new one based |
| 28 | + * on the version of the browser under test |
21 | 29 | */
|
22 |
| - private static final String[] DEPENDENCY_CONTEXTS = { |
23 |
| - "org.openqa.selenium.opera.OperaDriver", |
24 |
| - "net.bytebuddy.matcher.ElementMatcher" |
25 |
| - }; |
| 30 | + |
| 31 | + private static final String CAPABILITIES = |
| 32 | + "{\"appium:automationName\":\"Opera\",\"platformName\":\"Windows\",\"browserName\":\"opera\"}"; |
26 | 33 |
|
27 |
| - /** |
28 |
| - * {@inheritDoc} |
29 |
| - */ |
30 |
| - @Override |
31 |
| - public String[] getDependencyContexts() { |
32 |
| - return DEPENDENCY_CONTEXTS; |
| 34 | + private static final String BASELINE = |
| 35 | + "{\"appium:automationName\":\"Opera\",\"platformName\":\"Windows\",\"browserName\":\"opera\"," + |
| 36 | + "\"nord:options\":{\"personality\":\"opera\"," + |
| 37 | + "\"pluginClass\":\"com.nordstrom.automation.selenium.plugins.OperaPlugin\"}}"; |
| 38 | + |
| 39 | + private static final Map<String, String> PERSONALITIES; |
| 40 | + |
| 41 | + private static final String DRIVER_CLASS_NAME = "io.appium.java_client.AppiumDriver"; |
| 42 | + |
| 43 | + static { |
| 44 | + Map<String, String> personalities = new HashMap<>(); |
| 45 | + personalities.put(DRIVER_NAME, BASELINE); |
| 46 | + PERSONALITIES = Collections.unmodifiableMap(personalities); |
33 | 47 | }
|
34 |
| - |
35 |
| - /** |
36 |
| - * {@inheritDoc} |
37 |
| - */ |
| 48 | + |
38 | 49 | @Override
|
39 | 50 | public String getCapabilities(SeleniumConfig config) {
|
40 |
| - return OperaCaps.getCapabilities(); |
| 51 | + return addNordOptions(config, CAPABILITIES); |
41 | 52 | }
|
42 | 53 |
|
43 |
| - /** |
44 |
| - * {@inheritDoc} |
45 |
| - */ |
46 | 54 | @Override
|
47 | 55 | public Map<String, String> getPersonalities() {
|
48 |
| - return OperaCaps.getPersonalities(); |
| 56 | + return PERSONALITIES; |
49 | 57 | }
|
50 |
| - |
51 |
| - /** |
52 |
| - * {@inheritDoc} |
53 |
| - */ |
| 58 | + |
54 | 59 | @Override
|
55 |
| - public String[] getPropertyNames(String capabilities) { |
56 |
| - return OperaCaps.getPropertyNames(capabilities); |
| 60 | + public String getDriverClassName() { |
| 61 | + return DRIVER_CLASS_NAME; |
57 | 62 | }
|
58 | 63 |
|
59 | 64 | }
|
0 commit comments