appium-webdriveragent 11.1.0 → 11.1.2
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/CHANGELOG.md +12 -0
- package/WebDriverAgentLib/Info.plist +2 -2
- package/build/lib/utils.d.ts +0 -12
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +0 -51
- package/build/lib/utils.js.map +1 -1
- package/build/lib/webdriveragent.d.ts.map +1 -1
- package/build/lib/webdriveragent.js +0 -1
- package/build/lib/webdriveragent.js.map +1 -1
- package/build/lib/xcodebuild.d.ts +1 -6
- package/build/lib/xcodebuild.d.ts.map +1 -1
- package/build/lib/xcodebuild.js +5 -24
- package/build/lib/xcodebuild.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.ts +1 -52
- package/lib/webdriveragent.ts +0 -1
- package/lib/xcodebuild.ts +6 -28
- package/package.json +3 -2
- package/build/test/functional/desired.d.ts +0 -3
- package/build/test/functional/desired.d.ts.map +0 -1
- package/build/test/functional/desired.js +0 -9
- package/build/test/functional/desired.js.map +0 -1
- package/build/test/functional/helpers/simulator.d.ts +0 -5
- package/build/test/functional/helpers/simulator.d.ts.map +0 -1
- package/build/test/functional/helpers/simulator.js +0 -39
- package/build/test/functional/helpers/simulator.js.map +0 -1
- package/build/test/functional/webdriveragent-e2e-specs.d.ts +0 -2
- package/build/test/functional/webdriveragent-e2e-specs.d.ts.map +0 -1
- package/build/test/functional/webdriveragent-e2e-specs.js +0 -133
- package/build/test/functional/webdriveragent-e2e-specs.js.map +0 -1
- package/build/test/unit/utils-specs.d.ts +0 -2
- package/build/test/unit/utils-specs.d.ts.map +0 -1
- package/build/test/unit/utils-specs.js +0 -161
- package/build/test/unit/utils-specs.js.map +0 -1
- package/build/test/unit/webdriveragent-specs.d.ts +0 -2
- package/build/test/unit/webdriveragent-specs.d.ts.map +0 -1
- package/build/test/unit/webdriveragent-specs.js +0 -424
- package/build/test/unit/webdriveragent-specs.js.map +0 -1
package/lib/utils.ts
CHANGED
|
@@ -4,15 +4,13 @@ import path, { dirname } from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { log } from './logger';
|
|
6
6
|
import _ from 'lodash';
|
|
7
|
-
import {
|
|
7
|
+
import { PLATFORM_NAME_TVOS } from './constants';
|
|
8
8
|
import B from 'bluebird';
|
|
9
9
|
import _fs from 'node:fs';
|
|
10
10
|
import { waitForCondition } from 'asyncbox';
|
|
11
11
|
import { arch } from 'node:os';
|
|
12
12
|
import type { DeviceInfo } from './types';
|
|
13
13
|
|
|
14
|
-
const PROJECT_FILE = 'project.pbxproj';
|
|
15
|
-
|
|
16
14
|
// Get current filename - works in both CommonJS and ESM
|
|
17
15
|
const currentFilename =
|
|
18
16
|
typeof __filename !== 'undefined'
|
|
@@ -94,47 +92,6 @@ export function isTvOS (platformName: string): boolean {
|
|
|
94
92
|
return _.toLower(platformName) === _.toLower(PLATFORM_NAME_TVOS);
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
/**
|
|
98
|
-
* Update WebDriverAgentRunner project bundle ID with newBundleId.
|
|
99
|
-
* This method assumes project file is in the correct state.
|
|
100
|
-
* @param agentPath - Path to the .xcodeproj directory.
|
|
101
|
-
* @param newBundleId the new bundle ID used to update.
|
|
102
|
-
*/
|
|
103
|
-
export async function updateProjectFile (agentPath: string, newBundleId: string): Promise<void> {
|
|
104
|
-
const projectFilePath = path.resolve(agentPath, PROJECT_FILE);
|
|
105
|
-
try {
|
|
106
|
-
// Assuming projectFilePath is in the correct state, create .old from projectFilePath
|
|
107
|
-
await fs.copyFile(projectFilePath, `${projectFilePath}.old`);
|
|
108
|
-
await replaceInFile(projectFilePath, new RegExp(_.escapeRegExp(WDA_RUNNER_BUNDLE_ID), 'g'), newBundleId);
|
|
109
|
-
log.debug(`Successfully updated '${projectFilePath}' with bundle id '${newBundleId}'`);
|
|
110
|
-
} catch (err: any) {
|
|
111
|
-
log.debug(`Error updating project file: ${err.message}`);
|
|
112
|
-
log.warn(`Unable to update project file '${projectFilePath}' with ` +
|
|
113
|
-
`bundle id '${newBundleId}'. WebDriverAgent may not start`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Reset WebDriverAgentRunner project bundle ID to correct state.
|
|
119
|
-
* @param agentPath - Path to the .xcodeproj directory.
|
|
120
|
-
*/
|
|
121
|
-
export async function resetProjectFile (agentPath: string): Promise<void> {
|
|
122
|
-
const projectFilePath = path.join(agentPath, PROJECT_FILE);
|
|
123
|
-
try {
|
|
124
|
-
// restore projectFilePath from .old file
|
|
125
|
-
if (!await fs.exists(`${projectFilePath}.old`)) {
|
|
126
|
-
return; // no need to reset
|
|
127
|
-
}
|
|
128
|
-
await fs.mv(`${projectFilePath}.old`, projectFilePath);
|
|
129
|
-
log.debug(`Successfully reset '${projectFilePath}' with bundle id '${WDA_RUNNER_BUNDLE_ID}'`);
|
|
130
|
-
} catch (err: any) {
|
|
131
|
-
log.debug(`Error resetting project file: ${err.message}`);
|
|
132
|
-
log.warn(`Unable to reset project file '${projectFilePath}' with ` +
|
|
133
|
-
`bundle id '${WDA_RUNNER_BUNDLE_ID}'. WebDriverAgent has been ` +
|
|
134
|
-
`modified and not returned to the original state.`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
95
|
export async function setRealDeviceSecurity (keychainPath: string, keychainPassword: string): Promise<void> {
|
|
139
96
|
log.debug('Setting security for iOS device');
|
|
140
97
|
await exec('security', ['-v', 'list-keychains', '-s', keychainPath]);
|
|
@@ -382,12 +339,4 @@ async function getPIDsUsingPattern (pattern: string): Promise<string[]> {
|
|
|
382
339
|
}
|
|
383
340
|
}
|
|
384
341
|
|
|
385
|
-
async function replaceInFile (file: string, find: string | RegExp, replace: string): Promise<void> {
|
|
386
|
-
const contents = await fs.readFile(file, 'utf8');
|
|
387
|
-
|
|
388
|
-
const newContents = contents.replace(find, replace);
|
|
389
|
-
if (newContents !== contents) {
|
|
390
|
-
await fs.writeFile(file, newContents, 'utf8');
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
342
|
|
package/lib/webdriveragent.ts
CHANGED
|
@@ -355,7 +355,6 @@ export class WebDriverAgent {
|
|
|
355
355
|
this.log.info('Shutting down sub-processes');
|
|
356
356
|
if (this._xcodebuild) {
|
|
357
357
|
await this.xcodebuild.quit();
|
|
358
|
-
await this.xcodebuild.reset();
|
|
359
358
|
}
|
|
360
359
|
} else {
|
|
361
360
|
this.log.debug('Do not stop xcodebuild nor XCTest session ' +
|
package/lib/xcodebuild.ts
CHANGED
|
@@ -6,8 +6,7 @@ import { log as defaultLogger } from './logger';
|
|
|
6
6
|
import B from 'bluebird';
|
|
7
7
|
import {
|
|
8
8
|
setRealDeviceSecurity, setXctestrunFile,
|
|
9
|
-
|
|
10
|
-
getWDAUpgradeTimestamp, isTvOS
|
|
9
|
+
killProcess, getWDAUpgradeTimestamp, isTvOS
|
|
11
10
|
} from './utils';
|
|
12
11
|
import _ from 'lodash';
|
|
13
12
|
import path from 'path';
|
|
@@ -135,7 +134,7 @@ export class XcodeBuild {
|
|
|
135
134
|
|
|
136
135
|
/**
|
|
137
136
|
* Initializes the XcodeBuild instance with a no-session proxy.
|
|
138
|
-
* Sets up xctestrun file if needed
|
|
137
|
+
* Sets up xctestrun file if needed.
|
|
139
138
|
* @param noSessionProxy - The proxy instance for WDA communication
|
|
140
139
|
*/
|
|
141
140
|
async init (noSessionProxy: NoSessionProxy): Promise<void> {
|
|
@@ -157,19 +156,6 @@ export class XcodeBuild {
|
|
|
157
156
|
});
|
|
158
157
|
return;
|
|
159
158
|
}
|
|
160
|
-
|
|
161
|
-
// if necessary, update the bundleId to user's specification
|
|
162
|
-
if (this.realDevice) {
|
|
163
|
-
// In case the project still has the user specific bundle ID, reset the project file first.
|
|
164
|
-
// - We do this reset even if updatedWDABundleId is not specified,
|
|
165
|
-
// since the previous updatedWDABundleId test has generated the user specific bundle ID project file.
|
|
166
|
-
// - We don't call resetProjectFile for simulator,
|
|
167
|
-
// since simulator test run will work with any user specific bundle ID.
|
|
168
|
-
await resetProjectFile(this.agentPath);
|
|
169
|
-
if (this.updatedWDABundleId) {
|
|
170
|
-
await updateProjectFile(this.agentPath, this.updatedWDABundleId);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
159
|
}
|
|
174
160
|
|
|
175
161
|
/**
|
|
@@ -211,17 +197,6 @@ export class XcodeBuild {
|
|
|
211
197
|
return await this._derivedDataPathPromise;
|
|
212
198
|
}
|
|
213
199
|
|
|
214
|
-
/**
|
|
215
|
-
* Resets the project file to its original state.
|
|
216
|
-
* Restores the bundle ID to the original value for real devices if it was modified.
|
|
217
|
-
*/
|
|
218
|
-
async reset (): Promise<void> {
|
|
219
|
-
// if necessary, reset the bundleId to original value
|
|
220
|
-
if (this.realDevice && this.updatedWDABundleId) {
|
|
221
|
-
await resetProjectFile(this.agentPath);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
200
|
/**
|
|
226
201
|
* Pre-builds WebDriverAgent before launching tests.
|
|
227
202
|
* Performs a build-only operation and sets usePrebuiltWDA flag.
|
|
@@ -360,7 +335,7 @@ export class XcodeBuild {
|
|
|
360
335
|
}
|
|
361
336
|
args.push('-destination', `id=${this.device.udid}`);
|
|
362
337
|
|
|
363
|
-
let versionMatch;
|
|
338
|
+
let versionMatch: RegExpMatchArray | null = null;
|
|
364
339
|
if (this.platformVersion && (versionMatch = new RegExp(/^(\d+)\.(\d+)/).exec(this.platformVersion))) {
|
|
365
340
|
args.push(
|
|
366
341
|
`${isTvOS(this.platformName || '') ? 'TV' : 'IPHONE'}OS_DEPLOYMENT_TARGET=${versionMatch[1]}.${versionMatch[2]}`
|
|
@@ -383,6 +358,9 @@ export class XcodeBuild {
|
|
|
383
358
|
`CODE_SIGN_IDENTITY=${this.xcodeSigningId}`,
|
|
384
359
|
);
|
|
385
360
|
}
|
|
361
|
+
if (this.updatedWDABundleId) {
|
|
362
|
+
args.push(`PRODUCT_BUNDLE_IDENTIFIER=${this.updatedWDABundleId}`);
|
|
363
|
+
}
|
|
386
364
|
}
|
|
387
365
|
|
|
388
366
|
if (!process.env.APPIUM_XCUITEST_TREAT_WARNINGS_AS_ERRORS) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-webdriveragent",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.2",
|
|
4
4
|
"description": "Package bundling WebDriverAgent",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"WebDriverAgentRunner",
|
|
97
97
|
"WebDriverAgentTests",
|
|
98
98
|
"XCTWebDriverAgentLib",
|
|
99
|
-
"CHANGELOG.md"
|
|
99
|
+
"CHANGELOG.md",
|
|
100
|
+
"!build/test"
|
|
100
101
|
]
|
|
101
102
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"desired.d.ts","sourceRoot":"","sources":["../../../test/functional/desired.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,EAAE,MACU,CAAC;AAC1C,eAAO,MAAM,WAAW,EAAE,MAC2D,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEVICE_NAME = exports.PLATFORM_VERSION = void 0;
|
|
4
|
-
const support_1 = require("@appium/support");
|
|
5
|
-
exports.PLATFORM_VERSION = process.env.PLATFORM_VERSION
|
|
6
|
-
? process.env.PLATFORM_VERSION : '11.3';
|
|
7
|
-
exports.DEVICE_NAME = process.env.DEVICE_NAME
|
|
8
|
-
|| (support_1.util.compareVersions(exports.PLATFORM_VERSION, '>=', '13.0') ? 'iPhone X' : 'iPhone 6');
|
|
9
|
-
//# sourceMappingURL=desired.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"desired.js","sourceRoot":"","sources":["../../../test/functional/desired.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAE1B,QAAA,gBAAgB,GAAW,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAClE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7B,QAAA,WAAW,GAAW,OAAO,CAAC,GAAG,CAAC,WAAW;OACrD,CAAC,cAAI,CAAC,eAAe,CAAC,wBAAgB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AppleDevice } from '../../../lib/types';
|
|
2
|
-
export declare function killAllSimulators(): Promise<void>;
|
|
3
|
-
export declare function shutdownSimulator(device: AppleDevice): Promise<void>;
|
|
4
|
-
export declare function deleteDeviceWithRetry(udid: string): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=simulator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../../../test/functional/helpers/simulator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,wBAAsB,iBAAiB,IAAK,OAAO,CAAC,IAAI,CAAC,CAaxD;AAED,wBAAsB,iBAAiB,CAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3E;AAED,wBAAsB,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.killAllSimulators = killAllSimulators;
|
|
7
|
-
exports.shutdownSimulator = shutdownSimulator;
|
|
8
|
-
exports.deleteDeviceWithRetry = deleteDeviceWithRetry;
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
const node_simctl_1 = require("node-simctl");
|
|
11
|
-
const asyncbox_1 = require("asyncbox");
|
|
12
|
-
const appium_ios_simulator_1 = require("appium-ios-simulator");
|
|
13
|
-
const utils_1 = require("../../../lib/utils");
|
|
14
|
-
async function killAllSimulators() {
|
|
15
|
-
const simctl = new node_simctl_1.Simctl();
|
|
16
|
-
const allDevices = lodash_1.default.flatMap(lodash_1.default.values(await simctl.getDevices()));
|
|
17
|
-
const bootedDevices = allDevices.filter((device) => device.state === 'Booted');
|
|
18
|
-
for (const { udid } of bootedDevices) {
|
|
19
|
-
// It is necessary to stop the corresponding xcodebuild process before killing
|
|
20
|
-
// the simulator, otherwise it will be automatically restarted
|
|
21
|
-
await (0, utils_1.resetTestProcesses)(udid, true);
|
|
22
|
-
simctl.udid = udid;
|
|
23
|
-
await simctl.shutdownDevice();
|
|
24
|
-
}
|
|
25
|
-
await (0, appium_ios_simulator_1.killAllSimulators)();
|
|
26
|
-
}
|
|
27
|
-
async function shutdownSimulator(device) {
|
|
28
|
-
// stop XCTest processes if running to avoid unexpected side effects
|
|
29
|
-
await (0, utils_1.resetTestProcesses)(device.udid, true);
|
|
30
|
-
await device.shutdown();
|
|
31
|
-
}
|
|
32
|
-
async function deleteDeviceWithRetry(udid) {
|
|
33
|
-
const simctl = new node_simctl_1.Simctl({ udid });
|
|
34
|
-
try {
|
|
35
|
-
await (0, asyncbox_1.retryInterval)(10, 1000, simctl.deleteDevice.bind(simctl));
|
|
36
|
-
}
|
|
37
|
-
catch { }
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=simulator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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AC,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webdriveragent-e2e-specs.d.ts","sourceRoot":"","sources":["../../../test/functional/webdriveragent-e2e-specs.ts"],"names":[],"mappings":""}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const chai_1 = __importStar(require("chai"));
|
|
40
|
-
const chai_as_promised_1 = __importDefault(require("chai-as-promised"));
|
|
41
|
-
const node_simctl_1 = require("node-simctl");
|
|
42
|
-
const appium_ios_simulator_1 = require("appium-ios-simulator");
|
|
43
|
-
const simulator_1 = require("./helpers/simulator");
|
|
44
|
-
const teen_process_1 = require("teen_process");
|
|
45
|
-
const desired_1 = require("./desired");
|
|
46
|
-
const asyncbox_1 = require("asyncbox");
|
|
47
|
-
const webdriveragent_1 = require("../../lib/webdriveragent");
|
|
48
|
-
const axios_1 = __importDefault(require("axios"));
|
|
49
|
-
chai_1.default.use(chai_as_promised_1.default);
|
|
50
|
-
const MOCHA_TIMEOUT_MS = 60 * 1000 * 5;
|
|
51
|
-
const SIM_DEVICE_NAME = 'webDriverAgentTest';
|
|
52
|
-
const SIM_STARTUP_TIMEOUT_MS = MOCHA_TIMEOUT_MS;
|
|
53
|
-
const testUrl = 'http://localhost:8100/tree';
|
|
54
|
-
function getStartOpts(device) {
|
|
55
|
-
return {
|
|
56
|
-
device,
|
|
57
|
-
platformVersion: desired_1.PLATFORM_VERSION,
|
|
58
|
-
host: 'localhost',
|
|
59
|
-
port: 8100,
|
|
60
|
-
realDevice: false,
|
|
61
|
-
showXcodeLog: true,
|
|
62
|
-
wdaLaunchTimeout: 60 * 3 * 1000,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
describe('WebDriverAgent', function () {
|
|
66
|
-
this.timeout(MOCHA_TIMEOUT_MS);
|
|
67
|
-
describe('with fresh sim', function () {
|
|
68
|
-
let device;
|
|
69
|
-
let simctl;
|
|
70
|
-
before(async function () {
|
|
71
|
-
simctl = new node_simctl_1.Simctl();
|
|
72
|
-
simctl.udid = await simctl.createDevice(SIM_DEVICE_NAME, desired_1.DEVICE_NAME, desired_1.PLATFORM_VERSION);
|
|
73
|
-
device = await (0, appium_ios_simulator_1.getSimulator)(simctl.udid);
|
|
74
|
-
// Prebuild WDA
|
|
75
|
-
const wda = new webdriveragent_1.WebDriverAgent({
|
|
76
|
-
iosSdkVersion: desired_1.PLATFORM_VERSION,
|
|
77
|
-
platformVersion: desired_1.PLATFORM_VERSION,
|
|
78
|
-
showXcodeLog: true,
|
|
79
|
-
device,
|
|
80
|
-
});
|
|
81
|
-
if (wda.xcodebuild) {
|
|
82
|
-
await wda.xcodebuild.start(true);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
after(async function () {
|
|
86
|
-
this.timeout(MOCHA_TIMEOUT_MS);
|
|
87
|
-
await (0, simulator_1.shutdownSimulator)(device);
|
|
88
|
-
await simctl.deleteDevice();
|
|
89
|
-
});
|
|
90
|
-
describe('with running sim', function () {
|
|
91
|
-
this.timeout(6 * 60 * 1000);
|
|
92
|
-
beforeEach(async function () {
|
|
93
|
-
await (0, simulator_1.killAllSimulators)();
|
|
94
|
-
await device.run({ startupTimeout: SIM_STARTUP_TIMEOUT_MS });
|
|
95
|
-
});
|
|
96
|
-
afterEach(async function () {
|
|
97
|
-
try {
|
|
98
|
-
await (0, asyncbox_1.retryInterval)(5, 1000, async function () {
|
|
99
|
-
await (0, simulator_1.shutdownSimulator)(device);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
catch { }
|
|
103
|
-
});
|
|
104
|
-
it('should launch agent on a sim', async function () {
|
|
105
|
-
const agent = new webdriveragent_1.WebDriverAgent(getStartOpts(device));
|
|
106
|
-
await agent.launch('sessionId');
|
|
107
|
-
await (0, chai_1.expect)((0, axios_1.default)({ url: testUrl })).to.be.rejected;
|
|
108
|
-
await agent.quit();
|
|
109
|
-
});
|
|
110
|
-
it('should fail if xcodebuild fails', async function () {
|
|
111
|
-
// short timeout
|
|
112
|
-
this.timeout(35 * 1000);
|
|
113
|
-
const agent = new webdriveragent_1.WebDriverAgent(getStartOpts(device));
|
|
114
|
-
agent.xcodebuild.createSubProcess = async function () {
|
|
115
|
-
const args = [
|
|
116
|
-
'-workspace',
|
|
117
|
-
`${this.agentPath}dfgs`,
|
|
118
|
-
// '-scheme',
|
|
119
|
-
// 'XCTUITestRunner',
|
|
120
|
-
// '-destination',
|
|
121
|
-
// `id=${this.device.udid}`,
|
|
122
|
-
// 'test'
|
|
123
|
-
];
|
|
124
|
-
return new teen_process_1.SubProcess('xcodebuild', args, { detached: true });
|
|
125
|
-
};
|
|
126
|
-
await (0, chai_1.expect)(agent.launch('sessionId'))
|
|
127
|
-
.to.be.rejectedWith('xcodebuild failed');
|
|
128
|
-
await agent.quit();
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
//# sourceMappingURL=webdriveragent-e2e-specs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webdriveragent-e2e-specs.js","sourceRoot":"","sources":["../../../test/functional/webdriveragent-e2e-specs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAoC;AACpC,wEAA8C;AAC9C,6CAAqC;AACrC,+DAAoD;AACpD,mDAA2E;AAC3E,+CAA0C;AAC1C,uCAA0D;AAC1D,uCAAyC;AACzC,6DAA0D;AAC1D,kDAA0B;AAG1B,cAAI,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AAEzB,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC;AAEvC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAC7C,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEhD,MAAM,OAAO,GAAG,4BAA4B,CAAC;AAE7C,SAAS,YAAY,CAAE,MAAmB;IACx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AAU,CAAC,YAAY,EAAE,IAAI,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;gBAC9D,CAAC,CAAC;gBAEF,MAAM,IAAA,aAAM,EAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;qBACpC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;gBAE3C,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-specs.d.ts","sourceRoot":"","sources":["../../../test/unit/utils-specs.ts"],"names":[],"mappings":""}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const chai_1 = __importStar(require("chai"));
|
|
40
|
-
const chai_as_promised_1 = __importDefault(require("chai-as-promised"));
|
|
41
|
-
const utils_1 = require("../../lib/utils");
|
|
42
|
-
const constants_1 = require("../../lib/constants");
|
|
43
|
-
const support_1 = require("@appium/support");
|
|
44
|
-
const path_1 = __importDefault(require("path"));
|
|
45
|
-
const assert_1 = require("assert");
|
|
46
|
-
const os_1 = require("os");
|
|
47
|
-
const sinon_1 = __importDefault(require("sinon"));
|
|
48
|
-
chai_1.default.use(chai_as_promised_1.default);
|
|
49
|
-
function get_arch() {
|
|
50
|
-
return (0, os_1.arch)() === 'arm64' ? 'arm64' : 'x86_64';
|
|
51
|
-
}
|
|
52
|
-
describe('utils', function () {
|
|
53
|
-
describe('#getXctestrunFilePath', function () {
|
|
54
|
-
const platformVersion = '12.0';
|
|
55
|
-
const sdkVersion = '12.2';
|
|
56
|
-
const udid = 'xxxxxyyyyyyzzzzzz';
|
|
57
|
-
const bootstrapPath = 'path/to/data';
|
|
58
|
-
const platformName = constants_1.PLATFORM_NAME_IOS;
|
|
59
|
-
let sandbox;
|
|
60
|
-
beforeEach(function () {
|
|
61
|
-
sandbox = sinon_1.default.createSandbox();
|
|
62
|
-
});
|
|
63
|
-
afterEach(function () {
|
|
64
|
-
sandbox.restore();
|
|
65
|
-
});
|
|
66
|
-
it('should return sdk based path with udid', async function () {
|
|
67
|
-
sandbox.stub(support_1.fs, 'exists')
|
|
68
|
-
.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`))
|
|
69
|
-
.resolves(true);
|
|
70
|
-
sandbox.stub(support_1.fs, 'copyFile');
|
|
71
|
-
const deviceInfo = { isRealDevice: true, udid, platformVersion, platformName };
|
|
72
|
-
await (0, chai_1.expect)((0, utils_1.getXctestrunFilePath)(deviceInfo, sdkVersion, bootstrapPath))
|
|
73
|
-
.to.eventually.equal(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`));
|
|
74
|
-
sandbox.assert.notCalled(support_1.fs.copyFile);
|
|
75
|
-
});
|
|
76
|
-
it('should return sdk based path without udid, copy them', async function () {
|
|
77
|
-
const existsStub = sandbox.stub(support_1.fs, 'exists');
|
|
78
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`)).resolves(false);
|
|
79
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphoneos${sdkVersion}-arm64.xctestrun`)).resolves(true);
|
|
80
|
-
sandbox.stub(support_1.fs, 'copyFile')
|
|
81
|
-
.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphoneos${sdkVersion}-arm64.xctestrun`), path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`))
|
|
82
|
-
.resolves();
|
|
83
|
-
const deviceInfo = { isRealDevice: true, udid, platformVersion, platformName: constants_1.PLATFORM_NAME_IOS };
|
|
84
|
-
await (0, chai_1.expect)((0, utils_1.getXctestrunFilePath)(deviceInfo, sdkVersion, bootstrapPath))
|
|
85
|
-
.to.eventually.equal(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`));
|
|
86
|
-
});
|
|
87
|
-
it('should return platform based path', async function () {
|
|
88
|
-
const existsStub = sandbox.stub(support_1.fs, 'exists');
|
|
89
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`)).resolves(false);
|
|
90
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphonesimulator${sdkVersion}-${get_arch()}.xctestrun`)).resolves(false);
|
|
91
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${platformVersion}.xctestrun`)).resolves(true);
|
|
92
|
-
sandbox.stub(support_1.fs, 'copyFile');
|
|
93
|
-
const deviceInfo = { isRealDevice: false, udid, platformVersion, platformName: constants_1.PLATFORM_NAME_IOS };
|
|
94
|
-
await (0, chai_1.expect)((0, utils_1.getXctestrunFilePath)(deviceInfo, sdkVersion, bootstrapPath))
|
|
95
|
-
.to.eventually.equal(path_1.default.resolve(`${bootstrapPath}/${udid}_${platformVersion}.xctestrun`));
|
|
96
|
-
sandbox.assert.notCalled(support_1.fs.copyFile);
|
|
97
|
-
});
|
|
98
|
-
it('should return platform based path without udid, copy them', async function () {
|
|
99
|
-
const existsStub = sandbox.stub(support_1.fs, 'exists');
|
|
100
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${sdkVersion}.xctestrun`)).resolves(false);
|
|
101
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphonesimulator${sdkVersion}-${get_arch()}.xctestrun`)).resolves(false);
|
|
102
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/${udid}_${platformVersion}.xctestrun`)).resolves(false);
|
|
103
|
-
existsStub.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphonesimulator${platformVersion}-${get_arch()}.xctestrun`)).resolves(true);
|
|
104
|
-
sandbox.stub(support_1.fs, 'copyFile')
|
|
105
|
-
.withArgs(path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphonesimulator${platformVersion}-${get_arch()}.xctestrun`), path_1.default.resolve(`${bootstrapPath}/${udid}_${platformVersion}.xctestrun`))
|
|
106
|
-
.resolves();
|
|
107
|
-
const deviceInfo = { isRealDevice: false, udid, platformVersion, platformName: constants_1.PLATFORM_NAME_IOS };
|
|
108
|
-
await (0, chai_1.expect)((0, utils_1.getXctestrunFilePath)(deviceInfo, sdkVersion, bootstrapPath))
|
|
109
|
-
.to.eventually.equal(path_1.default.resolve(`${bootstrapPath}/${udid}_${platformVersion}.xctestrun`));
|
|
110
|
-
});
|
|
111
|
-
it('should raise an exception because of no files', async function () {
|
|
112
|
-
const expected = path_1.default.resolve(`${bootstrapPath}/WebDriverAgentRunner_iphonesimulator${sdkVersion}-${get_arch()}.xctestrun`);
|
|
113
|
-
sandbox.stub(support_1.fs, 'exists').resolves(false);
|
|
114
|
-
const deviceInfo = { isRealDevice: false, udid, platformVersion, platformName: constants_1.PLATFORM_NAME_IOS };
|
|
115
|
-
try {
|
|
116
|
-
await (0, utils_1.getXctestrunFilePath)(deviceInfo, sdkVersion, bootstrapPath);
|
|
117
|
-
(0, assert_1.fail)();
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
(0, chai_1.expect)(err.message).to.equal(`If you are using 'useXctestrunFile' capability then you need to have a xctestrun file (expected: '${expected}')`);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
describe('#getAdditionalRunContent', function () {
|
|
125
|
-
it('should return ios format', function () {
|
|
126
|
-
const wdaPort = (0, utils_1.getAdditionalRunContent)(constants_1.PLATFORM_NAME_IOS, 8000);
|
|
127
|
-
(0, chai_1.expect)(wdaPort.WebDriverAgentRunner
|
|
128
|
-
.EnvironmentVariables.USE_PORT).to.equal('8000');
|
|
129
|
-
});
|
|
130
|
-
it('should return tvos format', function () {
|
|
131
|
-
const wdaPort = (0, utils_1.getAdditionalRunContent)(constants_1.PLATFORM_NAME_TVOS, '9000');
|
|
132
|
-
(0, chai_1.expect)(wdaPort.WebDriverAgentRunner_tvOS
|
|
133
|
-
.EnvironmentVariables.USE_PORT).to.equal('9000');
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
describe('#getXctestrunFileName', function () {
|
|
137
|
-
const platformVersion = '12.0';
|
|
138
|
-
const udid = 'xxxxxyyyyyyzzzzzz';
|
|
139
|
-
it('should return ios format, real device', function () {
|
|
140
|
-
const platformName = 'iOs';
|
|
141
|
-
const deviceInfo = { isRealDevice: true, udid, platformVersion, platformName };
|
|
142
|
-
(0, chai_1.expect)((0, utils_1.getXctestrunFileName)(deviceInfo, '10.2.0')).to.equal('WebDriverAgentRunner_iphoneos10.2.0-arm64.xctestrun');
|
|
143
|
-
});
|
|
144
|
-
it('should return ios format, simulator', function () {
|
|
145
|
-
const platformName = 'ios';
|
|
146
|
-
const deviceInfo = { isRealDevice: false, udid, platformVersion, platformName };
|
|
147
|
-
(0, chai_1.expect)((0, utils_1.getXctestrunFileName)(deviceInfo, '10.2.0')).to.equal(`WebDriverAgentRunner_iphonesimulator10.2.0-${get_arch()}.xctestrun`);
|
|
148
|
-
});
|
|
149
|
-
it('should return tvos format, real device', function () {
|
|
150
|
-
const platformName = 'tVos';
|
|
151
|
-
const deviceInfo = { isRealDevice: true, udid, platformVersion, platformName };
|
|
152
|
-
(0, chai_1.expect)((0, utils_1.getXctestrunFileName)(deviceInfo, '10.2.0')).to.equal('WebDriverAgentRunner_tvOS_appletvos10.2.0-arm64.xctestrun');
|
|
153
|
-
});
|
|
154
|
-
it('should return tvos format, simulator', function () {
|
|
155
|
-
const platformName = 'tvOS';
|
|
156
|
-
const deviceInfo = { isRealDevice: false, udid, platformVersion, platformName };
|
|
157
|
-
(0, chai_1.expect)((0, utils_1.getXctestrunFileName)(deviceInfo, '10.2.0')).to.equal(`WebDriverAgentRunner_tvOS_appletvsimulator10.2.0-${get_arch()}.xctestrun`);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
//# sourceMappingURL=utils-specs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-specs.js","sourceRoot":"","sources":["../../../test/unit/utils-specs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAoC;AACpC,wEAA8C;AAC9C,2CAAsG;AACtG,mDAA4E;AAC5E,6CAAqC;AACrC,gDAAwB;AACxB,mCAA8B;AAC9B,2BAA0B;AAC1B,kDAA0B;AAG1B,cAAI,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AAEzB,SAAS,QAAQ;IACf,OAAO,IAAA,SAAI,GAAE,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjD,CAAC;AAED,QAAQ,CAAC,OAAO,EAAE;IAEhB,QAAQ,CAAC,uBAAuB,EAAE;QAChC,MAAM,eAAe,GAAG,MAAM,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,CAAC;QAC1B,MAAM,IAAI,GAAG,mBAAmB,CAAC;QACjC,MAAM,aAAa,GAAG,cAAc,CAAC;QACrC,MAAM,YAAY,GAAG,6BAAiB,CAAC;QACvC,IAAI,OAA2B,CAAC;QAEhC,UAAU,CAAC;YACT,OAAO,GAAG,eAAK,CAAC,aAAa,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC;YACR,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK;YAChD,OAAO,CAAC,IAAI,CAAC,YAAE,EAAE,QAAQ,CAAC;iBACvB,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,aAAa,IAAI,IAAI,IAAI,UAAU,YAAY,CAAC,CAAC;iBAC1E,QAAQ,CAAC,IAAI,CAAC,CAAC;Y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