@mobilewright/test 0.0.57 → 0.0.59
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 +9 -4
- package/dist/expect-soft.test.d.ts +2 -0
- package/dist/expect-soft.test.d.ts.map +1 -0
- package/dist/expect-soft.test.js +32 -0
- package/dist/expect-soft.test.js.map +1 -0
- package/dist/fixture-helpers.d.ts +46 -0
- package/dist/fixture-helpers.d.ts.map +1 -0
- package/dist/fixture-helpers.js +82 -0
- package/dist/fixture-helpers.js.map +1 -0
- package/dist/fixture-helpers.test.d.ts +2 -0
- package/dist/fixture-helpers.test.d.ts.map +1 -0
- package/dist/fixture-helpers.test.js +135 -0
- package/dist/fixture-helpers.test.js.map +1 -0
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/fixtures.js +77 -109
- package/dist/fixtures.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ await device.close();
|
|
|
74
74
|
|
|
75
75
|
## Prerequisites
|
|
76
76
|
|
|
77
|
-
- Node.js >=
|
|
77
|
+
- Node.js >= 22.12
|
|
78
78
|
- A booted iOS simulator, Android emulator, or connected real device
|
|
79
79
|
|
|
80
80
|
Run `mobilewright doctor` to verify your environment is ready:
|
|
@@ -323,6 +323,10 @@ await expect(locator).toHaveValue(/@example\.com$/);
|
|
|
323
323
|
await expect(locator).toHaveCount(3); // number of matching elements
|
|
324
324
|
|
|
325
325
|
await expect(locator).toBeVisible({ timeout: 10_000 });
|
|
326
|
+
|
|
327
|
+
// Soft assertions record the failure but let the test keep running (Playwright semantics)
|
|
328
|
+
await expect.soft(locator).toHaveText('Success');
|
|
329
|
+
await expect.soft(locator, 'eta should be shown').not.toBeEmpty();
|
|
326
330
|
```
|
|
327
331
|
|
|
328
332
|
### Role Mapping
|
|
@@ -402,7 +406,8 @@ The `use` object holds per-action defaults shared by every test:
|
|
|
402
406
|
| `animations` | `'on' \| 'off'` | Toggle system animations on the device; left unchanged if omitted |
|
|
403
407
|
| `actionTimeout` | `number` | Default timeout for locator actions (tap, fill, …) in ms. Default: `5000` |
|
|
404
408
|
| `appLaunchTimeout` | `number` | Timeout waiting for the app to reach foreground after launch, in ms. Default: `20000` |
|
|
405
|
-
| `installTimeout` | `number` | Timeout for app installation in ms
|
|
409
|
+
| `installTimeout` | `number` | Timeout for app installation in ms. Default: `60000` |
|
|
410
|
+
| `allocationTimeout` | `number` | Timeout waiting for a device (queue + cloud provisioning), on its own clock. Default: `900000` (15 min) |
|
|
406
411
|
|
|
407
412
|
The `expect` object sets assertion defaults:
|
|
408
413
|
|
|
@@ -567,13 +572,13 @@ Mobile Next Cloud is the only device cloud with native Mobilewright support.
|
|
|
567
572
|
|
|
568
573
|
## Telemetry
|
|
569
574
|
|
|
570
|
-
Mobilewright collects anonymous usage telemetry via PostHog. To disable it, set the `MOBILEWRIGHT_DISABLE_TELEMETRY` environment variable:
|
|
575
|
+
Mobilewright collects anonymous usage telemetry via PostHog and Scarf. To disable it, set the `MOBILEWRIGHT_DISABLE_TELEMETRY` environment variable:
|
|
571
576
|
|
|
572
577
|
```bash
|
|
573
578
|
MOBILEWRIGHT_DISABLE_TELEMETRY=1 npx mobilewright test
|
|
574
579
|
```
|
|
575
580
|
|
|
576
|
-
When telemetry is enabled, a random identifier is generated and stored in `~/.config/mobilenext/mobilewright/config.json`.
|
|
581
|
+
When telemetry is enabled, a random identifier is generated and stored in `~/.config/mobilenext/mobilewright/config.json`. Mobilewright never sends personal information or test data. The Scarf pixel is a plain HTTP request, so Scarf receives the usual request metadata (source IP, user agent); Scarf states it does not retain raw IP addresses. Set `MOBILEWRIGHT_DISABLE_TELEMETRY` to opt out of both.
|
|
577
582
|
|
|
578
583
|
## Contributing
|
|
579
584
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-soft.test.d.ts","sourceRoot":"","sources":["../src/expect-soft.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { test, expect } from './fixtures.js';
|
|
2
|
+
// A soft failure marks the test failed, so each test undoes that once it has
|
|
3
|
+
// inspected what the runner recorded.
|
|
4
|
+
function takeRecordedErrors() {
|
|
5
|
+
const info = test.info();
|
|
6
|
+
const errors = [...info.errors];
|
|
7
|
+
info.errors.length = 0;
|
|
8
|
+
info.status = 'passed';
|
|
9
|
+
return errors;
|
|
10
|
+
}
|
|
11
|
+
test.describe('expect.soft with the Playwright runner', () => {
|
|
12
|
+
test('records the failure on the test and keeps running', async () => {
|
|
13
|
+
expect.soft(1).toBe(2);
|
|
14
|
+
const reachedNextLine = true;
|
|
15
|
+
const errors = takeRecordedErrors();
|
|
16
|
+
expect(reachedNextLine).toBe(true);
|
|
17
|
+
expect(errors).toHaveLength(1);
|
|
18
|
+
expect(errors[0].message).toContain('Expected 2, but received 1');
|
|
19
|
+
});
|
|
20
|
+
test('collects every soft failure, not just the first', async () => {
|
|
21
|
+
expect.soft(1).toBe(2);
|
|
22
|
+
expect.soft('a', 'letters must match').toBe('b');
|
|
23
|
+
const errors = takeRecordedErrors();
|
|
24
|
+
expect(errors).toHaveLength(2);
|
|
25
|
+
expect(errors[1].message).toContain('letters must match');
|
|
26
|
+
});
|
|
27
|
+
test('records nothing when the soft assertion passes', async () => {
|
|
28
|
+
expect.soft(1).toBe(1);
|
|
29
|
+
expect(takeRecordedErrors()).toHaveLength(0);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=expect-soft.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-soft.test.js","sourceRoot":"","sources":["../src/expect-soft.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7C,6EAA6E;AAC7E,sCAAsC;AACtC,SAAS,kBAAkB;IACzB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,MAAM,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,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PlaywrightWorkerOptions } from '@playwright/test';
|
|
2
|
+
import type { AllocatedDevice, Platform } from '@mobilewright/protocol';
|
|
3
|
+
import { type MobilewrightConfig } from 'mobilewright';
|
|
4
|
+
type VideoOption = PlaywrightWorkerOptions['video'] | undefined;
|
|
5
|
+
type ProjectName = string;
|
|
6
|
+
type DeviceOptions = {
|
|
7
|
+
platform?: Platform;
|
|
8
|
+
deviceId?: string;
|
|
9
|
+
deviceName?: RegExp;
|
|
10
|
+
deviceType?: 'simulator' | 'emulator' | 'real';
|
|
11
|
+
osVersion?: string;
|
|
12
|
+
installApps?: string | string[];
|
|
13
|
+
};
|
|
14
|
+
type Annotation = {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
type VideoPlan = {
|
|
19
|
+
shouldRecord: boolean;
|
|
20
|
+
path: string;
|
|
21
|
+
shouldAttach(failed: boolean): boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function assertValidZipFile(path: string): void;
|
|
24
|
+
/** Fixture options (set via `test.use`) win over config; `use` is merged from the active project. */
|
|
25
|
+
export declare function mergeDeviceConfig(config: MobilewrightConfig, options: DeviceOptions, projectName: ProjectName): MobilewrightConfig;
|
|
26
|
+
export declare function assertSupportedPlatform(platform: string | undefined): Platform;
|
|
27
|
+
export declare function annotationsForDevice(handle: AllocatedDevice): Annotation[];
|
|
28
|
+
export declare function connectOptionsFor(handle: AllocatedDevice, merged: MobilewrightConfig): {
|
|
29
|
+
platform: Platform;
|
|
30
|
+
deviceId: string;
|
|
31
|
+
deviceType: import("@mobilewright/protocol").DeviceType | undefined;
|
|
32
|
+
driver: import("mobilewright").MobilewrightDriver | undefined;
|
|
33
|
+
timeout: number | undefined;
|
|
34
|
+
actionTimeout: number | undefined;
|
|
35
|
+
expectTimeout: number | undefined;
|
|
36
|
+
appLaunchTimeout: number | undefined;
|
|
37
|
+
installTimeout: number;
|
|
38
|
+
deviceSettings: {
|
|
39
|
+
animations: "off" | "on" | undefined;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare function allocationTimeoutFor(merged: MobilewrightConfig): number;
|
|
43
|
+
export declare function videoPlan(video: VideoOption, outputDir: string, testId: string): VideoPlan;
|
|
44
|
+
export declare function parseViewTreeOption(value: string | undefined): 'on-failure' | 'off';
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=fixture-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-helpers.d.ts","sourceRoot":"","sources":["../src/fixture-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAuD,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5G,KAAK,WAAW,GAAG,uBAAuB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;AAChE,KAAK,WAAW,GAAG,MAAM,CAAC;AAC1B,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACjC,CAAC;AACF,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AACxD,KAAK,SAAS,GAAG;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,CAAC;AAIjG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAWrD;AAED,qGAAqG;AACrG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,GAAG,kBAAkB,CAYlI;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAK9E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,EAAE,CAW1E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB;;;;;;;;;;;;;EAapF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAEvE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAQ1F;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,CAMnF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { openSync, readSync, closeSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { DEFAULT_INSTALL_TIMEOUT, DEFAULT_ALLOCATION_TIMEOUT } from 'mobilewright';
|
|
4
|
+
const ZIP_MAGIC = Buffer.from([0x50, 0x4b, 0x03, 0x04]);
|
|
5
|
+
export function assertValidZipFile(path) {
|
|
6
|
+
const buf = Buffer.alloc(4);
|
|
7
|
+
const fd = openSync(path, 'r');
|
|
8
|
+
try {
|
|
9
|
+
readSync(fd, buf, { offset: 0, length: 4, position: 0 });
|
|
10
|
+
}
|
|
11
|
+
finally {
|
|
12
|
+
closeSync(fd);
|
|
13
|
+
}
|
|
14
|
+
if (!buf.equals(ZIP_MAGIC)) {
|
|
15
|
+
throw new Error(`"${path}" is not a valid ZIP file`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Fixture options (set via `test.use`) win over config; `use` is merged from the active project. */
|
|
19
|
+
export function mergeDeviceConfig(config, options, projectName) {
|
|
20
|
+
const project = config.projects?.find(p => p.name === projectName);
|
|
21
|
+
return {
|
|
22
|
+
...config,
|
|
23
|
+
...(options.platform && { platform: options.platform }),
|
|
24
|
+
...(options.deviceId !== undefined && { deviceId: options.deviceId }),
|
|
25
|
+
...(options.deviceName && { deviceName: options.deviceName }),
|
|
26
|
+
...(options.deviceType && { deviceType: options.deviceType }),
|
|
27
|
+
...(options.osVersion && { osVersion: options.osVersion }),
|
|
28
|
+
...(options.installApps !== undefined && { installApps: options.installApps }),
|
|
29
|
+
use: { ...config.use, ...project?.use },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function assertSupportedPlatform(platform) {
|
|
33
|
+
if (platform !== 'ios' && platform !== 'android') {
|
|
34
|
+
throw new Error(`Unsupported platform: "${platform}". Must be "ios" or "android".`);
|
|
35
|
+
}
|
|
36
|
+
return platform;
|
|
37
|
+
}
|
|
38
|
+
export function annotationsForDevice(handle) {
|
|
39
|
+
const optional = (type, description) => description ? [{ type, description }] : [];
|
|
40
|
+
return [
|
|
41
|
+
...optional('device.type', handle.type),
|
|
42
|
+
{ type: 'device.platform', description: handle.platform },
|
|
43
|
+
...optional('device.osVersion', handle.osVersion),
|
|
44
|
+
...optional('device.model', handle.model),
|
|
45
|
+
...optional('device.driver', handle.driver),
|
|
46
|
+
{ type: 'device.id', description: handle.deviceId },
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
export function connectOptionsFor(handle, merged) {
|
|
50
|
+
return {
|
|
51
|
+
platform: handle.platform,
|
|
52
|
+
deviceId: handle.deviceId,
|
|
53
|
+
deviceType: handle.type,
|
|
54
|
+
driver: merged.driver,
|
|
55
|
+
timeout: merged.timeout,
|
|
56
|
+
actionTimeout: merged.use?.actionTimeout,
|
|
57
|
+
expectTimeout: merged.expect?.timeout,
|
|
58
|
+
appLaunchTimeout: merged.use?.appLaunchTimeout,
|
|
59
|
+
installTimeout: merged.use?.installTimeout ?? DEFAULT_INSTALL_TIMEOUT,
|
|
60
|
+
deviceSettings: { animations: merged.use?.animations },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function allocationTimeoutFor(merged) {
|
|
64
|
+
return merged.use?.allocationTimeout ?? DEFAULT_ALLOCATION_TIMEOUT;
|
|
65
|
+
}
|
|
66
|
+
export function videoPlan(video, outputDir, testId) {
|
|
67
|
+
const mode = typeof video === 'object' ? video.mode : video;
|
|
68
|
+
const shouldRecord = mode === 'on' || mode === 'retain-on-failure';
|
|
69
|
+
return {
|
|
70
|
+
shouldRecord,
|
|
71
|
+
path: shouldRecord ? join(outputDir, `video-${testId}.mp4`) : '',
|
|
72
|
+
shouldAttach: (failed) => mode === 'on' || (mode === 'retain-on-failure' && failed),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function parseViewTreeOption(value) {
|
|
76
|
+
const resolved = value ?? 'off';
|
|
77
|
+
if (resolved !== 'on-failure' && resolved !== 'off') {
|
|
78
|
+
throw new Error(`Invalid viewTree value: "${resolved}". Must be "on-failure" or "off".`);
|
|
79
|
+
}
|
|
80
|
+
return resolved;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=fixture-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-helpers.js","sourceRoot":"","sources":["../src/fixture-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM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I,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,mBAAmB,IAAI,MAAM,CAAC;KACpF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAyB;IAC3D,MAAM,QAAQ,GAAG,KAAK,IAAI,KAAK,CAAC;IAChC,IAAI,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,mCAAmC,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-helpers.test.d.ts","sourceRoot":"","sources":["../src/fixture-helpers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
import { writeFileSync, mkdtempSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { assertValidZipFile, mergeDeviceConfig, assertSupportedPlatform, annotationsForDevice, connectOptionsFor, allocationTimeoutFor, videoPlan, parseViewTreeOption, } from './fixture-helpers.js';
|
|
6
|
+
function writeTempFile(name, bytes) {
|
|
7
|
+
const path = join(mkdtempSync(join(tmpdir(), 'mw-fixture-')), name);
|
|
8
|
+
writeFileSync(path, bytes);
|
|
9
|
+
return path;
|
|
10
|
+
}
|
|
11
|
+
test.describe('assertValidZipFile', () => {
|
|
12
|
+
test('accepts a file starting with the ZIP magic bytes', () => {
|
|
13
|
+
const path = writeTempFile('app.apk', Buffer.from([0x50, 0x4b, 0x03, 0x04, 0, 0]));
|
|
14
|
+
expect(() => assertValidZipFile(path)).not.toThrow();
|
|
15
|
+
});
|
|
16
|
+
test('rejects a file that is not a ZIP and names the path', () => {
|
|
17
|
+
const path = writeTempFile('app.apk', Buffer.from('not a zip at all'));
|
|
18
|
+
expect(() => assertValidZipFile(path)).toThrow(`"${path}" is not a valid ZIP file`);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
test.describe('mergeDeviceConfig', () => {
|
|
22
|
+
const config = { platform: 'ios', deviceId: 'cfg-device', use: { actionTimeout: 1 }, projects: [{ name: 'android', use: { actionTimeout: 2 } }] };
|
|
23
|
+
test('fixture options override config values', () => {
|
|
24
|
+
const merged = mergeDeviceConfig(config, { platform: 'android', deviceId: 'opt-device' }, 'ios');
|
|
25
|
+
expect(merged.platform).toBe('android');
|
|
26
|
+
expect(merged.deviceId).toBe('opt-device');
|
|
27
|
+
});
|
|
28
|
+
test('undefined fixture options leave config values alone', () => {
|
|
29
|
+
const merged = mergeDeviceConfig(config, { platform: undefined, deviceId: undefined }, 'ios');
|
|
30
|
+
expect(merged.platform).toBe('ios');
|
|
31
|
+
expect(merged.deviceId).toBe('cfg-device');
|
|
32
|
+
});
|
|
33
|
+
test('an empty deviceId option still overrides the config deviceId', () => {
|
|
34
|
+
const merged = mergeDeviceConfig(config, { deviceId: '' }, 'ios');
|
|
35
|
+
expect(merged.deviceId).toBe('');
|
|
36
|
+
});
|
|
37
|
+
test('project use settings win over top-level use settings', () => {
|
|
38
|
+
const merged = mergeDeviceConfig(config, {}, 'android');
|
|
39
|
+
expect(merged.use?.actionTimeout).toBe(2);
|
|
40
|
+
});
|
|
41
|
+
test('an unknown project falls back to top-level use settings', () => {
|
|
42
|
+
const merged = mergeDeviceConfig(config, {}, 'nope');
|
|
43
|
+
expect(merged.use?.actionTimeout).toBe(1);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
test.describe('assertSupportedPlatform', () => {
|
|
47
|
+
test('accepts ios and android', () => {
|
|
48
|
+
expect(assertSupportedPlatform('ios')).toBe('ios');
|
|
49
|
+
expect(assertSupportedPlatform('android')).toBe('android');
|
|
50
|
+
});
|
|
51
|
+
test('rejects anything else, including a missing platform', () => {
|
|
52
|
+
expect(() => assertSupportedPlatform(undefined)).toThrow('Unsupported platform: "undefined"');
|
|
53
|
+
expect(() => assertSupportedPlatform('web')).toThrow('Must be "ios" or "android"');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
test.describe('annotationsForDevice', () => {
|
|
57
|
+
test('always records platform and id', () => {
|
|
58
|
+
expect(annotationsForDevice({ deviceId: 'd1', platform: 'ios' })).toEqual([
|
|
59
|
+
{ type: 'device.platform', description: 'ios' },
|
|
60
|
+
{ type: 'device.id', description: 'd1' },
|
|
61
|
+
]);
|
|
62
|
+
});
|
|
63
|
+
test('records every optional field when present, id last', () => {
|
|
64
|
+
const annotations = annotationsForDevice({
|
|
65
|
+
deviceId: 'd1', platform: 'android', type: 'emulator', osVersion: '14', model: 'Pixel', driver: 'mobilecli',
|
|
66
|
+
});
|
|
67
|
+
expect(annotations.map(a => a.type)).toEqual([
|
|
68
|
+
'device.type', 'device.platform', 'device.osVersion', 'device.model', 'device.driver', 'device.id',
|
|
69
|
+
]);
|
|
70
|
+
expect(annotations.find(a => a.type === 'device.model')?.description).toBe('Pixel');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
test.describe('connectOptionsFor', () => {
|
|
74
|
+
test('maps allocation handle and merged config onto connectDevice options', () => {
|
|
75
|
+
const options = connectOptionsFor({ deviceId: 'd1', platform: 'ios', type: 'simulator' }, { driver: 'drv', timeout: 5, use: { actionTimeout: 1, appLaunchTimeout: 2, installTimeout: 3, animations: 'off' }, expect: { timeout: 4 } });
|
|
76
|
+
expect(options).toEqual({
|
|
77
|
+
platform: 'ios',
|
|
78
|
+
deviceId: 'd1',
|
|
79
|
+
deviceType: 'simulator',
|
|
80
|
+
driver: 'drv',
|
|
81
|
+
timeout: 5,
|
|
82
|
+
actionTimeout: 1,
|
|
83
|
+
expectTimeout: 4,
|
|
84
|
+
appLaunchTimeout: 2,
|
|
85
|
+
installTimeout: 3,
|
|
86
|
+
deviceSettings: { animations: 'off' },
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
test.describe('timeout defaults', () => {
|
|
91
|
+
test('installTimeout defaults to 60s when not configured', () => {
|
|
92
|
+
const options = connectOptionsFor({ deviceId: 'd1', platform: 'ios' }, {});
|
|
93
|
+
expect(options.installTimeout).toBe(60_000);
|
|
94
|
+
});
|
|
95
|
+
test('allocationTimeout defaults to 15 min and honours use.allocationTimeout', () => {
|
|
96
|
+
expect(allocationTimeoutFor({})).toBe(15 * 60_000);
|
|
97
|
+
expect(allocationTimeoutFor({ use: { allocationTimeout: 1234 } })).toBe(1234);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
test.describe('videoPlan', () => {
|
|
101
|
+
const outputDir = '/out';
|
|
102
|
+
const testId = 'abc';
|
|
103
|
+
test('does not record when video is off or unset', () => {
|
|
104
|
+
expect(videoPlan('off', outputDir, testId).shouldRecord).toBe(false);
|
|
105
|
+
expect(videoPlan(undefined, outputDir, testId).shouldRecord).toBe(false);
|
|
106
|
+
});
|
|
107
|
+
test('records and always attaches when video is on', () => {
|
|
108
|
+
const plan = videoPlan('on', outputDir, testId);
|
|
109
|
+
expect(plan.shouldRecord).toBe(true);
|
|
110
|
+
expect(plan.path).toBe(join('/out', 'video-abc.mp4'));
|
|
111
|
+
expect(plan.shouldAttach(false)).toBe(true);
|
|
112
|
+
expect(plan.shouldAttach(true)).toBe(true);
|
|
113
|
+
});
|
|
114
|
+
test('records but only attaches on failure for retain-on-failure', () => {
|
|
115
|
+
const plan = videoPlan('retain-on-failure', outputDir, testId);
|
|
116
|
+
expect(plan.shouldRecord).toBe(true);
|
|
117
|
+
expect(plan.shouldAttach(false)).toBe(false);
|
|
118
|
+
expect(plan.shouldAttach(true)).toBe(true);
|
|
119
|
+
});
|
|
120
|
+
test('reads the mode from the object form', () => {
|
|
121
|
+
expect(videoPlan({ mode: 'on', size: { width: 1, height: 1 } }, outputDir, testId).shouldRecord).toBe(true);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
test.describe('parseViewTreeOption', () => {
|
|
125
|
+
test('defaults to off', () => {
|
|
126
|
+
expect(parseViewTreeOption(undefined)).toBe('off');
|
|
127
|
+
});
|
|
128
|
+
test('accepts on-failure', () => {
|
|
129
|
+
expect(parseViewTreeOption('on-failure')).toBe('on-failure');
|
|
130
|
+
});
|
|
131
|
+
test('rejects any other value', () => {
|
|
132
|
+
expect(() => parseViewTreeOption('always')).toThrow('Invalid viewTree value: "always"');
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
//# sourceMappingURL=fixture-helpers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-helpers.test.js","sourceRoot":"","sources":["../src/fixture-helpers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,SAAS,aAAa,CAAC,IAAY,EAAE,KAAa;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACpE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACvC,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC5D,MAAM,IAAI,GAAG,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,IA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I,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACnC,MAAM,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/fixtures.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAyB,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAmCzD,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;IACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,YAAY,GAAG,KAAK,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyBF,eAAO,MAAM,IAAI,mQAsIf,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/fixtures.js
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
import { test as base } from '@playwright/test';
|
|
2
|
-
import { createWriteStream
|
|
2
|
+
import { createWriteStream } from 'node:fs';
|
|
3
3
|
import { mkdir, unlink } from 'node:fs/promises';
|
|
4
4
|
import { pipeline } from 'node:stream/promises';
|
|
5
5
|
import { Readable } from 'node:stream';
|
|
6
|
-
import { join } from 'node:path';
|
|
7
6
|
import createDebug from 'debug';
|
|
8
7
|
import { createDevicePoolClient, connectDevice, loadConfig, toArray, } from 'mobilewright';
|
|
9
|
-
import { expect } from '@mobilewright/core';
|
|
8
|
+
import { expect, setSoftFailureHandler } from '@mobilewright/core';
|
|
9
|
+
import { assertValidZipFile, mergeDeviceConfig, assertSupportedPlatform, annotationsForDevice, connectOptionsFor, allocationTimeoutFor, videoPlan, parseViewTreeOption, } from './fixture-helpers.js';
|
|
10
10
|
const debug = createDebug('mw:test:fixtures');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
readSync(fd, buf, { offset: 0, length: 4, position: 0 });
|
|
17
|
-
}
|
|
18
|
-
finally {
|
|
19
|
-
closeSync(fd);
|
|
20
|
-
}
|
|
21
|
-
if (!buf.equals(ZIP_MAGIC)) {
|
|
22
|
-
throw new Error(`"${path}" is not a valid ZIP file`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
11
|
+
// expect.soft(): mark the test failed and record the error, but keep running.
|
|
12
|
+
setSoftFailureHandler((error) => {
|
|
13
|
+
base.info()._failWithError(error);
|
|
14
|
+
});
|
|
25
15
|
async function attachVideo(testInfo, url, localPath) {
|
|
26
16
|
if (url) {
|
|
27
17
|
const response = await fetch(url);
|
|
@@ -32,6 +22,22 @@ async function attachVideo(testInfo, url, localPath) {
|
|
|
32
22
|
}
|
|
33
23
|
await testInfo.attach('video', { path: localPath, contentType: 'video/mp4' });
|
|
34
24
|
}
|
|
25
|
+
async function allocateWithinTimeout(client, criteria, timeoutMs) {
|
|
26
|
+
const controller = new AbortController();
|
|
27
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
28
|
+
try {
|
|
29
|
+
return await client.allocate(criteria, controller.signal);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
if (controller.signal.aborted) {
|
|
33
|
+
throw new Error(`device allocation timed out after ${timeoutMs}ms (use.allocationTimeout)`);
|
|
34
|
+
}
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
35
41
|
let cachedClient;
|
|
36
42
|
function getClient() {
|
|
37
43
|
if (!cachedClient) {
|
|
@@ -56,102 +62,65 @@ export const test = base.extend({
|
|
|
56
62
|
installApps: [undefined, { option: true }],
|
|
57
63
|
viewTree: [async ({}, use, testInfo) => {
|
|
58
64
|
const config = await loadConfig(process.cwd(), testInfo.config.configFile);
|
|
59
|
-
|
|
60
|
-
if (value !== 'on-failure' && value !== 'off') {
|
|
61
|
-
throw new Error(`Invalid viewTree value: "${value}". Must be "on-failure" or "off".`);
|
|
62
|
-
}
|
|
63
|
-
await use(value);
|
|
65
|
+
await use(parseViewTreeOption(config.viewTree));
|
|
64
66
|
}, { option: true }],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
...(deviceId !== undefined && { deviceId }),
|
|
73
|
-
...(deviceName && { deviceName }),
|
|
74
|
-
...(deviceType && { deviceType }),
|
|
75
|
-
...(osVersion && { osVersion }),
|
|
76
|
-
...(installApps !== undefined && { installApps }),
|
|
77
|
-
use: projectUse,
|
|
78
|
-
};
|
|
79
|
-
if (merged.platform !== 'ios' && merged.platform !== 'android') {
|
|
80
|
-
throw new Error(`Unsupported platform: "${merged.platform}". Must be "ios" or "android".`);
|
|
81
|
-
}
|
|
82
|
-
for (const appPath of toArray(merged.installApps)) {
|
|
83
|
-
assertValidZipFile(appPath);
|
|
84
|
-
}
|
|
85
|
-
const client = getClient();
|
|
86
|
-
debug('allocating device (platform=%s)', merged.platform);
|
|
87
|
-
const handle = await client.allocate({
|
|
88
|
-
platform: merged.platform,
|
|
89
|
-
deviceNamePattern: merged.deviceName?.source,
|
|
90
|
-
deviceId: merged.deviceId,
|
|
91
|
-
deviceType: merged.deviceType,
|
|
92
|
-
osVersion: merged.osVersion,
|
|
93
|
-
});
|
|
94
|
-
debug('allocated device %s', handle.deviceId);
|
|
95
|
-
if (handle.type) {
|
|
96
|
-
testInfo.annotations.push({ type: 'device.type', description: handle.type });
|
|
97
|
-
}
|
|
98
|
-
testInfo.annotations.push({ type: 'device.platform', description: handle.platform });
|
|
99
|
-
if (handle.osVersion) {
|
|
100
|
-
testInfo.annotations.push({ type: 'device.osVersion', description: handle.osVersion });
|
|
101
|
-
}
|
|
102
|
-
if (handle.model) {
|
|
103
|
-
testInfo.annotations.push({ type: 'device.model', description: handle.model });
|
|
104
|
-
}
|
|
105
|
-
if (handle.driver) {
|
|
106
|
-
testInfo.annotations.push({ type: 'device.driver', description: handle.driver });
|
|
107
|
-
}
|
|
108
|
-
testInfo.annotations.push({ type: 'device.id', description: handle.deviceId });
|
|
109
|
-
debug('connecting to device %s', handle.deviceId);
|
|
110
|
-
const device = await connectDevice({
|
|
111
|
-
platform: handle.platform,
|
|
112
|
-
deviceId: handle.deviceId,
|
|
113
|
-
deviceType: handle.type,
|
|
114
|
-
driver: merged.driver,
|
|
115
|
-
timeout: merged.timeout,
|
|
116
|
-
actionTimeout: merged.use?.actionTimeout,
|
|
117
|
-
expectTimeout: merged.expect?.timeout,
|
|
118
|
-
appLaunchTimeout: merged.use?.appLaunchTimeout,
|
|
119
|
-
installTimeout: merged.use?.installTimeout,
|
|
120
|
-
deviceSettings: { animations: merged.use?.animations },
|
|
121
|
-
});
|
|
122
|
-
debug('connected to device %s', handle.deviceId);
|
|
123
|
-
try {
|
|
67
|
+
// Setup runs outside the test timeout (timeout: 0): each stage carries its own bound instead —
|
|
68
|
+
// allocationTimeout for queue + provisioning, installTimeout, appLaunchTimeout. A cloud queue
|
|
69
|
+
// can hold a worker for many minutes, and that wait must not eat the test body's budget.
|
|
70
|
+
device: [async ({ platform, deviceId, deviceName, deviceType, osVersion, bundleId, autoAppLaunch, installApps }, use, testInfo) => {
|
|
71
|
+
const config = await loadConfig(process.cwd(), testInfo.config.configFile);
|
|
72
|
+
const merged = mergeDeviceConfig(config, { platform, deviceId, deviceName, deviceType, osVersion, installApps }, testInfo.project.name);
|
|
73
|
+
const supportedPlatform = assertSupportedPlatform(merged.platform);
|
|
124
74
|
for (const appPath of toArray(merged.installApps)) {
|
|
125
|
-
|
|
126
|
-
if (!installed) {
|
|
127
|
-
await device.installApp(appPath);
|
|
128
|
-
await client.recordAppInstalled(handle.allocationId, appPath);
|
|
129
|
-
}
|
|
75
|
+
assertValidZipFile(appPath);
|
|
130
76
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
77
|
+
const client = getClient();
|
|
78
|
+
debug('allocating device (platform=%s)', supportedPlatform);
|
|
79
|
+
const handle = await allocateWithinTimeout(client, {
|
|
80
|
+
platform: supportedPlatform,
|
|
81
|
+
deviceNamePattern: merged.deviceName?.source,
|
|
82
|
+
deviceId: merged.deviceId,
|
|
83
|
+
deviceType: merged.deviceType,
|
|
84
|
+
osVersion: merged.osVersion,
|
|
85
|
+
}, allocationTimeoutFor(merged));
|
|
86
|
+
debug('allocated device %s', handle.deviceId);
|
|
87
|
+
testInfo.annotations.push(...annotationsForDevice(handle));
|
|
88
|
+
debug('connecting to device %s', handle.deviceId);
|
|
89
|
+
const device = await connectDevice(connectOptionsFor(handle, merged));
|
|
90
|
+
debug('connected to device %s', handle.deviceId);
|
|
91
|
+
try {
|
|
92
|
+
for (const appPath of toArray(merged.installApps)) {
|
|
93
|
+
const installed = await client.isAppInstalled(handle.allocationId, appPath);
|
|
94
|
+
if (!installed) {
|
|
95
|
+
await device.installApp(appPath);
|
|
96
|
+
await client.recordAppInstalled(handle.allocationId, appPath);
|
|
97
|
+
}
|
|
134
98
|
}
|
|
135
|
-
|
|
136
|
-
|
|
99
|
+
if (bundleId && autoAppLaunch !== false) {
|
|
100
|
+
try {
|
|
101
|
+
await device.terminateApp(bundleId);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// app may not be running
|
|
105
|
+
}
|
|
106
|
+
await device.launchApp(bundleId);
|
|
137
107
|
}
|
|
138
|
-
|
|
108
|
+
device.setStepFn((title, fn, location) => base.step(title, fn, { location }));
|
|
109
|
+
await use(device);
|
|
139
110
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await client.release(handle.allocationId);
|
|
146
|
-
}
|
|
147
|
-
},
|
|
111
|
+
finally {
|
|
112
|
+
await device.disconnect();
|
|
113
|
+
await client.release(handle.allocationId);
|
|
114
|
+
}
|
|
115
|
+
}, { timeout: 0 }],
|
|
148
116
|
screen: async ({ device, video, viewTree }, use, testInfo) => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
117
|
+
// device is null when its setup was aborted (e.g. test timed out while allocating) and an afterEach still requests screen
|
|
118
|
+
if (!device) {
|
|
119
|
+
throw new Error('device is not available, its setup did not complete (did the test time out while allocating?)');
|
|
120
|
+
}
|
|
121
|
+
const plan = videoPlan(video, testInfo.outputDir, testInfo.testId);
|
|
122
|
+
const videoPath = plan.path;
|
|
123
|
+
if (plan.shouldRecord) {
|
|
155
124
|
try {
|
|
156
125
|
await mkdir(testInfo.outputDir, { recursive: true });
|
|
157
126
|
await device.startRecording({ output: videoPath });
|
|
@@ -161,12 +130,11 @@ export const test = base.extend({
|
|
|
161
130
|
}
|
|
162
131
|
}
|
|
163
132
|
await use(device.screen);
|
|
164
|
-
if (shouldRecord) {
|
|
133
|
+
if (plan.shouldRecord) {
|
|
165
134
|
try {
|
|
166
135
|
const result = await device.stopRecording();
|
|
167
136
|
const failed = testInfo.status !== testInfo.expectedStatus;
|
|
168
|
-
|
|
169
|
-
if (shouldAttach) {
|
|
137
|
+
if (plan.shouldAttach(failed)) {
|
|
170
138
|
await attachVideo(testInfo, result.url, result.output ?? videoPath);
|
|
171
139
|
}
|
|
172
140
|
await unlink(videoPath).catch(() => { });
|
package/dist/fixtures.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,IAAI,EAAiB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,IAAI,EAAiB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,OAAO,GAIR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,mBAAmB,GACpB,MAAM,sBAAs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CAAC,MAAM,CAAC,sBAAsB,EAAE;wBAC5C,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;wBAChD,WAAW,EAAE,kBAAkB;qBAChC,CAAC,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACP,6BAA6B;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobilewright/test",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "Test fixtures for Mobilewright",
|
|
5
5
|
"homepage": "https://mobilewright.dev",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mobilewright/core": "^0.0.
|
|
33
|
-
"@mobilewright/protocol": "^0.0.
|
|
34
|
-
"@playwright/test": "1.
|
|
32
|
+
"@mobilewright/core": "^0.0.59",
|
|
33
|
+
"@mobilewright/protocol": "^0.0.59",
|
|
34
|
+
"@playwright/test": "1.63.0",
|
|
35
35
|
"debug": "^4.4.3",
|
|
36
|
-
"mobilewright": "^0.0.
|
|
36
|
+
"mobilewright": "^0.0.59"
|
|
37
37
|
}
|
|
38
38
|
}
|