@testchimp/playwright 0.1.38 → 0.1.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 +7 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/mobile-screen-transport-resync.d.ts +15 -0
- package/dist/mobile-screen-transport-resync.d.ts.map +1 -0
- package/dist/mobile-screen-transport-resync.js +73 -0
- package/dist/mobile-screen-transport-resync.js.map +1 -0
- package/dist/rum-automation-mobile.d.ts +39 -7
- package/dist/rum-automation-mobile.d.ts.map +1 -1
- package/dist/rum-automation-mobile.js +76 -9
- package/dist/rum-automation-mobile.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +5 -1
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,13 +84,13 @@ A side-effect-only `import '@testchimp/playwright/runtime'` does not apply exten
|
|
|
84
84
|
|
|
85
85
|
**Web:** the runtime injects `__TC_CI_TEST_INFO` on the `page` fixture for `@testchimp/rum-js`.
|
|
86
86
|
|
|
87
|
-
**Mobile (iOS/Android):** set `TESTCHIMP_PROJECT_TYPE=ios` or `android`. The runtime
|
|
87
|
+
**Mobile (iOS/Android):** set `TESTCHIMP_PROJECT_TYPE=ios` or `android`. The runtime registers `beforeEach`/`afterEach` hooks that call `device.openUrl` to push CI metadata into the app (by default **no** `/v1/clear` before each test—each test **`SET`s** new CI so RUM avoids a clear→set gap with missing `ci_test_info`). Integrate **TestChimpRum** for that platform (see `testchimp-rum-ios` / `testchimp-rum-android` READMEs): URL scheme / intent filter for `testchimp-rum://truecoverage/...`.
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
export TESTCHIMP_PROJECT_TYPE=ios # or android
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Optional URL overrides: `TESTCHIMP_RUM_AUTOMATION_SET_PREFIX`, `TESTCHIMP_RUM_AUTOMATION_CLEAR_URL` (defaults match the native SDKs).
|
|
93
|
+
Optional URL overrides: `TESTCHIMP_RUM_AUTOMATION_SET_PREFIX`, `TESTCHIMP_RUM_AUTOMATION_CLEAR_URL`, `TESTCHIMP_RUM_AUTOMATION_FLUSH_URL` (defaults match the native SDKs). Legacy: set **`TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`** to send `/v1/clear` before each test’s `SET` again.
|
|
94
94
|
|
|
95
95
|
### 2. Environment variables
|
|
96
96
|
|
|
@@ -106,6 +106,8 @@ Set these so the reporter can talk to TestChimp (env vars override programmatic
|
|
|
106
106
|
| `TESTCHIMP_PROJECT_TYPE` | No | Fixture/runtime switch: `web` (default) or mobile (`ios`/`android`). Mobile mode always pushes CI JSON via `device.openUrl` (TrueCoverage). |
|
|
107
107
|
| `TESTCHIMP_RUM_AUTOMATION_SET_PREFIX` | No | Override set-URL prefix (default `testchimp-rum://truecoverage/v1/set?p=` + base64url JSON). |
|
|
108
108
|
| `TESTCHIMP_RUM_AUTOMATION_CLEAR_URL` | No | Override clear URL (default `testchimp-rum://truecoverage/v1/clear`). |
|
|
109
|
+
| `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS` | No | When `1`/`true`/`yes`, each test’s `beforeEach` sends `/v1/clear` before `SET` (legacy). **Default off** so CI stays set until overwritten, avoiding null `ci_test_info` on RUM during the clear→set window. |
|
|
110
|
+
| `TESTCHIMP_RUM_TRANSPORT_RESYNC` | No | Mobile `screen` fixture: set to `0` to disable automatic TrueCoverage `v1/set` after likely WebSocket/mobilecli transport failures (default: enabled). |
|
|
109
111
|
|
|
110
112
|
If `TESTCHIMP_API_KEY` is missing, the reporter logs a warning and disables reporting (no request is sent).
|
|
111
113
|
|
|
@@ -165,8 +167,8 @@ Retries are tracked; with `reportOnlyFinalAttempt: true` only the last attempt i
|
|
|
165
167
|
- **Named**: `TestChimpReporter`, `TestChimpApiClient`, and types/utilities from `./types` and `./utils`.
|
|
166
168
|
- **Subpath**: `@testchimp/playwright/runtime` — use `installTestChimp(test)` on your runner’s `test` object (see Quick start).
|
|
167
169
|
- **Web:** extends `page` to set `__TC_CI_TEST_INFO` for `@testchimp/rum-js`.
|
|
168
|
-
- **Mobile:** when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, registers hooks that call `device.openUrl` for the iOS Swift SDK and Android Kotlin SDK (same URL contract).
|
|
169
|
-
- **Named**: `buildCiTestInfoJson`, `attachMobileRumAutomationHooks`, etc., for advanced wiring.
|
|
170
|
+
- **Mobile:** when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, registers hooks that call `device.openUrl` for the iOS Swift SDK and Android Kotlin SDK (same URL contract). Default: **SET-only** between tests; **`afterAll`** sends `clear`+`flush` so CI does not linger after the file’s tests.
|
|
171
|
+
- **Named**: `buildCiTestInfoJson`, `attachMobileRumAutomationHooks`, `clearBetweenTestsEnabled`, `resyncTrueCoverageSetForCurrentTest`, `isLikelyMobileTransportFailure`, etc., for advanced wiring.
|
|
170
172
|
|
|
171
173
|
---
|
|
172
174
|
|
|
@@ -184,7 +186,7 @@ Retries are tracked; with `reportOnlyFinalAttempt: true` only the last attempt i
|
|
|
184
186
|
- **RUM events not linked to tests / missing `ci_test_info` (mobile)**
|
|
185
187
|
Use `export const test = installTestChimp(...)` from a fixtures barrel and import `test` from there. Set `TESTCHIMP_PROJECT_TYPE=android|ios` and handle `testchimp-rum://truecoverage/...` in the app (`TestChimpRum.handleAutomationURL` on iOS, `TestChimpRum.handleAutomationUri` on Android).
|
|
186
188
|
**Android SDK:** use **testchimp-rum-android ≥ 0.1.7** (automation **`/v1/set`** on caller thread; **`/v1/flush`** drains buffered events when the runner opens that URL).
|
|
187
|
-
**Runner:** **`@testchimp/playwright` ≥ 0.1.
|
|
189
|
+
**Runner:** **`@testchimp/playwright` ≥ 0.1.39** sends `set` bursts after `launchApp`, settle delay, **`afterEach` `set` + `v1/flush`**, and **`afterAll` `clear` + `flush`** when between-test clear is off (default), so RUM batches keep `ci-test-info` instead of hitting a clear→set gap. Opt in to legacy clear-before-each-test with **`TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`**. **Re-sends `set` after likely transport failures** on `screen` API calls (WebSocket **1006**, connection closed, etc.). Disable resync with **`TESTCHIMP_RUM_TRANSPORT_RESYNC=0`**. Tune **`TESTCHIMP_RUM_AUTOMATION_POST_SET_SETTLE_MS`** (0–500, default **100** ms) on slow devices. Optional URL overrides: **`TESTCHIMP_RUM_AUTOMATION_FLUSH_URL`**. If **`device.openUrl`** wedges (mobilecli), set **`TESTCHIMP_RUM_AUTOMATION_OPEN_URL_TIMEOUT_MS`** (default **25000**, clamp **100–120000**) so hooks fail fast instead of consuming the full test timeout.
|
|
188
190
|
|
|
189
191
|
- **RUM events not linked to tests (web)**
|
|
190
192
|
Same `installTestChimp` barrel; web uses `__TC_CI_TEST_INFO` on `page` for `@testchimp/rum-js`.
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* Runtime (`@testchimp/playwright/runtime`): use `installTrueCoverage` or `installTestChimp` (same behavior).
|
|
29
29
|
* Fixture/runtime switching: default web mode uses `page`; set `TESTCHIMP_PROJECT_TYPE=ios|android`
|
|
30
30
|
* (case-insensitive) to switch runtime fixture wiring to `screen`.
|
|
31
|
-
* Mobile TrueCoverage: `TESTCHIMP_PROJECT_TYPE=ios|android` + TestChimpRum URL handler; see README.
|
|
31
|
+
* Mobile TrueCoverage: `TESTCHIMP_PROJECT_TYPE=ios|android` + TestChimpRum URL handler; see README. Optional **`TESTCHIMP_RUM_TRANSPORT_RESYNC=0`** disables automatic `v1/set` after likely transport failures on mobile `screen` calls. **`TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`** opts in to legacy `/v1/clear` before each test (default off to avoid null `ci-test-info` between clear and set).
|
|
32
32
|
* ExploreChimp: set `EXPLORECHIMP_ENABLED=true`, use `test('…', async ({ markScreenState }) => …)`; `TESTCHIMP_BATCH_INVOCATION_ID`, sources/regex envs as documented in the runtime module. Set **`TESTCHIMP_BRANCH_NAME`** (or `TESTCHIMP_BRANCH`) locally so analyze requests send `branchName` and the server can persist `branch_id`.
|
|
33
33
|
* Suite batch id: the reporter writes `.testchimp-batch-invocation-id` under the Playwright project root at run start (when unset, generates a UUID) and removes it at run end so ExploreChimp fixtures and CI stay aligned.
|
|
34
34
|
*/
|
|
@@ -37,7 +37,8 @@ export { TestChimpApiClient } from './api-client';
|
|
|
37
37
|
export * from './types';
|
|
38
38
|
export * from './utils';
|
|
39
39
|
export { buildCiTestInfoJson, buildCiTestInfoObject, type CiTestInfo, type TestInfoForCi } from './ci-test-info';
|
|
40
|
-
export { attachMobileRumAutomationHooks, buildAutomationSetOpenUrl, getMobileRumAutomationUrls, type MobileRumAutomationUrls, } from './rum-automation-mobile';
|
|
40
|
+
export { attachMobileRumAutomationHooks, buildAutomationSetOpenUrl, clearBetweenTestsEnabled, getMobileRumAutomationUrls, isLikelyMobileTransportFailure, resyncTrueCoverageSetForCurrentTest, transportResyncDisabled, type MobileDeviceWorkerFixtures, type MobileRumAutomationUrls, } from './rum-automation-mobile';
|
|
41
|
+
export { attachMobileScreenTransportResync, wrapScreenForTransportResync, } from './mobile-screen-transport-resync';
|
|
41
42
|
/** ExploreChimp / agents.proto JSON mirrors (camelCase). */
|
|
42
43
|
export type * from './explorechimp/agents-explorechimp-json';
|
|
43
44
|
export { DataSourceEnum } from './explorechimp/agents-explorechimp-json';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE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CAAC;AACzD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* Runtime (`@testchimp/playwright/runtime`): use `installTrueCoverage` or `installTestChimp` (same behavior).
|
|
30
30
|
* Fixture/runtime switching: default web mode uses `page`; set `TESTCHIMP_PROJECT_TYPE=ios|android`
|
|
31
31
|
* (case-insensitive) to switch runtime fixture wiring to `screen`.
|
|
32
|
-
* Mobile TrueCoverage: `TESTCHIMP_PROJECT_TYPE=ios|android` + TestChimpRum URL handler; see README.
|
|
32
|
+
* Mobile TrueCoverage: `TESTCHIMP_PROJECT_TYPE=ios|android` + TestChimpRum URL handler; see README. Optional **`TESTCHIMP_RUM_TRANSPORT_RESYNC=0`** disables automatic `v1/set` after likely transport failures on mobile `screen` calls. **`TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`** opts in to legacy `/v1/clear` before each test (default off to avoid null `ci-test-info` between clear and set).
|
|
33
33
|
* ExploreChimp: set `EXPLORECHIMP_ENABLED=true`, use `test('…', async ({ markScreenState }) => …)`; `TESTCHIMP_BATCH_INVOCATION_ID`, sources/regex envs as documented in the runtime module. Set **`TESTCHIMP_BRANCH_NAME`** (or `TESTCHIMP_BRANCH`) locally so analyze requests send `branchName` and the server can persist `branch_id`.
|
|
34
34
|
* Suite batch id: the reporter writes `.testchimp-batch-invocation-id` under the Playwright project root at run start (when unset, generates a UUID) and removes it at run end so ExploreChimp fixtures and CI stay aligned.
|
|
35
35
|
*/
|
|
@@ -48,7 +48,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.DataSourceEnum = exports.getMobileRumAutomationUrls = exports.buildAutomationSetOpenUrl = exports.attachMobileRumAutomationHooks = exports.buildCiTestInfoObject = exports.buildCiTestInfoJson = exports.TestChimpApiClient = exports.TestChimpReporter = void 0;
|
|
51
|
+
exports.DataSourceEnum = exports.wrapScreenForTransportResync = exports.attachMobileScreenTransportResync = exports.transportResyncDisabled = exports.resyncTrueCoverageSetForCurrentTest = exports.isLikelyMobileTransportFailure = exports.getMobileRumAutomationUrls = exports.clearBetweenTestsEnabled = exports.buildAutomationSetOpenUrl = exports.attachMobileRumAutomationHooks = exports.buildCiTestInfoObject = exports.buildCiTestInfoJson = exports.TestChimpApiClient = exports.TestChimpReporter = void 0;
|
|
52
52
|
var testchimp_reporter_1 = require("./testchimp-reporter");
|
|
53
53
|
Object.defineProperty(exports, "TestChimpReporter", { enumerable: true, get: function () { return testchimp_reporter_1.TestChimpReporter; } });
|
|
54
54
|
var api_client_1 = require("./api-client");
|
|
@@ -61,7 +61,14 @@ Object.defineProperty(exports, "buildCiTestInfoObject", { enumerable: true, get:
|
|
|
61
61
|
var rum_automation_mobile_1 = require("./rum-automation-mobile");
|
|
62
62
|
Object.defineProperty(exports, "attachMobileRumAutomationHooks", { enumerable: true, get: function () { return rum_automation_mobile_1.attachMobileRumAutomationHooks; } });
|
|
63
63
|
Object.defineProperty(exports, "buildAutomationSetOpenUrl", { enumerable: true, get: function () { return rum_automation_mobile_1.buildAutomationSetOpenUrl; } });
|
|
64
|
+
Object.defineProperty(exports, "clearBetweenTestsEnabled", { enumerable: true, get: function () { return rum_automation_mobile_1.clearBetweenTestsEnabled; } });
|
|
64
65
|
Object.defineProperty(exports, "getMobileRumAutomationUrls", { enumerable: true, get: function () { return rum_automation_mobile_1.getMobileRumAutomationUrls; } });
|
|
66
|
+
Object.defineProperty(exports, "isLikelyMobileTransportFailure", { enumerable: true, get: function () { return rum_automation_mobile_1.isLikelyMobileTransportFailure; } });
|
|
67
|
+
Object.defineProperty(exports, "resyncTrueCoverageSetForCurrentTest", { enumerable: true, get: function () { return rum_automation_mobile_1.resyncTrueCoverageSetForCurrentTest; } });
|
|
68
|
+
Object.defineProperty(exports, "transportResyncDisabled", { enumerable: true, get: function () { return rum_automation_mobile_1.transportResyncDisabled; } });
|
|
69
|
+
var mobile_screen_transport_resync_1 = require("./mobile-screen-transport-resync");
|
|
70
|
+
Object.defineProperty(exports, "attachMobileScreenTransportResync", { enumerable: true, get: function () { return mobile_screen_transport_resync_1.attachMobileScreenTransportResync; } });
|
|
71
|
+
Object.defineProperty(exports, "wrapScreenForTransportResync", { enumerable: true, get: function () { return mobile_screen_transport_resync_1.wrapScreenForTransportResync; } });
|
|
65
72
|
var agents_explorechimp_json_1 = require("./explorechimp/agents-explorechimp-json");
|
|
66
73
|
Object.defineProperty(exports, "DataSourceEnum", { enumerable: true, get: function () { return agents_explorechimp_json_1.DataSourceEnum; } });
|
|
67
74
|
// Default export for Playwright reporter configuration
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;;;;;;;;;;;;AAEH,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,+CAAiH;AAAxG,mHAAA,mBAAmB,OAAA;AAAE,qHAAA,qBAAqB,OAAA;AACnD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;;;;;;;;;;;;AAEH,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,+CAAiH;AAAxG,mHAAA,mBAAmB,OAAA;AAAE,qHAAA,qBAAqB,OAAA;AACnD,iEAUiC;AAT/B,uIAAA,8BAA8B,OAAA;AAC9B,kIAAA,yBAAyB,OAAA;AACzB,iIAAA,wBAAwB,OAAA;AACxB,mIAAA,0BAA0B,OAAA;AAC1B,uIAAA,8BAA8B,OAAA;AAC9B,4IAAA,mCAAmC,OAAA;AACnC,gIAAA,uBAAuB,OAAA;AAIzB,mFAG0C;AAFxC,mJAAA,iCAAiC,OAAA;AACjC,8IAAA,4BAA4B,OAAA;AAI9B,oFAAyE;AAAhE,0HAAA,cAAc,OAAA;AAEvB,uDAAuD;AACvD,6DAAyD;AACzD,kBAAe,sCAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TestInfoForCi } from './ci-test-info';
|
|
2
|
+
type ScreenTransportCtx = {
|
|
3
|
+
device: unknown;
|
|
4
|
+
testInfo: TestInfoForCi;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Wrap a Mobilewright `screen` so async method failures that look like transport drops trigger a TrueCoverage SET resync before the error propagates.
|
|
8
|
+
*/
|
|
9
|
+
export declare function wrapScreenForTransportResync(screen: unknown, ctx: ScreenTransportCtx): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Extend the test type with a `screen` fixture that proxies callable screen APIs for transport-failure resync.
|
|
12
|
+
*/
|
|
13
|
+
export declare function attachMobileScreenTransportResync(testType: any): any;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=mobile-screen-transport-resync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-screen-transport-resync.d.ts","sourceRoot":"","sources":["../src/mobile-screen-transport-resync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAmCF;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAmB9F;AAED;;GAEG;AAEH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAWpE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapScreenForTransportResync = wrapScreenForTransportResync;
|
|
4
|
+
exports.attachMobileScreenTransportResync = attachMobileScreenTransportResync;
|
|
5
|
+
const rum_automation_mobile_1 = require("./rum-automation-mobile");
|
|
6
|
+
function isThenable(v) {
|
|
7
|
+
return v != null && typeof v.then === 'function';
|
|
8
|
+
}
|
|
9
|
+
async function runWithTransportResync(fn, ctx) {
|
|
10
|
+
try {
|
|
11
|
+
return await fn();
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
if (!(0, rum_automation_mobile_1.isLikelyMobileTransportFailure)(err)) {
|
|
15
|
+
throw err;
|
|
16
|
+
}
|
|
17
|
+
const dev = ctx.device;
|
|
18
|
+
if (!dev || typeof dev.openUrl !== 'function') {
|
|
19
|
+
throw err;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
await (0, rum_automation_mobile_1.resyncTrueCoverageSetForCurrentTest)(dev, ctx.testInfo);
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.warn('[TestChimp] TrueCoverage: re-sent SET after a likely transport failure so the next RUM emit can carry ci_test_info again.');
|
|
25
|
+
}
|
|
26
|
+
catch (resyncErr) {
|
|
27
|
+
const m = resyncErr instanceof Error ? resyncErr.message : String(resyncErr);
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.warn(`[TestChimp] TrueCoverage: SET resync failed (non-fatal): ${m}`);
|
|
30
|
+
}
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Wrap a Mobilewright `screen` so async method failures that look like transport drops trigger a TrueCoverage SET resync before the error propagates.
|
|
36
|
+
*/
|
|
37
|
+
function wrapScreenForTransportResync(screen, ctx) {
|
|
38
|
+
if ((0, rum_automation_mobile_1.transportResyncDisabled)() || screen == null || typeof screen !== 'object') {
|
|
39
|
+
return screen;
|
|
40
|
+
}
|
|
41
|
+
return new Proxy(screen, {
|
|
42
|
+
get(_target, prop, receiver) {
|
|
43
|
+
const v = Reflect.get(screen, prop, receiver);
|
|
44
|
+
if (typeof v !== 'function') {
|
|
45
|
+
return v;
|
|
46
|
+
}
|
|
47
|
+
return (...args) => {
|
|
48
|
+
const out = Reflect.apply(v, screen, args);
|
|
49
|
+
if (isThenable(out)) {
|
|
50
|
+
return runWithTransportResync(() => out, ctx);
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extend the test type with a `screen` fixture that proxies callable screen APIs for transport-failure resync.
|
|
59
|
+
*/
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
function attachMobileScreenTransportResync(testType) {
|
|
62
|
+
if ((0, rum_automation_mobile_1.transportResyncDisabled)()) {
|
|
63
|
+
return testType;
|
|
64
|
+
}
|
|
65
|
+
return testType.extend({
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
screen: async ({ screen, device }, use, testInfo) => {
|
|
68
|
+
const ctx = { device, testInfo };
|
|
69
|
+
await use(wrapScreenForTransportResync(screen, ctx));
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=mobile-screen-transport-resync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-screen-transport-resync.js","sourceRoot":"","sources":["../src/mobile-screen-transport-resync.ts"],"names":[],"mappings":";;AAiDA,oEAmBC;AAMD,8EAWC;AApFD,mEAKiC;AAOjC,SA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}
|
|
7
|
+
/** Mobilewright worker fixtures used by TrueCoverage hooks (`device` absent in non-mobile projects, e.g. setup). */
|
|
8
|
+
export type MobileDeviceWorkerFixtures = {
|
|
9
|
+
device?: {
|
|
10
|
+
openUrl: (url: string) => Promise<void>;
|
|
11
|
+
launchApp?: (bundleId: string) => Promise<void>;
|
|
12
|
+
} | null;
|
|
13
|
+
bundleId?: string;
|
|
14
|
+
};
|
|
15
|
+
/** Disable automatic TrueCoverage SET after mobilecli/WebSocket transport errors (`TESTCHIMP_RUM_TRANSPORT_RESYNC=0`). */
|
|
16
|
+
export declare function transportResyncDisabled(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When true, each test's `beforeEach` sends `/v1/clear` before `SET` (legacy).
|
|
19
|
+
* Default false: skip clear between tests so the app keeps CI until overwritten by `SET`,
|
|
20
|
+
* avoiding a clear→set gap where RUM emits snapshot nil. Opt in with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearBetweenTestsEnabled(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Heuristic: mobilecli / WebSocket abnormal close or connection drop (e.g. code 1006).
|
|
25
|
+
* Used to re-send TrueCoverage `SET` so the next RUM emit can carry `ci_test_info` again.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isLikelyMobileTransportFailure(err: unknown): boolean;
|
|
6
28
|
/**
|
|
7
29
|
* URL prefix and clear URL for Mobilewright TrueCoverage (`device.openUrl`).
|
|
8
30
|
* Optional overrides: `TESTCHIMP_RUM_AUTOMATION_SET_PREFIX`, `TESTCHIMP_RUM_AUTOMATION_CLEAR_URL`,
|
|
9
|
-
* `TESTCHIMP_RUM_AUTOMATION_FLUSH_URL`, `TESTCHIMP_RUM_AUTOMATION_OPEN_URL_TIMEOUT_MS` (per `openUrl`/`launchApp` call, default 25000, clamp 100–120000)
|
|
31
|
+
* `TESTCHIMP_RUM_AUTOMATION_FLUSH_URL`, `TESTCHIMP_RUM_AUTOMATION_OPEN_URL_TIMEOUT_MS` (per `openUrl`/`launchApp` call, default 25000, clamp 100–120000),
|
|
32
|
+
* `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS` (default off: no `/v1/clear` before each test; see {@link clearBetweenTestsEnabled}).
|
|
10
33
|
*/
|
|
11
34
|
export declare function getMobileRumAutomationUrls(): MobileRumAutomationUrls;
|
|
12
35
|
export declare function buildAutomationSetOpenUrl(setUrlPrefix: string, ciJson: string): string | {
|
|
13
36
|
error: string;
|
|
14
37
|
};
|
|
15
38
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
39
|
+
* Re-send a single TrueCoverage `v1/set` for the current test (e.g. after a mobilecli/WebSocket transport drop)
|
|
40
|
+
* so the next RUM emit can attach `ci_test_info` again.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resyncTrueCoverageSetForCurrentTest(device: MobileDeviceWorkerFixtures['device'], testInfo: TestInfoForCi): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Register `beforeEach` / `afterEach` (and when between-test clear is off, `afterAll`) on the given Playwright
|
|
45
|
+
* `TestType` to push CI JSON into the app via `device.openUrl` (mobilecli `device.url`).
|
|
46
|
+
* Used when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`.
|
|
47
|
+
*
|
|
48
|
+
* By default, **`/v1/clear` is not sent** before each test (avoids a clear→set window where RUM emits have no
|
|
49
|
+
* `ci-test-info`). Each `beforeEach` overwrites CI via one or more `SET` URLs. Opt in to legacy clear-first
|
|
50
|
+
* behavior with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
18
51
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* uploads before the next test's `clear` (short runs vs the SDK timer flush).
|
|
52
|
+
* `beforeEach`: optionally `launchApp`, then `SET` burst + settle. `afterEach`: trailing `SET` then `flush`.
|
|
53
|
+
* When between-test clear is off, `afterAll`: `clear` + `flush` so CI does not linger after the file's tests
|
|
54
|
+
* (TTL would otherwise keep it on the device).
|
|
23
55
|
*/
|
|
24
56
|
export declare function attachMobileRumAutomationHooks(testType: any): any;
|
|
25
57
|
//# sourceMappingURL=rum-automation-mobile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rum-automation-mobile.d.ts","sourceRoot":"","sources":["../src/rum-automation-mobile.ts"],"names":[],"mappings":"AA+
|
|
1
|
+
{"version":3,"file":"rum-automation-mobile.d.ts","sourceRoot":"","sources":["../src/rum-automation-mobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA+CzE,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,oHAAoH;AACpH,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACjD,GAAG,IAAI,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAIF,0HAA0H;AAC1H,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAGlD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAepE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,uBAAuB,CAMpE;AAED,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAS1G;AAqED;;;GAGG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAC5C,QAAQ,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAoDjE"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transportResyncDisabled = transportResyncDisabled;
|
|
4
|
+
exports.clearBetweenTestsEnabled = clearBetweenTestsEnabled;
|
|
5
|
+
exports.isLikelyMobileTransportFailure = isLikelyMobileTransportFailure;
|
|
3
6
|
exports.getMobileRumAutomationUrls = getMobileRumAutomationUrls;
|
|
4
7
|
exports.buildAutomationSetOpenUrl = buildAutomationSetOpenUrl;
|
|
8
|
+
exports.resyncTrueCoverageSetForCurrentTest = resyncTrueCoverageSetForCurrentTest;
|
|
5
9
|
exports.attachMobileRumAutomationHooks = attachMobileRumAutomationHooks;
|
|
6
10
|
const ci_test_info_1 = require("./ci-test-info");
|
|
7
11
|
const DEFAULT_SET_PREFIX = 'testchimp-rum://truecoverage/v1/set?p=';
|
|
@@ -49,10 +53,46 @@ async function withTimeout(promise, ms, operation) {
|
|
|
49
53
|
clearTimeout(timer);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
56
|
+
/** Disable automatic TrueCoverage SET after mobilecli/WebSocket transport errors (`TESTCHIMP_RUM_TRANSPORT_RESYNC=0`). */
|
|
57
|
+
function transportResyncDisabled() {
|
|
58
|
+
return process.env.TESTCHIMP_RUM_TRANSPORT_RESYNC?.trim() === '0';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* When true, each test's `beforeEach` sends `/v1/clear` before `SET` (legacy).
|
|
62
|
+
* Default false: skip clear between tests so the app keeps CI until overwritten by `SET`,
|
|
63
|
+
* avoiding a clear→set gap where RUM emits snapshot nil. Opt in with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
64
|
+
*/
|
|
65
|
+
function clearBetweenTestsEnabled() {
|
|
66
|
+
const raw = process.env.TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS?.trim().toLowerCase();
|
|
67
|
+
return raw === '1' || raw === 'true' || raw === 'yes';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Heuristic: mobilecli / WebSocket abnormal close or connection drop (e.g. code 1006).
|
|
71
|
+
* Used to re-send TrueCoverage `SET` so the next RUM emit can carry `ci_test_info` again.
|
|
72
|
+
*/
|
|
73
|
+
function isLikelyMobileTransportFailure(err) {
|
|
74
|
+
if (transportResyncDisabled())
|
|
75
|
+
return false;
|
|
76
|
+
const m = (err instanceof Error ? err.message : String(err)).toLowerCase();
|
|
77
|
+
if (m.length === 0)
|
|
78
|
+
return false;
|
|
79
|
+
const needles = [
|
|
80
|
+
'1006',
|
|
81
|
+
'websocket',
|
|
82
|
+
'connection closed',
|
|
83
|
+
'econnreset',
|
|
84
|
+
'socket hang up',
|
|
85
|
+
'network connection lost',
|
|
86
|
+
'rpc',
|
|
87
|
+
'mobilecli',
|
|
88
|
+
];
|
|
89
|
+
return needles.some((n) => m.includes(n));
|
|
90
|
+
}
|
|
52
91
|
/**
|
|
53
92
|
* URL prefix and clear URL for Mobilewright TrueCoverage (`device.openUrl`).
|
|
54
93
|
* Optional overrides: `TESTCHIMP_RUM_AUTOMATION_SET_PREFIX`, `TESTCHIMP_RUM_AUTOMATION_CLEAR_URL`,
|
|
55
|
-
* `TESTCHIMP_RUM_AUTOMATION_FLUSH_URL`, `TESTCHIMP_RUM_AUTOMATION_OPEN_URL_TIMEOUT_MS` (per `openUrl`/`launchApp` call, default 25000, clamp 100–120000)
|
|
94
|
+
* `TESTCHIMP_RUM_AUTOMATION_FLUSH_URL`, `TESTCHIMP_RUM_AUTOMATION_OPEN_URL_TIMEOUT_MS` (per `openUrl`/`launchApp` call, default 25000, clamp 100–120000),
|
|
95
|
+
* `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS` (default off: no `/v1/clear` before each test; see {@link clearBetweenTestsEnabled}).
|
|
56
96
|
*/
|
|
57
97
|
function getMobileRumAutomationUrls() {
|
|
58
98
|
return {
|
|
@@ -123,13 +163,29 @@ async function pushTrueCoverageSetForCurrentTest(device, testInfo, setUrlPrefix,
|
|
|
123
163
|
return true;
|
|
124
164
|
}
|
|
125
165
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
166
|
+
* Re-send a single TrueCoverage `v1/set` for the current test (e.g. after a mobilecli/WebSocket transport drop)
|
|
167
|
+
* so the next RUM emit can attach `ci_test_info` again.
|
|
168
|
+
*/
|
|
169
|
+
async function resyncTrueCoverageSetForCurrentTest(device, testInfo) {
|
|
170
|
+
if (!device || typeof device.openUrl !== 'function') {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
const d = device;
|
|
174
|
+
const { setUrlPrefix } = getMobileRumAutomationUrls();
|
|
175
|
+
return pushTrueCoverageSetForCurrentTest(d, testInfo, setUrlPrefix, 1);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Register `beforeEach` / `afterEach` (and when between-test clear is off, `afterAll`) on the given Playwright
|
|
179
|
+
* `TestType` to push CI JSON into the app via `device.openUrl` (mobilecli `device.url`).
|
|
180
|
+
* Used when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`.
|
|
128
181
|
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
182
|
+
* By default, **`/v1/clear` is not sent** before each test (avoids a clear→set window where RUM emits have no
|
|
183
|
+
* `ci-test-info`). Each `beforeEach` overwrites CI via one or more `SET` URLs. Opt in to legacy clear-first
|
|
184
|
+
* behavior with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
185
|
+
*
|
|
186
|
+
* `beforeEach`: optionally `launchApp`, then `SET` burst + settle. `afterEach`: trailing `SET` then `flush`.
|
|
187
|
+
* When between-test clear is off, `afterAll`: `clear` + `flush` so CI does not linger after the file's tests
|
|
188
|
+
* (TTL would otherwise keep it on the device).
|
|
133
189
|
*/
|
|
134
190
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
191
|
function attachMobileRumAutomationHooks(testType) {
|
|
@@ -138,7 +194,9 @@ function attachMobileRumAutomationHooks(testType) {
|
|
|
138
194
|
if (!device || typeof device.openUrl !== 'function') {
|
|
139
195
|
return;
|
|
140
196
|
}
|
|
141
|
-
|
|
197
|
+
if (clearBetweenTestsEnabled()) {
|
|
198
|
+
await openUrlAutomationWithRetries(device, clearUrl);
|
|
199
|
+
}
|
|
142
200
|
let launchedApp = false;
|
|
143
201
|
const bid = typeof bundleId === 'string' && bundleId.trim() !== '' ? bundleId.trim() : undefined;
|
|
144
202
|
if (bid != null && typeof device.launchApp === 'function') {
|
|
@@ -166,9 +224,18 @@ function attachMobileRumAutomationHooks(testType) {
|
|
|
166
224
|
if (!device || typeof device.openUrl !== 'function') {
|
|
167
225
|
return;
|
|
168
226
|
}
|
|
169
|
-
await
|
|
227
|
+
await resyncTrueCoverageSetForCurrentTest(device, testInfo);
|
|
170
228
|
await openUrlAutomationWithRetries(device, flushUrl);
|
|
171
229
|
});
|
|
230
|
+
if (typeof testType.afterAll === 'function' && !clearBetweenTestsEnabled()) {
|
|
231
|
+
testType.afterAll(async ({ device }) => {
|
|
232
|
+
if (!device || typeof device.openUrl !== 'function') {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
await openUrlAutomationWithRetries(device, clearUrl);
|
|
236
|
+
await openUrlAutomationWithRetries(device, flushUrl);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
172
239
|
return testType;
|
|
173
240
|
}
|
|
174
241
|
//# sourceMappingURL=rum-automation-mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rum-automation-mobile.js","sourceRoot":"","sources":["../src/rum-automation-mobile.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"rum-automation-mobile.js","sourceRoot":"","sources":["../src/rum-automation-mobile.ts"],"names":[],"mappings":";;AAiEA,0DAEC;AAOD,4DAGC;AAMD,wEAeC;AAQD,gEAMC;AAED,8DASC;AAyED,kFAUC;AAgBD,wEAoDC;AAlRD,iDAAyE;AAEzE,MAAM,kBAAkB,GAAG,wCAAwC,CAAC;AACpE,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AAClE,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AAElE,qEAAqE;AACrE,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,0HAA0H;AAC1H,MAAM,6BAA6B,GAAG,CAAC,CAAC;AACxC,MAAM,gCAAgC,GAAG,GAAG,CAAC;AAE7C,uHAAuH;AACvH,SAAS,sBAAsB;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC;IACpE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,GAAG,CAAC;IAChD,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC;IAChC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,sHAAsH;AACtH,SAAS,uBAAuB;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC;IACrE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAA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;YACrD,MAAM,4BAA4B,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Side-effect `import '@testchimp/playwright/runtime'` registers on the active test runtime:
|
|
9
9
|
* default `@playwright/test`, or `@mobilewright/test` when `TESTCHIMP_PROJECT_TYPE=ios|android`.
|
|
10
10
|
*
|
|
11
|
-
* Mobile TrueCoverage: when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, hooks call `device.openUrl` to push CI JSON; integrate TestChimpRum (iOS/Android) URL handling in the app.
|
|
11
|
+
* Mobile TrueCoverage: when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, hooks call `device.openUrl` to push CI JSON; integrate TestChimpRum (iOS/Android) URL handling in the app. By default, **`/v1/clear` is not sent** before each test (avoids a clear→set gap with null `ci-test-info` on RUM); each test still `SET`s CI, then `afterEach` runs `v1/flush`. When the fixture key is `screen`, the `screen` object is proxied so likely WebSocket/mobilecli transport failures trigger an extra `v1/set` resync (disable with `TESTCHIMP_RUM_TRANSPORT_RESYNC=0`). Opt in to legacy clear-before-each-test with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
12
12
|
*/
|
|
13
13
|
import { isExploreChimpEnabled } from './explorechimp';
|
|
14
14
|
/** Bound screen/state marker from the `markScreenState` Playwright fixture. */
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAGL,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAGL,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAWxB,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AA4C/F;;;GAGG;AAEH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAyClD;AAED,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,4BAAsB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Side-effect `import '@testchimp/playwright/runtime'` registers on the active test runtime:
|
|
10
10
|
* default `@playwright/test`, or `@mobilewright/test` when `TESTCHIMP_PROJECT_TYPE=ios|android`.
|
|
11
11
|
*
|
|
12
|
-
* Mobile TrueCoverage: when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, hooks call `device.openUrl` to push CI JSON; integrate TestChimpRum (iOS/Android) URL handling in the app.
|
|
12
|
+
* Mobile TrueCoverage: when `TESTCHIMP_PROJECT_TYPE` is `ios`/`android`, hooks call `device.openUrl` to push CI JSON; integrate TestChimpRum (iOS/Android) URL handling in the app. By default, **`/v1/clear` is not sent** before each test (avoids a clear→set gap with null `ci-test-info` on RUM); each test still `SET`s CI, then `afterEach` runs `v1/flush`. When the fixture key is `screen`, the `screen` object is proxied so likely WebSocket/mobilecli transport failures trigger an extra `v1/set` resync (disable with `TESTCHIMP_RUM_TRANSPORT_RESYNC=0`). Opt in to legacy clear-before-each-test with `TESTCHIMP_RUM_AUTOMATION_CLEAR_BETWEEN_TESTS=1`.
|
|
13
13
|
*/
|
|
14
14
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
15
|
if (k2 === undefined) k2 = k;
|
|
@@ -53,6 +53,7 @@ const ci_test_info_1 = require("./ci-test-info");
|
|
|
53
53
|
const explorechimp_1 = require("./explorechimp");
|
|
54
54
|
Object.defineProperty(exports, "isExploreChimpEnabled", { enumerable: true, get: function () { return explorechimp_1.isExploreChimpEnabled; } });
|
|
55
55
|
const project_type_1 = require("./project-type");
|
|
56
|
+
const mobile_screen_transport_resync_1 = require("./mobile-screen-transport-resync");
|
|
56
57
|
const rum_automation_mobile_1 = require("./rum-automation-mobile");
|
|
57
58
|
/** Resolve test runtime module from the consumer project (web: Playwright, mobile: Mobilewright). */
|
|
58
59
|
const pwRequire = (0, module_1.createRequire)(path.join(process.cwd(), 'package.json'));
|
|
@@ -136,6 +137,9 @@ function installTrueCoverage(test) {
|
|
|
136
137
|
}
|
|
137
138
|
if (mobileProject) {
|
|
138
139
|
chain = (0, rum_automation_mobile_1.attachMobileRumAutomationHooks)(chain);
|
|
140
|
+
if (fixtureKey === 'screen') {
|
|
141
|
+
chain = (0, mobile_screen_transport_resync_1.attachMobileScreenTransportResync)(chain);
|
|
142
|
+
}
|
|
139
143
|
}
|
|
140
144
|
return chain;
|
|
141
145
|
}
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEH,kDAyCC;AA7GD,2CAA6B;AAC7B,mCAAuC;AACvC,iDAAqD;AACrD,iDAIwB;AA2Gf,sGA5GP,oCAAqB,OA4GO;AA1G9B,iDAA8F;AAC9F,qFAAqF;AACrF,mEAAyE;AAEzE,qGAAqG;AACrG,MAAM,SAAS,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,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