appium 2.0.0-beta.4 → 2.0.0-beta.40
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.
- package/README.md +10 -11
- package/build/lib/appium.d.ts +204 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +257 -131
- package/build/lib/cli/args.d.ts +20 -0
- package/build/lib/cli/args.d.ts.map +1 -0
- package/build/lib/cli/args.js +96 -282
- package/build/lib/cli/driver-command.d.ts +36 -0
- package/build/lib/cli/driver-command.d.ts.map +1 -0
- package/build/lib/cli/driver-command.js +25 -18
- package/build/lib/cli/extension-command.d.ts +372 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +286 -156
- package/build/lib/cli/extension.d.ts +18 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +30 -17
- package/build/lib/cli/parser.d.ts +80 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +152 -95
- package/build/lib/cli/plugin-command.d.ts +33 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +24 -19
- package/build/lib/cli/utils.d.ts +29 -0
- package/build/lib/cli/utils.d.ts.map +1 -0
- package/build/lib/cli/utils.js +27 -3
- package/build/lib/config-file.d.ts +100 -0
- package/build/lib/config-file.d.ts.map +1 -0
- package/build/lib/config-file.js +136 -0
- package/build/lib/config.d.ts +41 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +92 -67
- package/build/lib/constants.d.ts +48 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +60 -0
- package/build/lib/extension/driver-config.d.ts +81 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +177 -0
- package/build/lib/extension/extension-config.d.ts +242 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +436 -0
- package/build/lib/extension/index.d.ts +48 -0
- package/build/lib/extension/index.d.ts.map +1 -0
- package/build/lib/extension/index.js +74 -0
- package/build/lib/extension/manifest.d.ts +174 -0
- package/build/lib/extension/manifest.d.ts.map +1 -0
- package/build/lib/extension/manifest.js +256 -0
- package/build/lib/extension/package-changed.d.ts +11 -0
- package/build/lib/extension/package-changed.d.ts.map +1 -0
- package/build/lib/extension/package-changed.js +68 -0
- package/build/lib/extension/plugin-config.d.ts +57 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +78 -0
- package/build/lib/grid-register.d.ts +10 -0
- package/build/lib/grid-register.d.ts.map +1 -0
- package/build/lib/grid-register.js +21 -25
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +4 -6
- package/build/lib/logsink.d.ts +4 -0
- package/build/lib/logsink.d.ts.map +1 -0
- package/build/lib/logsink.js +14 -17
- package/build/lib/main.d.ts +55 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +189 -90
- package/build/lib/schema/arg-spec.d.ts +143 -0
- package/build/lib/schema/arg-spec.d.ts.map +1 -0
- package/build/lib/schema/arg-spec.js +119 -0
- package/build/lib/schema/cli-args.d.ts +19 -0
- package/build/lib/schema/cli-args.d.ts.map +1 -0
- package/build/lib/schema/cli-args.js +180 -0
- package/build/lib/schema/cli-transformers.d.ts +5 -0
- package/build/lib/schema/cli-transformers.d.ts.map +1 -0
- package/build/lib/schema/cli-transformers.js +74 -0
- package/build/lib/schema/index.d.ts +3 -0
- package/build/lib/schema/index.d.ts.map +1 -0
- package/build/lib/schema/index.js +34 -0
- package/build/lib/schema/keywords.d.ts +24 -0
- package/build/lib/schema/keywords.d.ts.map +1 -0
- package/build/lib/schema/keywords.js +70 -0
- package/build/lib/schema/schema.d.ts +259 -0
- package/build/lib/schema/schema.d.ts.map +1 -0
- package/build/lib/schema/schema.js +452 -0
- package/build/lib/utils.d.ts +66 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +35 -139
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types/appium-manifest.d.ts +59 -0
- package/build/types/appium-manifest.d.ts.map +1 -0
- package/build/types/cli.d.ts +112 -0
- package/build/types/cli.d.ts.map +1 -0
- package/build/types/extension-manifest.d.ts +55 -0
- package/build/types/extension-manifest.d.ts.map +1 -0
- package/build/types/index.d.ts +16 -0
- package/build/types/index.d.ts.map +1 -0
- package/driver.d.ts +1 -0
- package/driver.js +14 -0
- package/index.js +11 -0
- package/lib/appium.js +517 -186
- package/lib/cli/args.js +269 -422
- package/lib/cli/driver-command.js +58 -23
- package/lib/cli/extension-command.js +612 -260
- package/lib/cli/extension.js +34 -16
- package/lib/cli/parser.js +241 -83
- package/lib/cli/plugin-command.js +48 -20
- package/lib/cli/utils.js +24 -10
- package/lib/config-file.js +219 -0
- package/lib/config.js +210 -91
- package/lib/constants.js +69 -0
- package/lib/extension/driver-config.js +249 -0
- package/lib/extension/extension-config.js +679 -0
- package/lib/extension/index.js +116 -0
- package/lib/extension/manifest.js +475 -0
- package/lib/extension/package-changed.js +64 -0
- package/lib/extension/plugin-config.js +113 -0
- package/lib/grid-register.js +49 -35
- package/lib/logger.js +1 -2
- package/lib/logsink.js +38 -33
- package/lib/main.js +303 -100
- package/lib/schema/arg-spec.js +229 -0
- package/lib/schema/cli-args.js +238 -0
- package/lib/schema/cli-transformers.js +115 -0
- package/lib/schema/index.js +2 -0
- package/lib/schema/keywords.js +136 -0
- package/lib/schema/schema.js +717 -0
- package/lib/utils.js +121 -140
- package/package.json +75 -85
- package/plugin.d.ts +1 -0
- package/plugin.js +13 -0
- package/scripts/autoinstall-extensions.js +177 -0
- package/support.d.ts +1 -0
- package/support.js +13 -0
- package/types/appium-manifest.ts +73 -0
- package/types/cli.ts +146 -0
- package/types/extension-manifest.ts +64 -0
- package/types/index.ts +21 -0
- package/CHANGELOG.md +0 -3515
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/lib/cli/npm.js +0 -206
- package/build/lib/cli/parser-helpers.js +0 -82
- package/build/lib/driver-config.js +0 -77
- package/build/lib/drivers.js +0 -96
- package/build/lib/extension-config.js +0 -253
- package/build/lib/plugin-config.js +0 -59
- package/build/lib/plugins.js +0 -14
- package/lib/cli/npm.js +0 -183
- package/lib/cli/parser-helpers.js +0 -79
- package/lib/driver-config.js +0 -46
- package/lib/drivers.js +0 -81
- package/lib/extension-config.js +0 -209
- package/lib/plugin-config.js +0 -34
- package/lib/plugins.js +0 -10
package/lib/utils.js
CHANGED
|
@@ -1,65 +1,70 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import logger from './logger';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import {processCapabilities, PROTOCOLS} from '@appium/base-driver';
|
|
4
|
+
import {inspect as dump} from 'util';
|
|
5
5
|
|
|
6
6
|
const W3C_APPIUM_PREFIX = 'appium';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* If `stdout` is a TTY, this is `true`.
|
|
11
|
+
*
|
|
12
|
+
* Used for tighter control over log output.
|
|
13
|
+
* @type {boolean}
|
|
14
|
+
*/
|
|
15
|
+
const isStdoutTTY = process.stdout.isTTY;
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
for (let [arg, value] of _.toPairs(args)) {
|
|
28
|
-
value = getValueArray(value);
|
|
29
|
-
logger.info(` ${arg}: ${value.shift()}`);
|
|
30
|
-
for (let val of value) {
|
|
31
|
-
logger.info(val);
|
|
32
|
-
}
|
|
17
|
+
/**
|
|
18
|
+
* Dumps to value to the console using `info` logger.
|
|
19
|
+
*
|
|
20
|
+
* @todo May want to force color to be `false` if {@link isStdoutTTY} is `false`.
|
|
21
|
+
*/
|
|
22
|
+
const inspect = _.flow(
|
|
23
|
+
_.partialRight(
|
|
24
|
+
/** @type {(object: any, options: import('util').InspectOptions) => string} */ (dump),
|
|
25
|
+
{colors: true, depth: null, compact: !isStdoutTTY}
|
|
26
|
+
),
|
|
27
|
+
(...args) => {
|
|
28
|
+
logger.info(...args);
|
|
33
29
|
}
|
|
34
|
-
|
|
30
|
+
);
|
|
35
31
|
|
|
36
32
|
/**
|
|
37
33
|
* Takes the caps that were provided in the request and translates them
|
|
38
34
|
* into caps that can be used by the inner drivers.
|
|
39
35
|
*
|
|
40
|
-
* @param {
|
|
41
|
-
* @param {
|
|
42
|
-
* @param {
|
|
43
|
-
* @param {
|
|
36
|
+
* @param {any} jsonwpCapabilities
|
|
37
|
+
* @param {W3CCapabilities} w3cCapabilities
|
|
38
|
+
* @param {import('@appium/types').Constraints} constraints
|
|
39
|
+
* @param {import('@appium/types').DefaultCapabilitiesConfig} [defaultCapabilities]
|
|
40
|
+
* @returns {ParsedDriverCaps|InvalidCaps}
|
|
44
41
|
*/
|
|
45
|
-
function parseCapsForInnerDriver
|
|
42
|
+
function parseCapsForInnerDriver(
|
|
43
|
+
jsonwpCapabilities,
|
|
44
|
+
w3cCapabilities,
|
|
45
|
+
constraints = {},
|
|
46
|
+
defaultCapabilities = {}
|
|
47
|
+
) {
|
|
46
48
|
// Check if the caller sent JSONWP caps, W3C caps, or both
|
|
47
|
-
const hasW3CCaps =
|
|
49
|
+
const hasW3CCaps =
|
|
50
|
+
_.isPlainObject(w3cCapabilities) &&
|
|
48
51
|
(_.has(w3cCapabilities, 'alwaysMatch') || _.has(w3cCapabilities, 'firstMatch'));
|
|
49
52
|
const hasJSONWPCaps = _.isPlainObject(jsonwpCapabilities);
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
let processedW3CCapabilities
|
|
53
|
-
|
|
53
|
+
let desiredCaps = /** @type {ParsedDriverCaps['desiredCaps']} */ ({});
|
|
54
|
+
/** @type {ParsedDriverCaps['processedW3CCapabilities']} */
|
|
55
|
+
let processedW3CCapabilities;
|
|
56
|
+
/** @type {ParsedDriverCaps['processedJsonwpCapabilities']} */
|
|
57
|
+
let processedJsonwpCapabilities;
|
|
54
58
|
|
|
55
|
-
if (!
|
|
56
|
-
return {
|
|
59
|
+
if (!hasW3CCaps) {
|
|
60
|
+
return /** @type {InvalidCaps} */ ({
|
|
57
61
|
protocol: PROTOCOLS.W3C,
|
|
58
|
-
error: new Error('
|
|
59
|
-
};
|
|
62
|
+
error: new Error('W3C capabilities should be provided'),
|
|
63
|
+
});
|
|
60
64
|
}
|
|
61
65
|
|
|
62
|
-
const {W3C
|
|
66
|
+
const {W3C} = PROTOCOLS;
|
|
67
|
+
const protocol = W3C;
|
|
63
68
|
|
|
64
69
|
// Make sure we don't mutate the original arguments
|
|
65
70
|
jsonwpCapabilities = _.cloneDeep(jsonwpCapabilities);
|
|
@@ -71,16 +76,23 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
|
|
|
71
76
|
for (const [defaultCapKey, defaultCapValue] of _.toPairs(defaultCapabilities)) {
|
|
72
77
|
let isCapAlreadySet = false;
|
|
73
78
|
// Check if the key is already present in firstMatch entries
|
|
74
|
-
for (const firstMatchEntry of
|
|
75
|
-
if (
|
|
76
|
-
|
|
79
|
+
for (const firstMatchEntry of w3cCapabilities.firstMatch || []) {
|
|
80
|
+
if (
|
|
81
|
+
_.isPlainObject(firstMatchEntry) &&
|
|
82
|
+
_.has(removeAppiumPrefixes(firstMatchEntry), removeAppiumPrefix(defaultCapKey))
|
|
83
|
+
) {
|
|
77
84
|
isCapAlreadySet = true;
|
|
78
85
|
break;
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
// Check if the key is already present in alwaysMatch entries
|
|
82
|
-
isCapAlreadySet =
|
|
83
|
-
|
|
89
|
+
isCapAlreadySet =
|
|
90
|
+
isCapAlreadySet ||
|
|
91
|
+
(_.isPlainObject(w3cCapabilities.alwaysMatch) &&
|
|
92
|
+
_.has(
|
|
93
|
+
removeAppiumPrefixes(w3cCapabilities.alwaysMatch),
|
|
94
|
+
removeAppiumPrefix(defaultCapKey)
|
|
95
|
+
));
|
|
84
96
|
if (isCapAlreadySet) {
|
|
85
97
|
// Skip if the key is already present in the provided caps
|
|
86
98
|
continue;
|
|
@@ -95,62 +107,33 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
|
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
if (hasJSONWPCaps) {
|
|
98
|
-
jsonwpCapabilities =
|
|
110
|
+
jsonwpCapabilities = {
|
|
111
|
+
...removeAppiumPrefixes(defaultCapabilities),
|
|
112
|
+
...jsonwpCapabilities,
|
|
113
|
+
};
|
|
99
114
|
}
|
|
100
115
|
}
|
|
101
116
|
|
|
102
117
|
// Get MJSONWP caps
|
|
103
118
|
if (hasJSONWPCaps) {
|
|
104
|
-
protocol = MJSONWP;
|
|
105
|
-
desiredCaps = jsonwpCapabilities;
|
|
106
119
|
processedJsonwpCapabilities = {...jsonwpCapabilities};
|
|
107
120
|
}
|
|
108
121
|
|
|
109
122
|
// Get W3C caps
|
|
110
123
|
if (hasW3CCaps) {
|
|
111
|
-
protocol = W3C;
|
|
112
124
|
// Call the process capabilities algorithm to find matching caps on the W3C
|
|
113
125
|
// (see: https://github.com/jlipps/simple-wd-spec#processing-capabilities)
|
|
114
|
-
let isFixingNeededForW3cCaps = false;
|
|
115
126
|
try {
|
|
116
127
|
desiredCaps = processCapabilities(w3cCapabilities, constraints, true);
|
|
117
128
|
} catch (error) {
|
|
118
|
-
if (!hasJSONWPCaps) {
|
|
119
|
-
return {
|
|
120
|
-
desiredCaps,
|
|
121
|
-
processedJsonwpCapabilities,
|
|
122
|
-
processedW3CCapabilities,
|
|
123
|
-
protocol,
|
|
124
|
-
error,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
129
|
logger.info(`Could not parse W3C capabilities: ${error.message}`);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
`in W3C capabilities: ${JSON.stringify(differingKeys)}`);
|
|
136
|
-
isFixingNeededForW3cCaps = true;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (isFixingNeededForW3cCaps && hasJSONWPCaps) {
|
|
141
|
-
logger.info('Trying to fix W3C capabilities by merging them with JSONWP caps');
|
|
142
|
-
w3cCapabilities = fixW3cCapabilities(w3cCapabilities, jsonwpCapabilities);
|
|
143
|
-
try {
|
|
144
|
-
desiredCaps = processCapabilities(w3cCapabilities, constraints, true);
|
|
145
|
-
} catch (error) {
|
|
146
|
-
logger.warn(`Could not parse fixed W3C capabilities: ${error.message}. Falling back to JSONWP protocol`);
|
|
147
|
-
return {
|
|
148
|
-
desiredCaps: processedJsonwpCapabilities,
|
|
149
|
-
processedJsonwpCapabilities,
|
|
150
|
-
processedW3CCapabilities: null,
|
|
151
|
-
protocol: MJSONWP,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
130
|
+
return /** @type {InvalidCaps} */ ({
|
|
131
|
+
desiredCaps,
|
|
132
|
+
processedJsonwpCapabilities,
|
|
133
|
+
processedW3CCapabilities,
|
|
134
|
+
protocol,
|
|
135
|
+
error,
|
|
136
|
+
});
|
|
154
137
|
}
|
|
155
138
|
|
|
156
139
|
// Create a new w3c capabilities payload that contains only the matching caps in `alwaysMatch`
|
|
@@ -160,55 +143,20 @@ function parseCapsForInnerDriver (jsonwpCapabilities, w3cCapabilities, constrain
|
|
|
160
143
|
};
|
|
161
144
|
}
|
|
162
145
|
|
|
163
|
-
return {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*
|
|
170
|
-
* @param {Object} w3cCaps W3C capabilities
|
|
171
|
-
* @param {Object} jsonwpCaps JSONWP capabilities
|
|
172
|
-
* @return {Object} Fixed W3C capabilities
|
|
173
|
-
*/
|
|
174
|
-
function fixW3cCapabilities (w3cCaps, jsonwpCaps) {
|
|
175
|
-
const result = {
|
|
176
|
-
firstMatch: w3cCaps.firstMatch || [],
|
|
177
|
-
alwaysMatch: w3cCaps.alwaysMatch || {},
|
|
178
|
-
};
|
|
179
|
-
const keysToInsert = _.keys(jsonwpCaps);
|
|
180
|
-
const removeMatchingKeys = (match) => {
|
|
181
|
-
_.pull(keysToInsert, match);
|
|
182
|
-
const colonIndex = match.indexOf(':');
|
|
183
|
-
if (colonIndex >= 0 && match.length > colonIndex) {
|
|
184
|
-
_.pull(keysToInsert, match.substring(colonIndex + 1));
|
|
185
|
-
}
|
|
186
|
-
if (keysToInsert.includes(`${W3C_APPIUM_PREFIX}:${match}`)) {
|
|
187
|
-
_.pull(keysToInsert, `${W3C_APPIUM_PREFIX}:${match}`);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
for (const firstMatchEntry of result.firstMatch) {
|
|
192
|
-
for (const pair of _.toPairs(firstMatchEntry)) {
|
|
193
|
-
removeMatchingKeys(pair[0]);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
for (const pair of _.toPairs(result.alwaysMatch)) {
|
|
198
|
-
removeMatchingKeys(pair[0]);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
for (const key of keysToInsert) {
|
|
202
|
-
result.alwaysMatch[key] = jsonwpCaps[key];
|
|
203
|
-
}
|
|
204
|
-
return result;
|
|
146
|
+
return /** @type {ParsedDriverCaps} */ ({
|
|
147
|
+
desiredCaps,
|
|
148
|
+
processedJsonwpCapabilities,
|
|
149
|
+
processedW3CCapabilities,
|
|
150
|
+
protocol,
|
|
151
|
+
});
|
|
205
152
|
}
|
|
206
153
|
|
|
207
154
|
/**
|
|
208
155
|
* Takes a capabilities objects and prefixes capabilities with `appium:`
|
|
209
|
-
* @param {
|
|
156
|
+
* @param {Capabilities} caps Desired capabilities object
|
|
157
|
+
* @returns {AppiumW3CCapabilities}
|
|
210
158
|
*/
|
|
211
|
-
function insertAppiumPrefixes
|
|
159
|
+
function insertAppiumPrefixes(caps) {
|
|
212
160
|
// Standard, non-prefixed capabilities (see https://www.w3.org/TR/webdriver/#dfn-table-of-standard-capabilities)
|
|
213
161
|
const STANDARD_CAPS = [
|
|
214
162
|
'browserName',
|
|
@@ -219,7 +167,7 @@ function insertAppiumPrefixes (caps) {
|
|
|
219
167
|
'proxy',
|
|
220
168
|
'setWindowRect',
|
|
221
169
|
'timeouts',
|
|
222
|
-
'unhandledPromptBehavior'
|
|
170
|
+
'unhandledPromptBehavior',
|
|
223
171
|
];
|
|
224
172
|
|
|
225
173
|
let prefixedCaps = {};
|
|
@@ -233,11 +181,17 @@ function insertAppiumPrefixes (caps) {
|
|
|
233
181
|
return prefixedCaps;
|
|
234
182
|
}
|
|
235
183
|
|
|
236
|
-
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @param {AppiumW3CCapabilities} caps
|
|
187
|
+
* @returns {Capabilities}
|
|
188
|
+
*/
|
|
189
|
+
function removeAppiumPrefixes(caps) {
|
|
237
190
|
if (!_.isPlainObject(caps)) {
|
|
238
191
|
return caps;
|
|
239
192
|
}
|
|
240
193
|
|
|
194
|
+
/** @type {Capabilities} */
|
|
241
195
|
const fixedCaps = {};
|
|
242
196
|
for (let [name, value] of _.toPairs(caps)) {
|
|
243
197
|
fixedCaps[removeAppiumPrefix(name)] = value;
|
|
@@ -245,12 +199,12 @@ function removeAppiumPrefixes (caps) {
|
|
|
245
199
|
return fixedCaps;
|
|
246
200
|
}
|
|
247
201
|
|
|
248
|
-
function removeAppiumPrefix
|
|
202
|
+
function removeAppiumPrefix(key) {
|
|
249
203
|
const prefix = `${W3C_APPIUM_PREFIX}:`;
|
|
250
204
|
return _.startsWith(key, prefix) ? key.substring(prefix.length) : key;
|
|
251
205
|
}
|
|
252
206
|
|
|
253
|
-
function getPackageVersion
|
|
207
|
+
function getPackageVersion(pkgName) {
|
|
254
208
|
const pkgInfo = require(`${pkgName}/package.json`) || {};
|
|
255
209
|
return pkgInfo.version;
|
|
256
210
|
}
|
|
@@ -271,7 +225,7 @@ function getPackageVersion (pkgName) {
|
|
|
271
225
|
* setting items or a dictionary containing parsed Appium setting names along with
|
|
272
226
|
* their values.
|
|
273
227
|
*/
|
|
274
|
-
function pullSettings
|
|
228
|
+
function pullSettings(caps) {
|
|
275
229
|
if (!_.isPlainObject(caps) || _.isEmpty(caps)) {
|
|
276
230
|
return {};
|
|
277
231
|
}
|
|
@@ -289,9 +243,36 @@ function pullSettings (caps) {
|
|
|
289
243
|
return result;
|
|
290
244
|
}
|
|
291
245
|
|
|
292
|
-
const rootDir = findRoot(__dirname);
|
|
293
|
-
|
|
294
246
|
export {
|
|
295
|
-
|
|
296
|
-
|
|
247
|
+
inspect,
|
|
248
|
+
parseCapsForInnerDriver,
|
|
249
|
+
insertAppiumPrefixes,
|
|
250
|
+
getPackageVersion,
|
|
251
|
+
pullSettings,
|
|
252
|
+
removeAppiumPrefixes,
|
|
297
253
|
};
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @todo protocol is more specific
|
|
257
|
+
* @typedef ParsedDriverCaps
|
|
258
|
+
* @property {Capabilities} desiredCaps
|
|
259
|
+
* @property {string} protocol
|
|
260
|
+
* @property {any} [processedJsonwpCapabilities]
|
|
261
|
+
* @property {W3CCapabilities} [processedW3CCapabilities]
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @todo protocol is more specific
|
|
266
|
+
* @typedef InvalidCaps
|
|
267
|
+
* @property {Error} error
|
|
268
|
+
* @property {string} protocol
|
|
269
|
+
* @property {Capabilities} [desiredCaps]
|
|
270
|
+
* @property {any} [processedJsonwpCapabilities]
|
|
271
|
+
* @property {W3CCapabilities} [processedW3CCapabilities]
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @typedef {import('@appium/types').W3CCapabilities} W3CCapabilities
|
|
276
|
+
* @typedef {import('@appium/types').Capabilities} Capabilities
|
|
277
|
+
* @typedef {import('@appium/types').AppiumW3CCapabilities} AppiumW3CCapabilities
|
|
278
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium",
|
|
3
|
+
"version": "2.0.0-beta.40",
|
|
3
4
|
"description": "Automation for Apps.",
|
|
4
|
-
"
|
|
5
|
+
"keywords": [
|
|
5
6
|
"automation",
|
|
6
7
|
"javascript",
|
|
7
8
|
"selenium",
|
|
@@ -11,102 +12,91 @@
|
|
|
11
12
|
"firefoxos",
|
|
12
13
|
"testing"
|
|
13
14
|
],
|
|
14
|
-
"
|
|
15
|
-
"author": "https://github.com/appium",
|
|
16
|
-
"license": "Apache-2.0",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/appium/appium.git"
|
|
20
|
-
},
|
|
15
|
+
"homepage": "https://appium.io",
|
|
21
16
|
"bugs": {
|
|
22
17
|
"url": "https://github.com/appium/appium/issues"
|
|
23
18
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/appium/appium.git",
|
|
22
|
+
"directory": "packages/appium"
|
|
27
23
|
},
|
|
28
|
-
"
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"author": "https://github.com/appium",
|
|
26
|
+
"types": "./build/lib/main.d.ts",
|
|
29
27
|
"bin": {
|
|
30
|
-
"appium": "
|
|
28
|
+
"appium": "index.js"
|
|
31
29
|
},
|
|
32
30
|
"directories": {
|
|
33
|
-
"lib": "./lib"
|
|
34
|
-
"doc": "./docs"
|
|
31
|
+
"lib": "./lib"
|
|
35
32
|
},
|
|
36
33
|
"files": [
|
|
37
|
-
"bin",
|
|
38
34
|
"lib",
|
|
39
|
-
"build
|
|
40
|
-
"
|
|
35
|
+
"build",
|
|
36
|
+
"index.js",
|
|
37
|
+
"driver.*",
|
|
38
|
+
"support.*",
|
|
39
|
+
"plugin.*",
|
|
40
|
+
"test.*",
|
|
41
|
+
"scripts/autoinstall-extensions.js",
|
|
42
|
+
"types"
|
|
41
43
|
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "babel lib --root-mode=upward --out-dir=build/lib",
|
|
46
|
+
"build:docs": "node docs/scripts/build-docs.js",
|
|
47
|
+
"build:docs:assets": "node docs/scripts/copy-assets.js",
|
|
48
|
+
"dev": "npm run build -- --watch",
|
|
49
|
+
"dev:docs": "npm run build:docs:assets && npm run dev:docs:en",
|
|
50
|
+
"dev:docs:en": "mkdocs serve -f ./docs/mkdocs-en.yml",
|
|
51
|
+
"dev:docs:ja": "mkdocs serve -f ./docs/mkdocs-ja.yml",
|
|
52
|
+
"fix": "npm run lint -- --fix",
|
|
53
|
+
"postinstall": "node ./scripts/autoinstall-extensions.js",
|
|
54
|
+
"lint": "eslint -c ../../.eslintrc --ignore-path ../../.eslintignore .",
|
|
55
|
+
"prepare": "npm run build",
|
|
56
|
+
"publish:docs": "APPIUM_DOCS_PUBLISH=1 npm run build:docs",
|
|
57
|
+
"test": "npm run test:unit",
|
|
58
|
+
"test:e2e": "mocha --timeout 75s --slow 30s \"./test/e2e/**/*.spec.js\"",
|
|
59
|
+
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
|
60
|
+
},
|
|
42
61
|
"dependencies": {
|
|
43
|
-
"@appium/base-
|
|
44
|
-
"@
|
|
45
|
-
"appium
|
|
46
|
-
"appium
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
62
|
+
"@appium/base-driver": "^8.5.7",
|
|
63
|
+
"@appium/base-plugin": "^1.9.2",
|
|
64
|
+
"@appium/docutils": "^0.0.7",
|
|
65
|
+
"@appium/schema": "^0.0.7",
|
|
66
|
+
"@appium/support": "^2.59.2",
|
|
67
|
+
"@appium/test-support": "^1.3.22",
|
|
68
|
+
"@babel/runtime": "7.18.3",
|
|
69
|
+
"@sidvind/better-ajv-errors": "2.0.0",
|
|
70
|
+
"ajv": "8.11.0",
|
|
71
|
+
"ajv-formats": "2.1.1",
|
|
72
|
+
"argparse": "2.0.1",
|
|
73
|
+
"async-lock": "1.3.1",
|
|
74
|
+
"asyncbox": "2.9.2",
|
|
75
|
+
"axios": "0.27.2",
|
|
76
|
+
"bluebird": "3.7.2",
|
|
77
|
+
"find-up": "5.0.0",
|
|
78
|
+
"lilconfig": "2.0.5",
|
|
79
|
+
"lodash": "4.17.21",
|
|
80
|
+
"longjohn": "0.2.12",
|
|
81
|
+
"npmlog": "6.0.2",
|
|
82
|
+
"ora": "5.4.1",
|
|
83
|
+
"package-changed": "1.9.0",
|
|
84
|
+
"resolve-from": "5.0.0",
|
|
85
|
+
"semver": "7.3.7",
|
|
86
|
+
"source-map-support": "0.5.21",
|
|
87
|
+
"supports-color": "8.1.1",
|
|
88
|
+
"teen_process": "1.16.0",
|
|
89
|
+
"winston": "3.7.2",
|
|
90
|
+
"word-wrap": "1.2.3",
|
|
91
|
+
"yaml": "2.1.1"
|
|
65
92
|
},
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"prepublishOnly": "npm run prune-shrinkwrap && gulp fixShrinkwrap",
|
|
70
|
-
"postpublish": "npm run restore-shrinkwrap",
|
|
71
|
-
"prune-shrinkwrap": "!(test -e npm-shrinkwrap.json) || (npm ci --production --ignore-scripts && npm run backup-shrinkwrap && npm shrinkwrap && npm install --only=dev --no-shrinkwrap)",
|
|
72
|
-
"restore-shrinkwrap": "!(test -e npm-shrinkwrap.json) || (mv npm-shrinkwrap-backup.json npm-shrinkwrap.json)",
|
|
73
|
-
"backup-shrinkwrap": "mv npm-shrinkwrap.json npm-shrinkwrap-backup.json",
|
|
74
|
-
"check-pruned-shrinkwrap": "node check-pruned-shrinkwrap.js",
|
|
75
|
-
"test": "gulp once",
|
|
76
|
-
"e2e-test": "gulp e2e-test",
|
|
77
|
-
"watch": "gulp watch",
|
|
78
|
-
"build": "gulp transpile",
|
|
79
|
-
"mocha": "mocha",
|
|
80
|
-
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
|
|
81
|
-
"precommit-test": "REPORTER=dot gulp once",
|
|
82
|
-
"lint": "gulp lint",
|
|
83
|
-
"lint:fix": "gulp lint --fix",
|
|
84
|
-
"coverage": "gulp coveralls",
|
|
85
|
-
"generate-docs": "node ./build/commands-yml/parse.js",
|
|
86
|
-
"zip": "zip -qr appium.zip .",
|
|
87
|
-
"upload": "gulp github-upload",
|
|
88
|
-
"zip-and-upload": "npm run zip && npm run upload",
|
|
89
|
-
"authorize-ios": "authorize-ios"
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">=14",
|
|
95
|
+
"npm": ">=6"
|
|
90
96
|
},
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
"@appium/fake-plugin": "^0.2.0",
|
|
97
|
-
"appium-fake-driver": "^1.0.1",
|
|
98
|
-
"appium-gulp-plugins": "^5.2.1",
|
|
99
|
-
"chai": "4.x",
|
|
100
|
-
"chai-as-promised": "7.x",
|
|
101
|
-
"eslint-config-appium": "^4.0.1",
|
|
102
|
-
"fancy-log": "^1.3.2",
|
|
103
|
-
"gulp": "^4.0.0",
|
|
104
|
-
"handlebars": "^4.2.0",
|
|
105
|
-
"mocha": "^8.0.1",
|
|
106
|
-
"pre-commit": "1.x",
|
|
107
|
-
"sinon": "^9.0.0",
|
|
108
|
-
"validate.js": "^0.13.0",
|
|
109
|
-
"wd": "^1.10.0",
|
|
110
|
-
"yaml-js": "^0.2.0"
|
|
111
|
-
}
|
|
97
|
+
"publishConfig": {
|
|
98
|
+
"access": "public",
|
|
99
|
+
"tag": "next"
|
|
100
|
+
},
|
|
101
|
+
"gitHead": "4cf2cc92d066ed32adda27e0439547290a4b71ce"
|
|
112
102
|
}
|
package/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@appium/base-plugin';
|
package/plugin.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// @ts-check
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This module is here to re-export `@appium/base-plugin` for Appium extensions.
|
|
7
|
+
*
|
|
8
|
+
* @see https://npm.im/@appium/base-plugin
|
|
9
|
+
* @example
|
|
10
|
+
* const { BasePlugin } = require('appium/plugin');
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
module.exports = require('@appium/base-plugin');
|