@wdio/browserstack-service 8.40.5 → 8.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Percy/Percy.d.ts +4 -0
- package/build/Percy/Percy.d.ts.map +1 -1
- package/build/Percy/Percy.js +27 -2
- package/build/Percy/PercySDK.d.ts.map +1 -1
- package/build/Percy/PercySDK.js +53 -4
- package/build/accessibility-handler.d.ts +1 -0
- package/build/accessibility-handler.d.ts.map +1 -1
- package/build/accessibility-handler.js +22 -28
- package/build/cleanup.js +4 -4
- package/build/config.d.ts +3 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +3 -0
- package/build/constants.d.ts +6 -3
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +10 -3
- package/build/crash-reporter.js +2 -2
- package/build/exitHandler.js +2 -2
- package/build/insights-handler.d.ts +9 -7
- package/build/insights-handler.d.ts.map +1 -1
- package/build/insights-handler.js +33 -22
- package/build/instrumentation/funnelInstrumentation.d.ts.map +1 -1
- package/build/instrumentation/funnelInstrumentation.js +17 -10
- package/build/launcher.d.ts +1 -0
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +102 -64
- package/build/reporter.d.ts +1 -1
- package/build/reporter.d.ts.map +1 -1
- package/build/reporter.js +8 -5
- package/build/scripts/accessibility-scripts.d.ts +2 -7
- package/build/scripts/accessibility-scripts.d.ts.map +1 -1
- package/build/service.d.ts +1 -0
- package/build/service.d.ts.map +1 -1
- package/build/service.js +24 -19
- package/build/testHub/utils.d.ts +7 -0
- package/build/testHub/utils.d.ts.map +1 -0
- package/build/testHub/utils.js +57 -0
- package/build/testOps/listener.d.ts +6 -0
- package/build/testOps/listener.d.ts.map +1 -1
- package/build/testOps/listener.js +38 -1
- package/build/testOps/requestUtils.js +3 -3
- package/build/types.d.ts +34 -1
- package/build/types.d.ts.map +1 -1
- package/build/util.d.ts +10 -3
- package/build/util.d.ts.map +1 -1
- package/build/util.js +101 -153
- package/package.json +7 -7
- package/tsconfig.prod.tsbuildinfo +1 -0
package/build/Percy/Percy.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import type { Options } from '@wdio/types';
|
|
|
3
3
|
declare class Percy {
|
|
4
4
|
#private;
|
|
5
5
|
isProcessRunning: boolean;
|
|
6
|
+
percyCaptureMode?: string;
|
|
7
|
+
buildId: number | null;
|
|
8
|
+
percyAutoEnabled: boolean;
|
|
9
|
+
percy: boolean;
|
|
6
10
|
constructor(options: BrowserstackConfig & Options.Testrunner, config: Options.Testrunner, bsConfig: UserConfig);
|
|
7
11
|
healthcheck(): Promise<boolean | undefined>;
|
|
8
12
|
start(): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Percy.d.ts","sourceRoot":"","sources":["../../src/Percy/Percy.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Percy.d.ts","sourceRoot":"","sources":["../../src/Percy/Percy.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C,cAAM,KAAK;;IAWP,gBAAgB,UAAQ;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAO;IAC7B,gBAAgB,UAAQ;IACxB,KAAK,EAAE,OAAO,CAAA;gBAEF,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU;IAiBxG,WAAW;IAYX,KAAK;IA2CL,IAAI;IAWV,SAAS;IAIH,eAAe;IAoCf,iBAAiB;CA8B1B;AAED,eAAe,KAAK,CAAA"}
|
package/build/Percy/Percy.js
CHANGED
|
@@ -5,6 +5,7 @@ import { spawn } from 'node:child_process';
|
|
|
5
5
|
import { nodeRequest, getBrowserStackUser, getBrowserStackKey, sleep } from '../util.js';
|
|
6
6
|
import { PercyLogger } from './PercyLogger.js';
|
|
7
7
|
import PercyBinary from './PercyBinary.js';
|
|
8
|
+
import { BROWSERSTACK_TESTHUB_UUID } from '../constants.js';
|
|
8
9
|
const logDir = 'logs';
|
|
9
10
|
class Percy {
|
|
10
11
|
#logfile = path.join(logDir, 'percy.log');
|
|
@@ -16,11 +17,17 @@ class Percy {
|
|
|
16
17
|
#isApp;
|
|
17
18
|
#projectName = undefined;
|
|
18
19
|
isProcessRunning = false;
|
|
20
|
+
percyCaptureMode;
|
|
21
|
+
buildId = null;
|
|
22
|
+
percyAutoEnabled = false;
|
|
23
|
+
percy;
|
|
19
24
|
constructor(options, config, bsConfig) {
|
|
20
25
|
this.#options = options;
|
|
21
26
|
this.#config = config;
|
|
22
27
|
this.#isApp = Boolean(options.app);
|
|
23
28
|
this.#projectName = bsConfig.projectName;
|
|
29
|
+
this.percyCaptureMode = options.percyCaptureMode;
|
|
30
|
+
this.percy = options.percy ?? false;
|
|
24
31
|
}
|
|
25
32
|
async #getBinaryPath() {
|
|
26
33
|
if (!this.#binaryPath) {
|
|
@@ -33,6 +40,7 @@ class Percy {
|
|
|
33
40
|
try {
|
|
34
41
|
const resp = await nodeRequest('GET', 'percy/healthcheck', null, this.#address);
|
|
35
42
|
if (resp) {
|
|
43
|
+
this.buildId = resp.build.id;
|
|
36
44
|
return true;
|
|
37
45
|
}
|
|
38
46
|
}
|
|
@@ -52,7 +60,7 @@ class Percy {
|
|
|
52
60
|
if (configPath) {
|
|
53
61
|
commandArgs.push('-c', configPath);
|
|
54
62
|
}
|
|
55
|
-
this.#proc = spawn(binaryPath, commandArgs, { env: { ...process.env, PERCY_TOKEN: token } });
|
|
63
|
+
this.#proc = spawn(binaryPath, commandArgs, { env: { ...process.env, PERCY_TOKEN: token, TH_BUILD_UUID: process.env[BROWSERSTACK_TESTHUB_UUID] } });
|
|
56
64
|
this.#proc.stdout.pipe(logStream);
|
|
57
65
|
this.#proc.stderr.pipe(logStream);
|
|
58
66
|
this.isProcessRunning = true;
|
|
@@ -87,11 +95,28 @@ class Percy {
|
|
|
87
95
|
const projectName = this.#projectName;
|
|
88
96
|
try {
|
|
89
97
|
const type = this.#isApp ? 'app' : 'automate';
|
|
90
|
-
const
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
if (projectName) {
|
|
100
|
+
params.set('name', projectName);
|
|
101
|
+
}
|
|
102
|
+
if (type) {
|
|
103
|
+
params.set('type', type);
|
|
104
|
+
}
|
|
105
|
+
if (this.#options.percyCaptureMode) {
|
|
106
|
+
params.set('percy_capture_mode', this.#options.percyCaptureMode);
|
|
107
|
+
}
|
|
108
|
+
params.set('percy', String(this.#options.percy));
|
|
109
|
+
const query = `api/app_percy/get_project_token?${params.toString()}`;
|
|
110
|
+
const response = await nodeRequest('GET', query, {
|
|
91
111
|
username: getBrowserStackUser(this.#config),
|
|
92
112
|
password: getBrowserStackKey(this.#config)
|
|
93
113
|
}, 'https://api.browserstack.com');
|
|
94
114
|
PercyLogger.debug('Percy fetch token success : ' + response.token);
|
|
115
|
+
if (!this.#options.percy && response.success) {
|
|
116
|
+
this.percyAutoEnabled = response.success;
|
|
117
|
+
}
|
|
118
|
+
this.percyCaptureMode = response.percy_capture_mode;
|
|
119
|
+
this.percy = response.success;
|
|
95
120
|
return response.token;
|
|
96
121
|
}
|
|
97
122
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PercySDK.d.ts","sourceRoot":"","sources":["../../src/Percy/PercySDK.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PercySDK.d.ts","sourceRoot":"","sources":["../../src/Percy/PercySDK.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,QAAQ,YApBW,GAAG,EAAE,SAoBE,CAAA;AA2CvC,eAAO,MAAM,UAAU,YARiB,GAAG,EAAE,kBAQF,CAAA;AAW3C,eAAO,MAAM,aAAa,YARiB,GAAG,EAAE,kBAQC,CAAA"}
|
package/build/Percy/PercySDK.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import InsightsHandler from '../insights-handler.js';
|
|
2
|
+
import TestReporter from '../reporter.js';
|
|
1
3
|
import { PercyLogger } from './PercyLogger.js';
|
|
4
|
+
import { isUndefined } from '../util.js';
|
|
2
5
|
const tryRequire = async function (pkg, fallback) {
|
|
3
6
|
try {
|
|
4
7
|
return (await import(pkg)).default;
|
|
@@ -14,19 +17,63 @@ let snapshotHandler = (...args) => {
|
|
|
14
17
|
PercyLogger.error('Unsupported driver for percy');
|
|
15
18
|
};
|
|
16
19
|
if (percySnapshot) {
|
|
17
|
-
snapshotHandler = (browser,
|
|
20
|
+
snapshotHandler = (browser, snapshotName, options) => {
|
|
18
21
|
if (process.env.PERCY_SNAPSHOT === 'true') {
|
|
19
|
-
|
|
22
|
+
let { name, uuid } = InsightsHandler.currentTest;
|
|
23
|
+
if (isUndefined(name)) {
|
|
24
|
+
({ name, uuid } = TestReporter.currentTest);
|
|
25
|
+
}
|
|
26
|
+
options ||= {};
|
|
27
|
+
options = {
|
|
28
|
+
...options,
|
|
29
|
+
testCase: name || '',
|
|
30
|
+
thTestCaseExecutionId: uuid || '',
|
|
31
|
+
};
|
|
32
|
+
return percySnapshot(browser, snapshotName, options);
|
|
20
33
|
}
|
|
21
34
|
};
|
|
22
35
|
}
|
|
23
36
|
export const snapshot = snapshotHandler;
|
|
37
|
+
/*
|
|
38
|
+
This is a helper method which appends some internal fields
|
|
39
|
+
to the options object being sent to Percy methods
|
|
40
|
+
*/
|
|
41
|
+
const screenshotHelper = (type, driverOrName, nameOrOptions, options) => {
|
|
42
|
+
let { name, uuid } = InsightsHandler.currentTest;
|
|
43
|
+
if (isUndefined(name)) {
|
|
44
|
+
({ name, uuid } = TestReporter.currentTest);
|
|
45
|
+
}
|
|
46
|
+
if (!driverOrName || typeof driverOrName === 'string') {
|
|
47
|
+
nameOrOptions ||= {};
|
|
48
|
+
if (typeof nameOrOptions === 'object') {
|
|
49
|
+
nameOrOptions = {
|
|
50
|
+
...nameOrOptions,
|
|
51
|
+
testCase: name || '',
|
|
52
|
+
thTestCaseExecutionId: uuid || '',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
options ||= {};
|
|
58
|
+
options = {
|
|
59
|
+
...options,
|
|
60
|
+
testCase: name || '',
|
|
61
|
+
thTestCaseExecutionId: uuid || '',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (type === 'app') {
|
|
65
|
+
return percyAppScreenshot(driverOrName, nameOrOptions, options);
|
|
66
|
+
}
|
|
67
|
+
return percySnapshot.percyScreenshot(driverOrName, nameOrOptions, options);
|
|
68
|
+
};
|
|
24
69
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
25
70
|
let screenshotHandler = async (...args) => {
|
|
26
71
|
PercyLogger.error('Unsupported driver for percy');
|
|
27
72
|
};
|
|
28
73
|
if (percySnapshot && percySnapshot.percyScreenshot) {
|
|
29
|
-
screenshotHandler =
|
|
74
|
+
screenshotHandler = (browser, screenshotName, options) => {
|
|
75
|
+
return screenshotHelper('web', browser, screenshotName, options);
|
|
76
|
+
};
|
|
30
77
|
}
|
|
31
78
|
export const screenshot = screenshotHandler;
|
|
32
79
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -34,6 +81,8 @@ let screenshotAppHandler = async (...args) => {
|
|
|
34
81
|
PercyLogger.error('Unsupported driver for percy');
|
|
35
82
|
};
|
|
36
83
|
if (percyAppScreenshot) {
|
|
37
|
-
screenshotAppHandler =
|
|
84
|
+
screenshotAppHandler = (driverOrName, nameOrOptions, options) => {
|
|
85
|
+
return screenshotHelper('app', driverOrName, nameOrOptions, options);
|
|
86
|
+
};
|
|
38
87
|
}
|
|
39
88
|
export const screenshotApp = screenshotAppHandler;
|
|
@@ -14,6 +14,7 @@ declare class _AccessibilityHandler {
|
|
|
14
14
|
private _testMetadata;
|
|
15
15
|
private static _a11yScanSessionMap;
|
|
16
16
|
private _sessionId;
|
|
17
|
+
private listener;
|
|
17
18
|
constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate?: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
|
|
18
19
|
[key: string]: any;
|
|
19
20
|
} | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-handler.d.ts","sourceRoot":"","sources":["../src/accessibility-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"accessibility-handler.d.ts","sourceRoot":"","sources":["../src/accessibility-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAqBjE,cAAM,qBAAqB;IAYnB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,UAAU,CAAC;IACnB,OAAO,CAAC,wBAAwB,CAAC;IACjC,OAAO,CAAC,kBAAkB,CAAC;IAhB/B,OAAO,CAAC,iBAAiB,CAAyB;IAClD,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,qBAAqB,CAAC,CAAyB;IACvD,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,C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getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, isTrue } from './util.js';
|
|
3
4
|
import accessibilityScripts from './scripts/accessibility-scripts.js';
|
|
4
5
|
import { BStackLogger } from './bstackLogger.js';
|
|
@@ -16,6 +17,7 @@ class _AccessibilityHandler {
|
|
|
16
17
|
_testMetadata = {};
|
|
17
18
|
static _a11yScanSessionMap = {};
|
|
18
19
|
_sessionId = null;
|
|
20
|
+
listener = Listener.getInstance();
|
|
19
21
|
constructor(_browser, _capabilities, isAppAutomate, _framework, _accessibilityAutomation, _accessibilityOpts) {
|
|
20
22
|
this._browser = _browser;
|
|
21
23
|
this._capabilities = _capabilities;
|
|
@@ -105,6 +107,8 @@ class _AccessibilityHandler {
|
|
|
105
107
|
try {
|
|
106
108
|
if (this._framework !== 'mocha' ||
|
|
107
109
|
!this.shouldRunTestHooks(this._browser, this._accessibility)) {
|
|
110
|
+
/* This is to be used when test events are sent */
|
|
111
|
+
Listener.setTestRunAccessibilityVar(false);
|
|
108
112
|
return;
|
|
109
113
|
}
|
|
110
114
|
const shouldScanTest = shouldScanTestForAccessibility(suiteTitle, test.title, this._accessibilityOptions);
|
|
@@ -114,6 +118,8 @@ class _AccessibilityHandler {
|
|
|
114
118
|
/* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
|
|
115
119
|
AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanTest;
|
|
116
120
|
}
|
|
121
|
+
/* This is to be used when test events are sent */
|
|
122
|
+
Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanTest);
|
|
117
123
|
if (!isPageOpened) {
|
|
118
124
|
return;
|
|
119
125
|
}
|
|
@@ -141,19 +147,12 @@ class _AccessibilityHandler {
|
|
|
141
147
|
}
|
|
142
148
|
if (shouldScanTestForAccessibility) {
|
|
143
149
|
BStackLogger.info('Automate test case execution has ended. Processing for accessibility testing is underway. ');
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
'filePath': this._suiteFile,
|
|
151
|
-
'scopeList': [suiteTitle, test.title]
|
|
152
|
-
},
|
|
153
|
-
platform: this._platformA11yMeta
|
|
154
|
-
};
|
|
155
|
-
await this.sendTestStopEvent(this._browser, dataForExtension);
|
|
156
|
-
if (shouldScanTestForAccessibility) {
|
|
150
|
+
const dataForExtension = {
|
|
151
|
+
'thTestRunUuid': process.env.TEST_ANALYTICS_ID,
|
|
152
|
+
'thBuildUuid': process.env.BROWSERSTACK_TESTHUB_UUID,
|
|
153
|
+
'thJwtToken': process.env.BROWSERSTACK_TESTHUB_JWT
|
|
154
|
+
};
|
|
155
|
+
await this.sendTestStopEvent(this._browser, dataForExtension);
|
|
157
156
|
BStackLogger.info('Accessibility testing for this test case has ended.');
|
|
158
157
|
}
|
|
159
158
|
}
|
|
@@ -170,6 +169,8 @@ class _AccessibilityHandler {
|
|
|
170
169
|
const featureData = gherkinDocument.feature;
|
|
171
170
|
const uniqueId = getUniqueIdentifierForCucumber(world);
|
|
172
171
|
if (!this.shouldRunTestHooks(this._browser, this._accessibility)) {
|
|
172
|
+
/* This is to be used when test events are sent */
|
|
173
|
+
Listener.setTestRunAccessibilityVar(false);
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
176
|
try {
|
|
@@ -179,6 +180,8 @@ class _AccessibilityHandler {
|
|
|
179
180
|
/* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
|
|
180
181
|
AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanScenario;
|
|
181
182
|
}
|
|
183
|
+
/* This is to be used when test events are sent */
|
|
184
|
+
Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanScenario);
|
|
182
185
|
if (!isPageOpened) {
|
|
183
186
|
return;
|
|
184
187
|
}
|
|
@@ -198,8 +201,6 @@ class _AccessibilityHandler {
|
|
|
198
201
|
}
|
|
199
202
|
const pickleData = world.pickle;
|
|
200
203
|
try {
|
|
201
|
-
const gherkinDocument = world.gherkinDocument;
|
|
202
|
-
const featureData = gherkinDocument.feature;
|
|
203
204
|
const uniqueId = getUniqueIdentifierForCucumber(world);
|
|
204
205
|
const accessibilityScanStarted = this._testMetadata[uniqueId]?.accessibilityScanStarted;
|
|
205
206
|
const shouldScanTestForAccessibility = this._testMetadata[uniqueId]?.scanTestForAccessibility;
|
|
@@ -208,19 +209,12 @@ class _AccessibilityHandler {
|
|
|
208
209
|
}
|
|
209
210
|
if (shouldScanTestForAccessibility) {
|
|
210
211
|
BStackLogger.info('Automate test case execution has ended. Processing for accessibility testing is underway. ');
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
'filePath': gherkinDocument.uri,
|
|
218
|
-
'scopeList': [featureData?.name, pickleData.name]
|
|
219
|
-
},
|
|
220
|
-
platform: this._platformA11yMeta
|
|
221
|
-
};
|
|
222
|
-
await this.sendTestStopEvent(this._browser, dataForExtension);
|
|
223
|
-
if (shouldScanTestForAccessibility) {
|
|
212
|
+
const dataForExtension = {
|
|
213
|
+
'thTestRunUuid': process.env.TEST_ANALYTICS_ID,
|
|
214
|
+
'thBuildUuid': process.env.BROWSERSTACK_TESTHUB_UUID,
|
|
215
|
+
'thJwtToken': process.env.BROWSERSTACK_TESTHUB_JWT
|
|
216
|
+
};
|
|
217
|
+
await this.sendTestStopEvent(this._browser, dataForExtension);
|
|
224
218
|
BStackLogger.info('Accessibility testing for this test case has ended.');
|
|
225
219
|
}
|
|
226
220
|
}
|
package/build/cleanup.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getErrorString, stopBuildUpstream } from './util.js';
|
|
|
2
2
|
import { BStackLogger } from './bstackLogger.js';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { fireFunnelRequest } from './instrumentation/funnelInstrumentation.js';
|
|
5
|
-
import {
|
|
5
|
+
import { BROWSERSTACK_TESTHUB_UUID, BROWSERSTACK_TESTHUB_JWT, BROWSERSTACK_OBSERVABILITY } from './constants.js';
|
|
6
6
|
export default class BStackCleanup {
|
|
7
7
|
static async startCleanup() {
|
|
8
8
|
try {
|
|
@@ -27,15 +27,15 @@ export default class BStackCleanup {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
static async executeObservabilityCleanup(funnelData) {
|
|
30
|
-
if (!process.env[
|
|
30
|
+
if (!process.env[BROWSERSTACK_TESTHUB_JWT]) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
BStackLogger.debug('Executing observability cleanup');
|
|
34
34
|
try {
|
|
35
35
|
const killSignal = funnelData?.event_properties?.finishedMetadata?.signal;
|
|
36
36
|
const result = await stopBuildUpstream(killSignal);
|
|
37
|
-
if (process.env[
|
|
38
|
-
BStackLogger.info(`\nVisit https://observability.browserstack.com/builds/${process.env[
|
|
37
|
+
if (process.env[BROWSERSTACK_OBSERVABILITY] && process.env[BROWSERSTACK_TESTHUB_UUID]) {
|
|
38
|
+
BStackLogger.info(`\nVisit https://observability.browserstack.com/builds/${process.env[BROWSERSTACK_TESTHUB_UUID]} to view build report, insights, and many more debugging information all at one place!\n`);
|
|
39
39
|
}
|
|
40
40
|
const status = (result && result.status) || 'failed';
|
|
41
41
|
const message = (result && result.message);
|
package/build/config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare class BrowserStackConfig {
|
|
|
10
10
|
buildIdentifier?: string;
|
|
11
11
|
testObservability: TestOpsConfig;
|
|
12
12
|
percy: boolean;
|
|
13
|
+
percyCaptureMode?: string;
|
|
13
14
|
accessibility: boolean;
|
|
14
15
|
app?: string | AppConfig;
|
|
15
16
|
private static _instance;
|
|
@@ -18,6 +19,8 @@ declare class BrowserStackConfig {
|
|
|
18
19
|
funnelDataSent: boolean;
|
|
19
20
|
sdkRunID: string;
|
|
20
21
|
killSignal?: string;
|
|
22
|
+
percyBuildId?: number | null;
|
|
23
|
+
isPercyAutoEnabled: boolean;
|
|
21
24
|
private constructor();
|
|
22
25
|
sentFunnelData(): void;
|
|
23
26
|
setKillSignal(sig: string): void;
|
package/build/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,cAAM,kBAAkB;IACpB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,GAAG,kBAAkB;IAO/G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,aAAa,CAAA;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,GAAC,SAAS,CAAA;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoB;IACrC,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAQ;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,cAAM,kBAAkB;IACpB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,GAAG,kBAAkB;IAO/G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,aAAa,CAAA;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,GAAC,SAAS,CAAA;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoB;IACrC,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAQ;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,kBAAkB,UAAQ;IAEjC,OAAO;IAcP,cAAc;IAId,aAAa,CAAC,GAAG,EAAE,MAAM;CAI5B;AAED,eAAe,kBAAkB,CAAA"}
|
package/build/config.js
CHANGED
|
@@ -15,6 +15,7 @@ class BrowserStackConfig {
|
|
|
15
15
|
buildIdentifier;
|
|
16
16
|
testObservability;
|
|
17
17
|
percy;
|
|
18
|
+
percyCaptureMode;
|
|
18
19
|
accessibility;
|
|
19
20
|
app;
|
|
20
21
|
static _instance;
|
|
@@ -23,6 +24,8 @@ class BrowserStackConfig {
|
|
|
23
24
|
funnelDataSent = false;
|
|
24
25
|
sdkRunID;
|
|
25
26
|
killSignal;
|
|
27
|
+
percyBuildId;
|
|
28
|
+
isPercyAutoEnabled = false;
|
|
26
29
|
constructor(options, config) {
|
|
27
30
|
this.framework = config.framework;
|
|
28
31
|
this.userName = config.user;
|
package/build/constants.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export declare const BATCH_EVENT_TYPES: string[];
|
|
|
13
13
|
export declare const DEFAULT_WAIT_TIMEOUT_FOR_PENDING_UPLOADS = 5000;
|
|
14
14
|
export declare const DEFAULT_WAIT_INTERVAL_FOR_PENDING_UPLOADS = 100;
|
|
15
15
|
export declare const BSTACK_SERVICE_VERSION: any;
|
|
16
|
-
export declare const ACCESSIBILITY_API_URL = "https://accessibility.browserstack.com/api";
|
|
17
16
|
export declare const NOT_ALLOWED_KEYS_IN_CAPS: string[];
|
|
18
17
|
export declare const LOGS_FILE = "logs/bstack-wdio-service.log";
|
|
19
18
|
export declare const UPLOAD_LOGS_ADDRESS = "https://upload-observability.browserstack.com";
|
|
@@ -34,14 +33,18 @@ export declare const TCG_INFO: {
|
|
|
34
33
|
tcgRegion: string;
|
|
35
34
|
tcgUrl: string;
|
|
36
35
|
};
|
|
37
|
-
export declare const
|
|
36
|
+
export declare const BROWSERSTACK_TESTHUB_JWT = "BROWSERSTACK_TESTHUB_JWT";
|
|
38
37
|
export declare const BSTACK_TCG_AUTH_RESULT = "BSTACK_TCG_AUTH_RESULT";
|
|
39
38
|
export declare const TESTOPS_SCREENSHOT_ENV = "BS_TESTOPS_ALLOW_SCREENSHOTS";
|
|
40
|
-
export declare const
|
|
39
|
+
export declare const BROWSERSTACK_TESTHUB_UUID = "BROWSERSTACK_TESTHUB_UUID";
|
|
40
|
+
export declare const TEST_ANALYTICS_ID = "TEST_ANALYTICS_ID";
|
|
41
41
|
export declare const PERF_MEASUREMENT_ENV = "BROWSERSTACK_O11Y_PERF_MEASUREMENT";
|
|
42
42
|
export declare const RERUN_TESTS_ENV = "BROWSERSTACK_RERUN_TESTS";
|
|
43
43
|
export declare const RERUN_ENV = "BROWSERSTACK_RERUN";
|
|
44
44
|
export declare const TESTOPS_BUILD_COMPLETED_ENV = "BS_TESTOPS_BUILD_COMPLETED";
|
|
45
|
+
export declare const BROWSERSTACK_PERCY = "BROWSERSTACK_PERCY";
|
|
46
|
+
export declare const BROWSERSTACK_ACCESSIBILITY = "BROWSERSTACK_ACCESSIBILITY";
|
|
47
|
+
export declare const BROWSERSTACK_OBSERVABILITY = "BROWSERSTACK_OBSERVABILITY";
|
|
45
48
|
export declare const MAX_GIT_META_DATA_SIZE_IN_BYTES: number;
|
|
46
49
|
export declare const GIT_META_DATA_TRUNCATED = "...[TRUNCATED]";
|
|
47
50
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,eAAO,MAAM,mBAAmB,qHAStB,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAI/B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,kBAAkB,CAKvD,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,OAAoC,CAAA;AAEvE,eAAO,MAAM,aAAa,qDAAqD,CAAA;AAC/E,eAAO,MAAM,mBAAmB,iBAAiB,CAAA;AACjD,eAAO,MAAM,mBAAmB,iBAAiB,CAAA;AACjD,eAAO,MAAM,wBAAwB,uBAAuB,CAAA;AAC5D,eAAO,MAAM,eAAe,OAAO,CAAA;AACnC,eAAO,MAAM,mBAAmB,OAAO,CAAA;AACvC,eAAO,MAAM,iBAAiB,UAAgH,CAAA;AAC9I,eAAO,MAAM,wCAAwC,OAAO,CAAA;AAC5D,eAAO,MAAM,yCAAyC,MAAM,CAAA;AAC5D,eAAO,MAAM,sBAAsB,KAAuB,CAAA;AAE1D,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M,wBAAwB,6BAA6B,CAAA;AAGlE,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAG9D,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AAGpE,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AAGpE,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAGpD,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAGxE,eAAO,MAAM,eAAe,6BAA6B,CAAA;AAGzD,eAAO,MAAM,SAAS,uBAAuB,CAAA;AAG7C,eAAO,MAAM,2BAA2B,+BAA+B,CAAA;AAGvE,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAGtD,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AAGtE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AAGtE,eAAO,MAAM,+BAA+B,QAAY,CAAA;AAKxD,eAAO,MAAM,uBAAuB,mBAAmB,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -33,7 +33,6 @@ export const BATCH_EVENT_TYPES = ['LogCreated', 'TestRunStarted', 'TestRunFinish
|
|
|
33
33
|
export const DEFAULT_WAIT_TIMEOUT_FOR_PENDING_UPLOADS = 5000; // 5s
|
|
34
34
|
export const DEFAULT_WAIT_INTERVAL_FOR_PENDING_UPLOADS = 100; // 100ms
|
|
35
35
|
export const BSTACK_SERVICE_VERSION = bstackServiceVersion;
|
|
36
|
-
export const ACCESSIBILITY_API_URL = 'https://accessibility.browserstack.com/api';
|
|
37
36
|
export const NOT_ALLOWED_KEYS_IN_CAPS = ['includeTagsInTestingScope', 'excludeTagsInTestingScope'];
|
|
38
37
|
export const LOGS_FILE = 'logs/bstack-wdio-service.log';
|
|
39
38
|
export const UPLOAD_LOGS_ADDRESS = 'https://upload-observability.browserstack.com';
|
|
@@ -64,13 +63,15 @@ export const TCG_INFO = {
|
|
|
64
63
|
};
|
|
65
64
|
// Env variables - Define all the env variable constants over here
|
|
66
65
|
// To store the JWT token returned the session launch
|
|
67
|
-
export const
|
|
66
|
+
export const BROWSERSTACK_TESTHUB_JWT = 'BROWSERSTACK_TESTHUB_JWT';
|
|
68
67
|
// To store tcg auth result for selfHealing feature:
|
|
69
68
|
export const BSTACK_TCG_AUTH_RESULT = 'BSTACK_TCG_AUTH_RESULT';
|
|
70
69
|
// To store the setting of whether to send screenshots or not
|
|
71
70
|
export const TESTOPS_SCREENSHOT_ENV = 'BS_TESTOPS_ALLOW_SCREENSHOTS';
|
|
72
71
|
// To store build hashed id
|
|
73
|
-
export const
|
|
72
|
+
export const BROWSERSTACK_TESTHUB_UUID = 'BROWSERSTACK_TESTHUB_UUID';
|
|
73
|
+
// To store test run uuid
|
|
74
|
+
export const TEST_ANALYTICS_ID = 'TEST_ANALYTICS_ID';
|
|
74
75
|
// Whether to collect performance instrumentation or not
|
|
75
76
|
export const PERF_MEASUREMENT_ENV = 'BROWSERSTACK_O11Y_PERF_MEASUREMENT';
|
|
76
77
|
// Whether the current run is rerun or not
|
|
@@ -79,6 +80,12 @@ export const RERUN_TESTS_ENV = 'BROWSERSTACK_RERUN_TESTS';
|
|
|
79
80
|
export const RERUN_ENV = 'BROWSERSTACK_RERUN';
|
|
80
81
|
// To store whether the build launch has completed or not
|
|
81
82
|
export const TESTOPS_BUILD_COMPLETED_ENV = 'BS_TESTOPS_BUILD_COMPLETED';
|
|
83
|
+
// Whether percy has started successfully or not
|
|
84
|
+
export const BROWSERSTACK_PERCY = 'BROWSERSTACK_PERCY';
|
|
85
|
+
// Whether session is a accessibility session
|
|
86
|
+
export const BROWSERSTACK_ACCESSIBILITY = 'BROWSERSTACK_ACCESSIBILITY';
|
|
87
|
+
// Whether session is a observability session
|
|
88
|
+
export const BROWSERSTACK_OBSERVABILITY = 'BROWSERSTACK_OBSERVABILITY';
|
|
82
89
|
// Maximum size of VCS info which is allowed
|
|
83
90
|
export const MAX_GIT_META_DATA_SIZE_IN_BYTES = 64 * 1024;
|
|
84
91
|
/* The value to be appended at the end if git metadata is larger than
|
package/build/crash-reporter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import got from 'got';
|
|
2
|
-
import { BSTACK_SERVICE_VERSION, DATA_ENDPOINT,
|
|
2
|
+
import { BSTACK_SERVICE_VERSION, DATA_ENDPOINT, BROWSERSTACK_TESTHUB_UUID } from './constants.js';
|
|
3
3
|
import { DEFAULT_REQUEST_CONFIG, getObservabilityKey, getObservabilityUser } from './util.js';
|
|
4
4
|
import { BStackLogger } from './bstackLogger.js';
|
|
5
5
|
export default class CrashReporter {
|
|
@@ -52,7 +52,7 @@ export default class CrashReporter {
|
|
|
52
52
|
this.userConfigForReporting = {};
|
|
53
53
|
}
|
|
54
54
|
const data = {
|
|
55
|
-
hashed_id: process.env[
|
|
55
|
+
hashed_id: process.env[BROWSERSTACK_TESTHUB_UUID],
|
|
56
56
|
observability_version: {
|
|
57
57
|
frameworkName: 'WebdriverIO-' + (this.userConfigForReporting.framework || 'null'),
|
|
58
58
|
sdkVersion: BSTACK_SERVICE_VERSION
|
package/build/exitHandler.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import BrowserStackConfig from './config.js';
|
|
4
4
|
import { saveFunnelData } from './instrumentation/funnelInstrumentation.js';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import {
|
|
6
|
+
import { BROWSERSTACK_TESTHUB_JWT } from './constants.js';
|
|
7
7
|
import { BStackLogger } from './bstackLogger.js';
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
@@ -42,7 +42,7 @@ export function setupExitHandlers() {
|
|
|
42
42
|
}
|
|
43
43
|
export function shouldCallCleanup(config) {
|
|
44
44
|
const args = [];
|
|
45
|
-
if (!!process.env[
|
|
45
|
+
if (!!process.env[BROWSERSTACK_TESTHUB_JWT] && !config.testObservability.buildStopped) {
|
|
46
46
|
args.push('--observability');
|
|
47
47
|
}
|
|
48
48
|
if (config.userName && config.accessKey && !config.funnelDataSent) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Frameworks } from '@wdio/types';
|
|
1
|
+
import type { Frameworks, Options } from '@wdio/types';
|
|
2
2
|
import type { BeforeCommandArgs, AfterCommandArgs } from '@wdio/reporter';
|
|
3
3
|
import type { Feature, Scenario, CucumberHook, CucumberHookParams, Pickle, ITestCaseHookParameter } from './cucumber-types.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BrowserstackConfig } from './types.js';
|
|
5
|
+
import type { TestData, TestMeta, CurrentRunInfo, StdLog, CBTData } from './types.js';
|
|
5
6
|
import type { Capabilities } from '@wdio/types';
|
|
6
7
|
declare class _InsightsHandler {
|
|
7
8
|
private _browser;
|
|
@@ -12,14 +13,15 @@ declare class _InsightsHandler {
|
|
|
12
13
|
private _commands;
|
|
13
14
|
private _gitConfigPath?;
|
|
14
15
|
private _suiteFile?;
|
|
15
|
-
|
|
16
|
+
static currentTest: CurrentRunInfo;
|
|
16
17
|
private _currentHook;
|
|
17
18
|
private _cucumberData;
|
|
18
19
|
private _userCaps?;
|
|
19
20
|
private listener;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser,
|
|
21
|
+
currentTestId: string | undefined;
|
|
22
|
+
cbtQueue: Array<CBTData>;
|
|
23
|
+
constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _framework?: string | undefined, _userCaps?: Capabilities.RemoteCapability, _options?: BrowserstackConfig & Options.Testrunner);
|
|
24
|
+
_isAppAutomate(): boolean;
|
|
23
25
|
registerListeners(): void;
|
|
24
26
|
setSuiteFile(filename: string): void;
|
|
25
27
|
before(): Promise<void>;
|
|
@@ -55,7 +57,7 @@ declare class _InsightsHandler {
|
|
|
55
57
|
private getTestRunId;
|
|
56
58
|
private getTestRunIdFromSuite;
|
|
57
59
|
private getTestRunDataForCucumber;
|
|
58
|
-
|
|
60
|
+
flushCBTDataQueue(): Promise<void>;
|
|
59
61
|
sendCBTInfo(): Promise<void>;
|
|
60
62
|
private getIntegrationsObject;
|
|
61
63
|
private getIdentifier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights-handler.d.ts","sourceRoot":"","sources":["../src/insights-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"insights-handler.d.ts","sourceRoot":"","sources":["../src/insights-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGzE,OAAO,KAAK,EAAiB,OAAO,EAAE,QAAQ,EAAsB,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGjK,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAiBpD,OAAO,KAAK,EACR,QAAQ,EACR,QAAQ,EAER,cAAc,EACd,MAAM,EACN,OAAO,EACV,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,cAAM,gBAAgB;IAmBL,OAAO,CAAC,QAAQ;IAAwD,OAAO,CAAC,UAAU,CAAC;IAlBxG,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,SAAS,CAA2D;IAC5E,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAc,WAAW,EAAE,cAAc,CAAK;IAC9C,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,aAAa,CAIpB;IACD,OAAO,CAAC,SAAS,CAAC,CAAoC;IAC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