@ohos-ports/webdriver-manager 0.0.0-stage → 12.1.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.circleci/config.yml +24 -0
  2. package/CHANGELOG.md +670 -0
  3. package/CONTRIBUTING.md +61 -0
  4. package/LICENSE +21 -0
  5. package/README.md +75 -2
  6. package/bin/webdriver-manager +56 -0
  7. package/built/config.json +18 -0
  8. package/built/lib/binaries/android_sdk.d.ts +26 -0
  9. package/built/lib/binaries/android_sdk.js +103 -0
  10. package/built/lib/binaries/android_sdk.js.map +1 -0
  11. package/built/lib/binaries/appium.d.ts +18 -0
  12. package/built/lib/binaries/appium.js +42 -0
  13. package/built/lib/binaries/appium.js.map +1 -0
  14. package/built/lib/binaries/binary.d.ts +66 -0
  15. package/built/lib/binaries/binary.js +76 -0
  16. package/built/lib/binaries/binary.js.map +1 -0
  17. package/built/lib/binaries/chrome_driver.d.ts +12 -0
  18. package/built/lib/binaries/chrome_driver.js +38 -0
  19. package/built/lib/binaries/chrome_driver.js.map +1 -0
  20. package/built/lib/binaries/chrome_xml.d.ts +36 -0
  21. package/built/lib/binaries/chrome_xml.js +156 -0
  22. package/built/lib/binaries/chrome_xml.js.map +1 -0
  23. package/built/lib/binaries/config_source.d.ts +38 -0
  24. package/built/lib/binaries/config_source.js +209 -0
  25. package/built/lib/binaries/config_source.js.map +1 -0
  26. package/built/lib/binaries/gecko_driver.d.ts +13 -0
  27. package/built/lib/binaries/gecko_driver.js +50 -0
  28. package/built/lib/binaries/gecko_driver.js.map +1 -0
  29. package/built/lib/binaries/gecko_driver_github.d.ts +14 -0
  30. package/built/lib/binaries/gecko_driver_github.js +93 -0
  31. package/built/lib/binaries/gecko_driver_github.js.map +1 -0
  32. package/built/lib/binaries/iedriver.d.ts +13 -0
  33. package/built/lib/binaries/iedriver.js +38 -0
  34. package/built/lib/binaries/iedriver.js.map +1 -0
  35. package/built/lib/binaries/iedriver_xml.d.ts +9 -0
  36. package/built/lib/binaries/iedriver_xml.js +69 -0
  37. package/built/lib/binaries/iedriver_xml.js.map +1 -0
  38. package/built/lib/binaries/index.d.ts +7 -0
  39. package/built/lib/binaries/index.js +13 -0
  40. package/built/lib/binaries/index.js.map +1 -0
  41. package/built/lib/binaries/standalone.d.ts +13 -0
  42. package/built/lib/binaries/standalone.js +41 -0
  43. package/built/lib/binaries/standalone.js.map +1 -0
  44. package/built/lib/binaries/standalone_xml.d.ts +9 -0
  45. package/built/lib/binaries/standalone_xml.js +89 -0
  46. package/built/lib/binaries/standalone_xml.js.map +1 -0
  47. package/built/lib/cli/cli.d.ts +57 -0
  48. package/built/lib/cli/cli.js +136 -0
  49. package/built/lib/cli/cli.js.map +1 -0
  50. package/built/lib/cli/index.d.ts +4 -0
  51. package/built/lib/cli/index.js +10 -0
  52. package/built/lib/cli/index.js.map +1 -0
  53. package/built/lib/cli/logger.d.ts +95 -0
  54. package/built/lib/cli/logger.js +264 -0
  55. package/built/lib/cli/logger.js.map +1 -0
  56. package/built/lib/cli/options.d.ts +22 -0
  57. package/built/lib/cli/options.js +67 -0
  58. package/built/lib/cli/options.js.map +1 -0
  59. package/built/lib/cli/programs.d.ts +93 -0
  60. package/built/lib/cli/programs.js +226 -0
  61. package/built/lib/cli/programs.js.map +1 -0
  62. package/built/lib/cli_instance.d.ts +2 -0
  63. package/built/lib/cli_instance.js +18 -0
  64. package/built/lib/cli_instance.js.map +1 -0
  65. package/built/lib/cmds/clean.d.ts +2 -0
  66. package/built/lib/cmds/clean.js +39 -0
  67. package/built/lib/cmds/clean.js.map +1 -0
  68. package/built/lib/cmds/index.d.ts +1 -0
  69. package/built/lib/cmds/index.js +7 -0
  70. package/built/lib/cmds/index.js.map +1 -0
  71. package/built/lib/cmds/initialize.d.ts +3 -0
  72. package/built/lib/cmds/initialize.js +244 -0
  73. package/built/lib/cmds/initialize.js.map +1 -0
  74. package/built/lib/cmds/opts.d.ts +38 -0
  75. package/built/lib/cmds/opts.js +91 -0
  76. package/built/lib/cmds/opts.js.map +1 -0
  77. package/built/lib/cmds/shutdown.d.ts +2 -0
  78. package/built/lib/cmds/shutdown.js +46 -0
  79. package/built/lib/cmds/shutdown.js.map +1 -0
  80. package/built/lib/cmds/start.d.ts +2 -0
  81. package/built/lib/cmds/start.js +458 -0
  82. package/built/lib/cmds/start.js.map +1 -0
  83. package/built/lib/cmds/status.d.ts +2 -0
  84. package/built/lib/cmds/status.js +120 -0
  85. package/built/lib/cmds/status.js.map +1 -0
  86. package/built/lib/cmds/update.d.ts +3 -0
  87. package/built/lib/cmds/update.js +300 -0
  88. package/built/lib/cmds/update.js.map +1 -0
  89. package/built/lib/cmds/version.d.ts +2 -0
  90. package/built/lib/cmds/version.js +17 -0
  91. package/built/lib/cmds/version.js.map +1 -0
  92. package/built/lib/config.d.ts +58 -0
  93. package/built/lib/config.js +97 -0
  94. package/built/lib/config.js.map +1 -0
  95. package/built/lib/files/downloaded_binary.d.ts +14 -0
  96. package/built/lib/files/downloaded_binary.js +32 -0
  97. package/built/lib/files/downloaded_binary.js.map +1 -0
  98. package/built/lib/files/downloader.d.ts +20 -0
  99. package/built/lib/files/downloader.js +103 -0
  100. package/built/lib/files/downloader.js.map +1 -0
  101. package/built/lib/files/file_manager.d.ts +72 -0
  102. package/built/lib/files/file_manager.js +239 -0
  103. package/built/lib/files/file_manager.js.map +1 -0
  104. package/built/lib/files/index.d.ts +3 -0
  105. package/built/lib/files/index.js +9 -0
  106. package/built/lib/files/index.js.map +1 -0
  107. package/built/lib/http_utils.d.ts +27 -0
  108. package/built/lib/http_utils.js +118 -0
  109. package/built/lib/http_utils.js.map +1 -0
  110. package/built/lib/utils.d.ts +6 -0
  111. package/built/lib/utils.js +115 -0
  112. package/built/lib/utils.js.map +1 -0
  113. package/built/lib/webdriver.d.ts +0 -0
  114. package/built/lib/webdriver.js +22 -0
  115. package/built/lib/webdriver.js.map +1 -0
  116. package/built/package.json +85 -0
  117. package/config.json +18 -0
  118. package/docs/README.md +6 -0
  119. package/docs/mobile.md +79 -0
  120. package/docs/protractor.md +41 -0
  121. package/docs/versions.md +87 -0
  122. package/gulpfile.js +44 -0
  123. package/package.json +83 -4
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const child_process = require("child_process");
4
+ const fs = require("fs");
5
+ const http = require("http");
6
+ const path = require("path");
7
+ const config_1 = require("./config");
8
+ function spawnFactory(sync) {
9
+ return (cmd, args, stdio, opts) => {
10
+ if ((config_1.Config.osType() === 'Windows_NT') && (cmd.slice(-4) !== '.exe')) {
11
+ if (fs.existsSync(cmd + '.exe')) {
12
+ cmd += '.exe';
13
+ }
14
+ else {
15
+ args = ['/c'].concat([cmd], args);
16
+ cmd = 'cmd';
17
+ }
18
+ }
19
+ if (stdio) {
20
+ opts = opts || {};
21
+ opts.stdio = stdio;
22
+ }
23
+ if (sync) {
24
+ return child_process.spawnSync(cmd, args, opts);
25
+ }
26
+ else {
27
+ return child_process.spawn(cmd, args, opts);
28
+ }
29
+ };
30
+ }
31
+ exports.spawn = spawnFactory(false);
32
+ exports.spawnSync = spawnFactory(true);
33
+ function request(method, port, path, timeout, data) {
34
+ let headers = {};
35
+ let hasContent = data && ((method == 'POST') || (method == 'PUT'));
36
+ if (hasContent) {
37
+ data = data ? JSON.stringify(data) : '';
38
+ headers['Content-Length'] = data.length;
39
+ headers['Content-Type'] = 'application/json;charset=UTF-8';
40
+ }
41
+ return new Promise((resolve, reject) => {
42
+ let unexpectedEnd = () => {
43
+ reject({ code: 'UNKNOWN', message: 'Request ended unexpectedly' });
44
+ };
45
+ let req = http.request({ port: parseInt(port), method: method, path: path, headers: headers }, (res) => {
46
+ req.removeListener('end', unexpectedEnd);
47
+ if (res.statusCode !== 200) {
48
+ reject({ code: res.statusCode, message: res.statusMessage });
49
+ }
50
+ else {
51
+ let buffer = [];
52
+ res.on('data', buffer.push.bind(buffer));
53
+ res.on('end', () => {
54
+ resolve(buffer.join('').replace(/\0/g, ''));
55
+ });
56
+ }
57
+ });
58
+ if (timeout) {
59
+ req.setTimeout(timeout, () => {
60
+ reject({ code: 'TIMEOUT', message: 'Request timed out' });
61
+ });
62
+ }
63
+ req.on('error', reject);
64
+ req.on('end', unexpectedEnd);
65
+ if (hasContent) {
66
+ req.write(data);
67
+ }
68
+ req.end();
69
+ });
70
+ }
71
+ exports.request = request;
72
+ function adb(sdkPath, port, command, timeout, args) {
73
+ return new Promise((resolve, reject) => {
74
+ let child = exports.spawn(path.resolve(sdkPath, 'platform-tools', 'adb'), ['-s', 'emulator-' + port, command].concat(args || []), 'pipe');
75
+ let done = false;
76
+ let buffer = [];
77
+ child.stdout.on('data', buffer.push.bind(buffer));
78
+ child.on('error', (err) => {
79
+ if (!done) {
80
+ done = true;
81
+ reject(err);
82
+ }
83
+ });
84
+ child.on('exit', (code, signal) => {
85
+ if (!done) {
86
+ done = true;
87
+ if (code === 0) {
88
+ resolve(buffer.join(''));
89
+ }
90
+ else {
91
+ reject({
92
+ code: code,
93
+ message: 'abd command "' + command + '" ' +
94
+ (signal ? 'received signal ' + signal : 'returned with a non-zero exit code') +
95
+ 'for emulator-' + port
96
+ });
97
+ }
98
+ }
99
+ });
100
+ if (timeout) {
101
+ setTimeout(() => {
102
+ if (!done) {
103
+ done = true;
104
+ child.kill();
105
+ reject({
106
+ code: 'TIMEOUT',
107
+ message: 'adb command "' + command + '" timed out for emulator-' + port
108
+ });
109
+ }
110
+ }, timeout);
111
+ }
112
+ });
113
+ }
114
+ exports.adb = adb;
115
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":";;AAAA,+CAA+C;AAC/C,yBAAyB;AACzB,6BAA6B;AAC7B,6BAA6B;AAE7B,qCAAgC;AAQhC,sBAAsB,IAAa;IAIjC,MAAM,CAAC,CAAC,GAAW,EAAE,IAAc,EAAE,KAAc,EAC3C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,IAAI,GAAG,IAAI,CAAC;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,MAAc;YAC5C,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACV,IAAI,GAAG,IAAI,CAAC;gBACZ,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;oBACf,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC3B,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACN,MAAM,CAAC;wBACL,IAAI,EAAE,IAAI;wBACV,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,IAAI;4BACrC,CAAC,MAAM,GAAG,kBAAkB,GAAG,MAAM,GAAG,oCAAoC,CAAC;4BAC7E,eAAe,GAAG,IAAI;qBAC3B,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACZ,UAAU,CAAC;gBACT,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBACV,IAAI,GAAG,IAAI,CAAC;oBACZ,KAAK,CAAC,IAAI,EAAE,CAAC;oBACb,MAAM,CAAC;wBACL,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,2BAA2B,GAAG,IAAI;qBACxE,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,EAAE,OAAO,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA5CD,kBA4CC"}
File without changes
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const minimist = require("minimist");
4
+ const cli_instance_1 = require("./cli_instance");
5
+ let minimistOptions = cli_instance_1.cli.getMinimistOptions();
6
+ let argv = minimist(process.argv.slice(2), minimistOptions);
7
+ let cmd = argv._;
8
+ if (cli_instance_1.cli.programs[cmd[0]]) {
9
+ if (cmd[0] === 'help') {
10
+ cli_instance_1.cli.printHelp();
11
+ }
12
+ else if (cmd[1] === 'help' || argv['help'] || argv['h']) {
13
+ cli_instance_1.cli.programs[cmd[0]].printHelp();
14
+ }
15
+ else {
16
+ cli_instance_1.cli.programs[cmd[0]].run(JSON.parse(JSON.stringify(argv)));
17
+ }
18
+ }
19
+ else {
20
+ cli_instance_1.cli.printHelp();
21
+ }
22
+ //# sourceMappingURL=webdriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webdriver.js","sourceRoot":"","sources":["../../lib/webdriver.ts"],"names":[],"mappings":";;AAAA,qCAAqC;AAErC,iDAAkD;AAElD,IAAI,eAAe,GAAG,kBAAW,CAAC,kBAAkB,EAAE,CAAC;AACvD,IAAI,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;AAC5D,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;AACjB,EAAE,CAAC,CAAC,kBAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;QACtB,kBAAW,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1D,kBAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3C,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,kBAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAAC,IAAI,CAAC,CAAC;IACN,kBAAW,CAAC,SAAS,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@ohos-ports/webdriver-manager",
3
+ "version": "12.1.9-beta.0",
4
+ "description": "A selenium server and browser driver manager for your end to end tests.",
5
+ "scripts": {
6
+ "format": "gulp format",
7
+ "format-enforce": "gulp format:enforce",
8
+ "gulp": "gulp",
9
+ "jasmine": "jasmine",
10
+ "prepublish": "npm run format-enforce && tsc && gulp copy",
11
+ "tsc": "tsc",
12
+ "pretest": "tsc && gulp copy",
13
+ "test": "npm run test-unit && npm run test-e2e",
14
+ "test-unit": "jasmine",
15
+ "pretest-e2e:update": "node ./bin/webdriver-manager update",
16
+ "pretest-e2e:start": "node ./bin/webdriver-manager start --detach --seleniumPort 4444 --quiet",
17
+ "pretest-e2e": "npm run pretest && npm run pretest-e2e:update && npm run pretest-e2e:start",
18
+ "test-e2e": "jasmine JASMINE_CONFIG_PATH=e2e_spec/support/headless.json",
19
+ "posttest-e2e": "node ./bin/webdriver-manager shutdown"
20
+ },
21
+ "keywords": [
22
+ "angular",
23
+ "test",
24
+ "testing",
25
+ "protractor",
26
+ "webdriver",
27
+ "webdriverjs",
28
+ "selenium",
29
+ "selenium-webdriver"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/ohos-ports/ohos-ports.git",
34
+ "directory": "ports/webdriver-manager/12.1.9"
35
+ },
36
+ "bin": {
37
+ "webdriver-manager": "bin/webdriver-manager"
38
+ },
39
+ "main": "built/lib/webdriver.js",
40
+ "author": "Craig Nishina <craig.nishina@gmail.com>",
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "@ohos-ports/request": "^2.88.2-beta.0",
44
+ "adm-zip": "^0.5.2",
45
+ "chalk": "^1.1.1",
46
+ "del": "^2.2.0",
47
+ "glob": "^7.0.3",
48
+ "ini": "^1.3.4",
49
+ "minimist": "^1.2.0",
50
+ "q": "^1.4.1",
51
+ "rimraf": "^2.5.2",
52
+ "semver": "^5.3.0",
53
+ "xml2js": "^0.4.17"
54
+ },
55
+ "devDependencies": {
56
+ "@types/adm-zip": "^0.5.0",
57
+ "@types/chalk": "^0.4.28",
58
+ "@types/form-data": "^0.0.33",
59
+ "@types/glob": "^5.0.29",
60
+ "@types/ini": "^1.3.28",
61
+ "@types/jasmine": "^2.5.43",
62
+ "@types/minimatch": "^2.0.28",
63
+ "@types/minimist": "^1.1.28",
64
+ "@types/node": "^7.0.4",
65
+ "@types/q": "^0.0.32",
66
+ "@types/request": "^0.0.39",
67
+ "@types/rimraf": "^0.0.28",
68
+ "@types/selenium-webdriver": "^2.53.35",
69
+ "@types/semver": "^5.3.30",
70
+ "@types/xml2js": "0.0.32",
71
+ "clang-format": "^1.0.35",
72
+ "gulp": "^4.0.0",
73
+ "gulp-clang-format": "^1.0.23",
74
+ "jasmine": "^2.4.1",
75
+ "run-sequence": "^1.1.5",
76
+ "selenium-webdriver": "~3.0.1",
77
+ "typescript": "~2.3.0"
78
+ },
79
+ "engines": {
80
+ "node": ">=6.9.x"
81
+ },
82
+ "bugs": {
83
+ "url": "https://github.com/ohos-ports/ohos-ports/issues"
84
+ }
85
+ }
package/config.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "webdriverVersions": {
3
+ "selenium": "2.53.1",
4
+ "chromedriver": "2.27",
5
+ "maxChromedriver": "77",
6
+ "geckodriver": "v0.13.0",
7
+ "iedriver": "2.53.1",
8
+ "androidsdk": "24.4.1",
9
+ "appium": "1.6.5"
10
+ },
11
+ "cdnUrls": {
12
+ "selenium": "https://selenium-release.storage.googleapis.com/",
13
+ "chromedriver": "https://chromedriver.storage.googleapis.com/",
14
+ "geckodriver": "https://github.com/mozilla/geckodriver/releases/download/",
15
+ "iedriver": "https://selenium-release.storage.googleapis.com/",
16
+ "androidsdk": "http://dl.google.com/android/"
17
+ }
18
+ }
package/docs/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # Contents
2
+
3
+ - [main page](../README.md)
4
+ - [mobile browser support](mobile.md)
5
+ - [protractor support](protractor.md)
6
+ - [set specific versions](versions.md)
package/docs/mobile.md ADDED
@@ -0,0 +1,79 @@
1
+ Mobile Browser Support
2
+ ======================
3
+
4
+ Support for mobile browsers is provided via [appium](https://github.com/appium/appium). If you
5
+ have used `webdriver-manager update --android` or `webdriver-manager update --ios`, when you run
6
+ `webdriver-manager start`, Appium will automatically start on the port specified by `--appium-port`.
7
+
8
+
9
+ Android SDK
10
+ -----------
11
+
12
+ `webdriver-manager` will not install the android SDK by default. If you want to test on android,
13
+ run `webdriver-manager update --android`. This will download the android SDK, Appium, and set up
14
+ some virtual android devices for you to run tests against. By default, this will create only an
15
+ android device running version 24 on x86-64. If you need a different device, you must use the
16
+ `--android-api-levels` and `--android-abis` flags. So you might run a command like this:
17
+
18
+ ```
19
+ webdriver-manager update --android --android-api-levels 24 --android-archs armeabi-v7a
20
+ ```
21
+
22
+ Valid values for the `--android-api-levels` flag are: `24` and `25`. You *can* specify a lower
23
+ API level, but the virtual device create will not have Chrome installed.
24
+
25
+ Valid values for the `--android-archs` flag are:
26
+
27
+ * `x86`
28
+ * `x86_64`
29
+ * `armeabi-v7a` (or possibly some other 32-bit ARM architecture)
30
+ * `arm64-v8a` (or possibly some other 64-bit ARM architecture)
31
+ * `mips`
32
+
33
+ Note that we always use the `google_apis/*` ABIs, since only those versions comes with chrome. So
34
+ if you specify `--android-archs x86_64`, this tool will use the ABI `google_apis/x86_64`. If you
35
+ wish to use a different platform (i.e. `android-wear`, `android-tv` or `default`), you can do so
36
+ with the `--android-platforms` flag. But only the `google_apis` version comes with Chrome.
37
+
38
+
39
+ As a practical matter, if you don't want to manually accept the license agreements, you can use
40
+ `--android-accept-licenses`, which will accept them on your behalf.
41
+
42
+ Once you have installed the Android SDK with the virtual devices you need, use
43
+ `webdriver-manager start --android` to boot up Appium and begin emulating your android device(s).
44
+ By default `webdriver-manager` will emulate all available android devices. If you would rather
45
+ emulate a specific device, use `--avds`. So you might use:
46
+
47
+ ```
48
+ webdriver-manager start --android --avds android-23-default-x86_64
49
+ ```
50
+
51
+ If you would prefer not to emulate any android virtual devices, use `--avds none`.
52
+
53
+ If you need to specify the ports used by the android virtual devices, use `--avd_port`. The port
54
+ you specify will be used for the console of the first device, and the port one higher will be used
55
+ for its ADB. The second device will use the next two ports, and so on.
56
+
57
+
58
+ ### "Welcome to Chome" UI
59
+
60
+ Every time appium boots up chrome, a "Welcome to Chrome" dialog will pop up. It won't interfere
61
+ with your tests, since the webpage still renders underneath the dialog, and those tests access the
62
+ webpage directly. However, you won't be able to watch what's going on unless you manually click
63
+ "Accept & Continue". Also, since webdriver boots up a fresh chrome instance every time, chrome
64
+ won't remember that you've clicked "Accept & Continue" between tests. Any time you want to actually
65
+ watch the test as it's run, you'll need to click through the dialog again. For now, there is no
66
+ good way around this sadly (https://github.com/appium/appium/issues/6618).
67
+
68
+ iOS
69
+ ---------
70
+
71
+ When you run `webdriver-manager update --ios`, `webdriver-manager` will install Appium and check
72
+ your computer for iOS simulation capabilities. `webdriver-manager` cannot download the xcode
73
+ commandline tools for you however, nor can it agree to Apple's user agreement. The xcode
74
+ commandline tools come with several virtual devices pre-setup. If you need more, run
75
+ `xcrun simctl` for help doing that.
76
+
77
+ Once you have installed Appium, `webdriver-manager` will launch it automatically when you run
78
+ `webdriver-manager start`. Appium will automatically handle starting iOS device emulation as
79
+ needed.
@@ -0,0 +1,41 @@
1
+ # Protractor support topics
2
+
3
+ ## Supported browsers
4
+
5
+ ### Tests with Protractor test suite (v 4.0.13)
6
+
7
+ The following are the supported browsers / drivers based on running the
8
+ Protractor test suite. Since the test suite checks only firefox and chrome,
9
+ these are the only browsers reported.
10
+
11
+ ### Current supported browsers / drivers
12
+
13
+ | selenium standalone | firefox | chromedriver | chrome |
14
+ | ------------------- | ------- | ------------ | ------ |
15
+ | 2.53.1 | 47.0.1 | 2.26 | 54 |
16
+
17
+
18
+ ### Investigated
19
+
20
+ | selenium standalone | firefox 47.0.1 | firefox 49.0.1 |
21
+ | ------------------- | -------------- | -------------- |
22
+ | 2.53.1 | pass | fail |
23
+ | 3.0.0 | fail | fail |
24
+
25
+
26
+ ## Driver providers
27
+
28
+ There are a couple cases where Protractor launches downloaded binaries
29
+ (from webdriver-manager) without specifying which version to use:
30
+
31
+ - local driver providers - when no `seleniumAddress`, `directConnect`, saucelabs
32
+ or browser stack configuration is set
33
+ - direct connect - when setting `directConnect` to true
34
+
35
+ Protractor knows which downloaded binaries to use based on the
36
+ `update-config.json`. The `update-config.json` is written during the `update`
37
+ command and provides the path to the current downloaded version and a list of
38
+ all the binaries previously downloaded.
39
+
40
+ During the launch of either local driver provider or direct connect, Protractor
41
+ will launch the last downloaded binary.
@@ -0,0 +1,87 @@
1
+ # update command: downloading specific binaries
2
+
3
+ The help command for update. The flags shown here are OS specific. If you are not on a Windows machine, the `--ie` flags are not shown.
4
+
5
+ ```
6
+ webdriver-manager update help
7
+ ```
8
+
9
+ Overview when you call `update`:
10
+
11
+ * The output directory is created if it does not exist (`out_dir`)
12
+ * If this is the first time downloading, it will make web requests to selenium-release.storage.googleapis.com, chromedriver.storage.googleapis.com, and api.github.com. The responses will be stored in the `out_dir` as a cache.
13
+ * If this is not the first time downloading, it will look at the cached files in `out_dir` and if the file is older than an hour, it will make a request for new files. Note: api.github.com is rate limited by the ip address making the request. This is an issue for common CI systems like Travis or Circle and have an issue opened for this.
14
+ * The response will then be parsed for the url to get the latest version if no version is provided via command line. The latest version will be based on what is available for your OS type and architecture.
15
+ * Next we download the file from the url. If the file already exists (based on content length), we cancel the download.
16
+ * We uncompress zip and tar files and for linux and mac, we set the permissions. Currently, we always uncompress the files even if the uncompressed files already exist.
17
+ * Finally we write the file locations to the `update-config.json` which is also located in the `out_dir`.
18
+
19
+ ## Download defaults --chrome, --gecko, --standalone flags
20
+
21
+ Let's say you want to download just chromedriver...
22
+
23
+ ```
24
+ webdriver-manager update --gecko false --standalone false
25
+ ```
26
+
27
+ Why do we set `--gecko` and `--standalone` to false? By default chromedriver, geckodriver and selenium standalone server download with no flags set. Setting `--gecko` and `--standalone` to false will prevent them from downloading and will just download chromedriver.
28
+
29
+ ## Download using --ie
30
+
31
+ When setting the `--ie` flag, this will download IEDriver 32 bit. Why 32-bit? We prefer using the 32-bit version because the 64-bit version has been previously reported to be very slow and flaky.
32
+
33
+ ## Download a specific version
34
+
35
+ Let's say there is an issue with the latest version of chromedriver and we need version 2.20:
36
+
37
+ ```
38
+ webdriver-manager update --versions.chrome 2.20
39
+ ```
40
+
41
+ So the only thing different here is that instead of parsing for the latest version, we are parsing for version 2.20. We could then verify that it was the last item downloaded by calling `webdriver-manager status`.
42
+
43
+ What about selenium standalone 2.53.1? This is similar but instead of the flag would be `--versions.standalone 2.53.1`. What if the selenium standalone server has a beta in the name? The idea is similar:
44
+
45
+ ```
46
+ webdriver-manager update --versions.standalone 3.0.0-beta1
47
+ ```
48
+
49
+ # start command: setting specific versions
50
+
51
+ The help command for start.
52
+
53
+ ```
54
+ webdriver-manager start help
55
+ ```
56
+
57
+ When starting selenium standalone server with `webdriver-manager start`, it will use the latest version that is found in the cache unless you specify the version. Why? The idea here is that if you run `webdriver-manager update` without flags, you are using the latest binary versions, so the start command would be similar `webdriver-manager start`.
58
+
59
+ ## Starting a specific version
60
+
61
+ So let's say you downloaded chromedriver 2.20 and let's also say that the latest version is 2.29. If you have never downloaded 2.29, then chromedriver will not be associated with your selenium standalone server. In order for you to get 2.20 working:
62
+
63
+ ```
64
+ webdriver-manager start --versions.chrome 2.20
65
+ ```
66
+
67
+ What about chrome version 2.20, selenium standalone server 3.0.0-beta1, and not start with gecko driver?
68
+
69
+ ```
70
+ webdriver-manager start --versions.chrome 2.20 --versions.standalone 3.0.0-beta1 --gecko false
71
+ ```
72
+
73
+ ## Starting with --ie
74
+
75
+ Since IEDriver is not set by default, you'll still need to pass this field if you would like to start the selenium standalone server with the IEDriver.
76
+
77
+ ```
78
+ webdriver-manager start --ie
79
+ ```
80
+
81
+ ## Starting with --edge
82
+
83
+ We make the assumption that you already have the EdgeDriver downloaded and installed. To get this working pass the full path to the `--edge` flag
84
+
85
+ ```
86
+ webdriver-manager start --edge "C:\Program Files (x86)\Microsoft Web Driver\MicrosoftWebDriver.exe"
87
+ ```
package/gulpfile.js ADDED
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+ const path = require('path');
3
+ const gulp = require('gulp');
4
+ const tsGlobs = ['lib/**/*.ts', '*spec/**/*.ts'];
5
+
6
+ let runSpawn = (task, args, done) => {
7
+ done = done || function() {};
8
+ const spawn = require('child_process').spawn;
9
+ let child = spawn(task, args, {stdio: 'inherit'});
10
+ let running = false;
11
+ child.on('close', (code) => {
12
+ if (!running) {
13
+ running = true;
14
+ done(code);
15
+ }
16
+ });
17
+ child.on('error', (err) => {
18
+ if (!running) {
19
+ console.error('gulp encountered a child error');
20
+ running = true;
21
+ done(err || 1);
22
+ }
23
+ });
24
+ return child;
25
+ };
26
+
27
+ gulp.task('copy', function() {
28
+ return gulp.src(['config.json', 'package.json'])
29
+ .pipe(gulp.dest('built/'));
30
+ });
31
+
32
+ gulp.task('format:enforce', () => {
33
+ const format = require('gulp-clang-format');
34
+ const clangFormat = require('clang-format');
35
+ return gulp.src(tsGlobs).pipe(
36
+ format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
37
+ });
38
+
39
+ gulp.task('format', () => {
40
+ const format = require('gulp-clang-format');
41
+ const clangFormat = require('clang-format');
42
+ return gulp.src(tsGlobs, { base: '.' }).pipe(
43
+ format.format('file', clangFormat)).pipe(gulp.dest('.'));
44
+ });
package/package.json CHANGED
@@ -1,6 +1,85 @@
1
1
  {
2
2
  "name": "@ohos-ports/webdriver-manager",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "12.1.9-beta.0",
4
+ "description": "A selenium server and browser driver manager for your end to end tests.",
5
+ "scripts": {
6
+ "format": "gulp format",
7
+ "format-enforce": "gulp format:enforce",
8
+ "gulp": "gulp",
9
+ "jasmine": "jasmine",
10
+ "prepublish": "npm run format-enforce && tsc && gulp copy",
11
+ "tsc": "tsc",
12
+ "pretest": "tsc && gulp copy",
13
+ "test": "npm run test-unit && npm run test-e2e",
14
+ "test-unit": "jasmine",
15
+ "pretest-e2e:update": "node ./bin/webdriver-manager update",
16
+ "pretest-e2e:start": "node ./bin/webdriver-manager start --detach --seleniumPort 4444 --quiet",
17
+ "pretest-e2e": "npm run pretest && npm run pretest-e2e:update && npm run pretest-e2e:start",
18
+ "test-e2e": "jasmine JASMINE_CONFIG_PATH=e2e_spec/support/headless.json",
19
+ "posttest-e2e": "node ./bin/webdriver-manager shutdown"
20
+ },
21
+ "keywords": [
22
+ "angular",
23
+ "test",
24
+ "testing",
25
+ "protractor",
26
+ "webdriver",
27
+ "webdriverjs",
28
+ "selenium",
29
+ "selenium-webdriver"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/ohos-ports/ohos-ports.git",
34
+ "directory": "ports/webdriver-manager/12.1.9"
35
+ },
36
+ "bin": {
37
+ "webdriver-manager": "bin/webdriver-manager"
38
+ },
39
+ "main": "built/lib/webdriver.js",
40
+ "author": "Craig Nishina <craig.nishina@gmail.com>",
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "@ohos-ports/request": "^2.88.2-beta.0",
44
+ "adm-zip": "^0.5.2",
45
+ "chalk": "^1.1.1",
46
+ "del": "^2.2.0",
47
+ "glob": "^7.0.3",
48
+ "ini": "^1.3.4",
49
+ "minimist": "^1.2.0",
50
+ "q": "^1.4.1",
51
+ "rimraf": "^2.5.2",
52
+ "semver": "^5.3.0",
53
+ "xml2js": "^0.4.17"
54
+ },
55
+ "devDependencies": {
56
+ "@types/adm-zip": "^0.5.0",
57
+ "@types/chalk": "^0.4.28",
58
+ "@types/form-data": "^0.0.33",
59
+ "@types/glob": "^5.0.29",
60
+ "@types/ini": "^1.3.28",
61
+ "@types/jasmine": "^2.5.43",
62
+ "@types/minimatch": "^2.0.28",
63
+ "@types/minimist": "^1.1.28",
64
+ "@types/node": "^7.0.4",
65
+ "@types/q": "^0.0.32",
66
+ "@types/request": "^0.0.39",
67
+ "@types/rimraf": "^0.0.28",
68
+ "@types/selenium-webdriver": "^2.53.35",
69
+ "@types/semver": "^5.3.30",
70
+ "@types/xml2js": "0.0.32",
71
+ "clang-format": "^1.0.35",
72
+ "gulp": "^4.0.0",
73
+ "gulp-clang-format": "^1.0.23",
74
+ "jasmine": "^2.4.1",
75
+ "run-sequence": "^1.1.5",
76
+ "selenium-webdriver": "~3.0.1",
77
+ "typescript": "~2.3.0"
78
+ },
79
+ "engines": {
80
+ "node": ">=6.9.x"
81
+ },
82
+ "bugs": {
83
+ "url": "https://github.com/ohos-ports/ohos-ports/issues"
84
+ }
85
+ }