@wdio/browserstack-service 8.40.6 → 8.42.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.
Files changed (59) hide show
  1. package/build/Percy/Percy-Handler.d.ts.map +1 -1
  2. package/build/Percy/Percy-Handler.js +5 -0
  3. package/build/Percy/Percy.d.ts.map +1 -1
  4. package/build/Percy/Percy.js +16 -1
  5. package/build/Percy/PercyBinary.d.ts.map +1 -1
  6. package/build/Percy/PercyBinary.js +11 -0
  7. package/build/Percy/PercySDK.d.ts.map +1 -1
  8. package/build/Percy/PercySDK.js +50 -4
  9. package/build/accessibility-handler.d.ts +3 -1
  10. package/build/accessibility-handler.d.ts.map +1 -1
  11. package/build/accessibility-handler.js +67 -49
  12. package/build/cleanup.d.ts.map +1 -1
  13. package/build/cleanup.js +14 -4
  14. package/build/config.d.ts.map +1 -1
  15. package/build/config.js +2 -0
  16. package/build/constants.d.ts +11 -3
  17. package/build/constants.d.ts.map +1 -1
  18. package/build/constants.js +15 -3
  19. package/build/crash-reporter.js +2 -2
  20. package/build/exitHandler.d.ts.map +1 -1
  21. package/build/exitHandler.js +10 -2
  22. package/build/insights-handler.d.ts +5 -5
  23. package/build/insights-handler.d.ts.map +1 -1
  24. package/build/insights-handler.js +24 -18
  25. package/build/instrumentation/funnelInstrumentation.d.ts.map +1 -1
  26. package/build/instrumentation/funnelInstrumentation.js +23 -11
  27. package/build/instrumentation/performance/constants.d.ts +79 -0
  28. package/build/instrumentation/performance/constants.d.ts.map +1 -0
  29. package/build/instrumentation/performance/constants.js +78 -0
  30. package/build/instrumentation/performance/performance-tester.d.ts +44 -0
  31. package/build/instrumentation/performance/performance-tester.d.ts.map +1 -0
  32. package/build/instrumentation/performance/performance-tester.js +280 -0
  33. package/build/launcher.d.ts.map +1 -1
  34. package/build/launcher.js +117 -69
  35. package/build/reporter.d.ts +1 -1
  36. package/build/reporter.d.ts.map +1 -1
  37. package/build/reporter.js +8 -5
  38. package/build/scripts/accessibility-scripts.d.ts +3 -7
  39. package/build/scripts/accessibility-scripts.d.ts.map +1 -1
  40. package/build/scripts/accessibility-scripts.js +27 -3
  41. package/build/service.d.ts.map +1 -1
  42. package/build/service.js +89 -33
  43. package/build/testHub/utils.d.ts +7 -0
  44. package/build/testHub/utils.d.ts.map +1 -0
  45. package/build/testHub/utils.js +57 -0
  46. package/build/testOps/listener.d.ts +6 -0
  47. package/build/testOps/listener.d.ts.map +1 -1
  48. package/build/testOps/listener.js +38 -1
  49. package/build/testOps/requestUtils.js +3 -3
  50. package/build/types.d.ts +34 -1
  51. package/build/types.d.ts.map +1 -1
  52. package/build/util.d.ts +34 -12
  53. package/build/util.d.ts.map +1 -1
  54. package/build/util.js +290 -180
  55. package/package.json +7 -7
  56. package/tsconfig.prod.tsbuildinfo +1 -1
  57. package/build/performance-tester.d.ts +0 -14
  58. package/build/performance-tester.d.ts.map +0 -1
  59. package/build/performance-tester.js +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"Percy-Handler.d.ts","sourceRoot":"","sources":["../../src/Percy/Percy-Handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAazE,cAAM,aAAa;IAUX,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,UAAU,CAAC;IAbvB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,iCAAiC,CAAC,CAAiB;IAC3D,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,yBAAyB,CAAU;IAC3C,OAAO,CAAC,wBAAwB,CAAY;IAC5C,OAAO,CAAC,gBAAgB,CAAC,CAAiB;gBAG9B,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;IAC3D,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,yBAAyB,CAAU;IAC3C,OAAO,CAAC,wBAAwB,CAAY;IAC5C,OAAO,CAAC,gBAAgB,CAAC,CAAiB;gBAG9B,qBAAqB,EAAE,MAAM,GAAG,SAAS,EACzC,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC9D,aAAa,EAAE,YAAY,CAAC,gBAAgB,EAC5C,cAAc,CAAC,EAAE,OAAO,YAAA,EACxB,UAAU,CAAC,EAAE,MAAM,YAAA;IAO/B,eAAe,CAAC,IAAI,EAAE,MAAM;IAItB,QAAQ;IAUR,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAsBrE,MAAM;IAIZ,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAM1D,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO;IA+BhD,0BAA0B;IAS1B,oBAAoB,CAAE,IAAI,EAAE,iBAAiB;IAoB7C,mBAAmB,CAAE,IAAI,EAAE,iBAAiB,GAAG,gBAAgB;IA0B/D,SAAS;IAMT,aAAa;CAKtB;AAGD,QAAA,MAAM,YAAY,EAAE,OAAO,aAAoD,CAAA;AAC/E,KAAK,YAAY,GAAG,aAAa,CAAA;AAEjC,eAAe,YAAY,CAAA"}
@@ -3,6 +3,8 @@ import PercyCaptureMap from './PercyCaptureMap.js';
3
3
  import * as PercySDK from './PercySDK.js';
4
4
  import { PercyLogger } from './PercyLogger.js';
5
5
  import { PERCY_DOM_CHANGING_COMMANDS_ENDPOINTS, CAPTURE_MODES } from '../constants.js';
6
+ import PerformanceTester from '../instrumentation/performance/performance-tester.js';
7
+ import * as PERFORMANCE_SDK_EVENTS from '../instrumentation/performance/constants.js';
6
8
  class _PercyHandler {
7
9
  _percyAutoCaptureMode;
8
10
  _browser;
@@ -39,6 +41,7 @@ class _PercyHandler {
39
41
  });
40
42
  }
41
43
  async percyAutoCapture(eventName, sessionName) {
44
+ PerformanceTester.start(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.AUTO_CAPTURE);
42
45
  try {
43
46
  if (eventName) {
44
47
  if (!sessionName) {
@@ -53,8 +56,10 @@ class _PercyHandler {
53
56
  catch (err) {
54
57
  this._percyScreenshotCounter -= 1;
55
58
  this._percyCaptureMap?.decrement(sessionName ? sessionName : this._sessionName, eventName);
59
+ PerformanceTester.end(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.AUTO_CAPTURE, false, err, { eventName, sessionName });
56
60
  PercyLogger.error(`Error while trying to auto capture Percy screenshot ${err}`);
57
61
  }
62
+ PerformanceTester.end(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.AUTO_CAPTURE, true, null, { eventName, sessionName });
58
63
  }
59
64
  async before() {
60
65
  this._percyCaptureMap = new PercyCaptureMap();
@@ -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;AAI1C,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"}
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;AAO1C,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;IAaX,KAAK;IA4CL,IAAI;IAWV,SAAS;IAIH,eAAe;IAoCf,iBAAiB;CA8B1B;AAED,eAAe,KAAK,CAAA"}
@@ -1,3 +1,9 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import fs from 'node:fs';
2
8
  import path from 'node:path';
3
9
  import os from 'node:os';
@@ -5,6 +11,9 @@ import { spawn } from 'node:child_process';
5
11
  import { nodeRequest, getBrowserStackUser, getBrowserStackKey, sleep } from '../util.js';
6
12
  import { PercyLogger } from './PercyLogger.js';
7
13
  import PercyBinary from './PercyBinary.js';
14
+ import { BROWSERSTACK_TESTHUB_UUID } from '../constants.js';
15
+ import PerformanceTester from '../instrumentation/performance/performance-tester.js';
16
+ import * as PERFORMANCE_SDK_EVENTS from '../instrumentation/performance/constants.js';
8
17
  const logDir = 'logs';
9
18
  class Percy {
10
19
  #logfile = path.join(logDir, 'percy.log');
@@ -59,7 +68,7 @@ class Percy {
59
68
  if (configPath) {
60
69
  commandArgs.push('-c', configPath);
61
70
  }
62
- this.#proc = spawn(binaryPath, commandArgs, { env: { ...process.env, PERCY_TOKEN: token } });
71
+ this.#proc = spawn(binaryPath, commandArgs, { env: { ...process.env, PERCY_TOKEN: token, TH_BUILD_UUID: process.env[BROWSERSTACK_TESTHUB_UUID] } });
63
72
  this.#proc.stdout.pipe(logStream);
64
73
  this.#proc.stderr.pipe(logStream);
65
74
  this.isProcessRunning = true;
@@ -144,4 +153,10 @@ class Percy {
144
153
  });
145
154
  }
146
155
  }
156
+ __decorate([
157
+ PerformanceTester.Measure(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.START)
158
+ ], Percy.prototype, "start", null);
159
+ __decorate([
160
+ PerformanceTester.Measure(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.STOP)
161
+ ], Percy.prototype, "stop", null);
147
162
  export default Percy;
@@ -1 +1 @@
1
- {"version":3,"file":"PercyBinary.d.ts","sourceRoot":"","sources":["../../src/Percy/PercyBinary.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAM,WAAW;;;IAmDP,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBxD,cAAc,CAAC,UAAU,EAAE,MAAM;IAiBjC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;CAmEjE;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"PercyBinary.d.ts","sourceRoot":"","sources":["../../src/Percy/PercyBinary.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C,cAAM,WAAW;;;IAmDP,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBxD,cAAc,CAAC,UAAU,EAAE,MAAM;IAkBjC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;CAmEjE;AAED,eAAe,WAAW,CAAA"}
@@ -1,3 +1,9 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import url from 'node:url';
2
8
  import yauzl from 'yauzl';
3
9
  import fs from 'node:fs';
@@ -7,6 +13,8 @@ import path from 'node:path';
7
13
  import os from 'node:os';
8
14
  import { spawn } from 'node:child_process';
9
15
  import { PercyLogger } from './PercyLogger.js';
16
+ import PerformanceTester from '../instrumentation/performance/performance-tester.js';
17
+ import * as PERFORMANCE_SDK_EVENTS from '../instrumentation/performance/constants.js';
10
18
  class PercyBinary {
11
19
  #hostOS = process.platform;
12
20
  #httpPath = null;
@@ -146,4 +154,7 @@ class PercyBinary {
146
154
  });
147
155
  }
148
156
  }
157
+ __decorate([
158
+ PerformanceTester.Measure(PERFORMANCE_SDK_EVENTS.PERCY_EVENTS.DOWNLOAD)
159
+ ], PercyBinary.prototype, "download", null);
149
160
  export default PercyBinary;
@@ -1 +1 @@
1
- {"version":3,"file":"PercySDK.d.ts","sourceRoot":"","sources":["../../src/Percy/PercySDK.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,QAAQ,YAVW,GAAG,EAAE,SAUE,CAAA;AASvC,eAAO,MAAM,UAAU,YANiB,GAAG,EAAE,kBAMF,CAAA;AAS3C,eAAO,MAAM,aAAa,YANiB,GAAG,EAAE,kBAMC,CAAA"}
1
+ {"version":3,"file":"PercySDK.d.ts","sourceRoot":"","sources":["../../src/Percy/PercySDK.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,QAAQ,YAnBW,GAAG,EAAE,SAmBE,CAAA;AAyCvC,eAAO,MAAM,UAAU,YARiB,GAAG,EAAE,kBAQF,CAAA;AAW3C,eAAO,MAAM,aAAa,YARiB,GAAG,EAAE,kBAQC,CAAA"}
@@ -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,60 @@ let snapshotHandler = (...args) => {
14
17
  PercyLogger.error('Unsupported driver for percy');
15
18
  };
16
19
  if (percySnapshot) {
17
- snapshotHandler = (browser, name) => {
20
+ snapshotHandler = (browser, snapshotName, options) => {
18
21
  if (process.env.PERCY_SNAPSHOT === 'true') {
19
- return percySnapshot(browser, name);
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
+ };
31
+ return percySnapshot(browser, snapshotName, options);
20
32
  }
21
33
  };
22
34
  }
23
35
  export const snapshot = snapshotHandler;
36
+ /*
37
+ This is a helper method which appends some internal fields
38
+ to the options object being sent to Percy methods
39
+ */
40
+ const screenshotHelper = (type, driverOrName, nameOrOptions, options) => {
41
+ let { name, uuid } = InsightsHandler.currentTest;
42
+ if (isUndefined(name)) {
43
+ ({ name, uuid } = TestReporter.currentTest);
44
+ }
45
+ if (!driverOrName || typeof driverOrName === 'string') {
46
+ nameOrOptions ||= {};
47
+ if (typeof nameOrOptions === 'object') {
48
+ nameOrOptions = {
49
+ ...nameOrOptions,
50
+ testCase: name || ''
51
+ };
52
+ }
53
+ }
54
+ else {
55
+ options ||= {};
56
+ options = {
57
+ ...options,
58
+ testCase: name || ''
59
+ };
60
+ }
61
+ if (type === 'app') {
62
+ return percyAppScreenshot(driverOrName, nameOrOptions, options);
63
+ }
64
+ return percySnapshot.percyScreenshot(driverOrName, nameOrOptions, options);
65
+ };
24
66
  /* eslint-disable @typescript-eslint/no-unused-vars */
25
67
  let screenshotHandler = async (...args) => {
26
68
  PercyLogger.error('Unsupported driver for percy');
27
69
  };
28
70
  if (percySnapshot && percySnapshot.percyScreenshot) {
29
- screenshotHandler = percySnapshot.percyScreenshot;
71
+ screenshotHandler = (browser, screenshotName, options) => {
72
+ return screenshotHelper('web', browser, screenshotName, options);
73
+ };
30
74
  }
31
75
  export const screenshot = screenshotHandler;
32
76
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -34,6 +78,8 @@ let screenshotAppHandler = async (...args) => {
34
78
  PercyLogger.error('Unsupported driver for percy');
35
79
  };
36
80
  if (percyAppScreenshot) {
37
- screenshotAppHandler = percyAppScreenshot;
81
+ screenshotAppHandler = (driverOrName, nameOrOptions, options) => {
82
+ return screenshotHelper('app', driverOrName, nameOrOptions, options);
83
+ };
38
84
  }
39
85
  export const screenshotApp = screenshotAppHandler;
@@ -3,6 +3,7 @@ import type { ITestCaseHookParameter } from './cucumber-types.js';
3
3
  declare class _AccessibilityHandler {
4
4
  private _browser;
5
5
  private _capabilities;
6
+ private isAppAutomate;
6
7
  private _framework?;
7
8
  private _accessibilityAutomation?;
8
9
  private _accessibilityOpts?;
@@ -14,7 +15,8 @@ declare class _AccessibilityHandler {
14
15
  private _testMetadata;
15
16
  private static _a11yScanSessionMap;
16
17
  private _sessionId;
17
- constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate?: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
18
+ private listener;
19
+ constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
18
20
  [key: string]: any;
19
21
  } | undefined);
20
22
  setSuiteFile(filename: string): void;
@@ -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;AAmBjE,cAAM,qBAAqB;IAWnB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,UAAU,CAAC;IACnB,OAAO,CAAC,wBAAwB,CAAC;IACjC,OAAO,CAAC,kBAAkB,CAAC;IAf/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,CAAC,MAAM,CAAC,mBAAmB,CAA8B;IAChE,OAAO,CAAC,UAAU,CAAsB;gBAG5B,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC9D,aAAa,EAAE,YAAY,CAAC,gBAAgB,EACpD,aAAa,CAAC,EAAE,OAAO,EACf,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,wBAAwB,CAAC,GAAE,OAAO,GAAG,MAAM,aAAA,EAC3C,kBAAkB,CAAC,E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AK,oBAAoB,GAAG,qBAAqB,CAAA;AAEjD,eAAe,oBAAoB,CAAA"}
@@ -1,10 +1,14 @@
1
1
  import util from 'node:util';
2
- import { getA11yResultsSummary, getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, isTrue } from './util.js';
2
+ import Listener from './testOps/listener.js';
3
+ import { getA11yResultsSummary, getAppA11yResultsSummary, getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isAppAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, isTrue, validateCapsWithAppA11y, getAppA11yResults } from './util.js';
3
4
  import accessibilityScripts from './scripts/accessibility-scripts.js';
5
+ import PerformanceTester from './instrumentation/performance/performance-tester.js';
6
+ import * as PERFORMANCE_SDK_EVENTS from './instrumentation/performance/constants.js';
4
7
  import { BStackLogger } from './bstackLogger.js';
5
8
  class _AccessibilityHandler {
6
9
  _browser;
7
10
  _capabilities;
11
+ isAppAutomate;
8
12
  _framework;
9
13
  _accessibilityAutomation;
10
14
  _accessibilityOpts;
@@ -16,9 +20,11 @@ class _AccessibilityHandler {
16
20
  _testMetadata = {};
17
21
  static _a11yScanSessionMap = {};
18
22
  _sessionId = null;
23
+ listener = Listener.getInstance();
19
24
  constructor(_browser, _capabilities, isAppAutomate, _framework, _accessibilityAutomation, _accessibilityOpts) {
20
25
  this._browser = _browser;
21
26
  this._capabilities = _capabilities;
27
+ this.isAppAutomate = isAppAutomate;
22
28
  this._framework = _framework;
23
29
  this._accessibilityAutomation = _accessibilityAutomation;
24
30
  this._accessibilityOpts = _accessibilityOpts;
@@ -26,6 +32,8 @@ class _AccessibilityHandler {
26
32
  this._platformA11yMeta = {
27
33
  browser_name: caps.browserName,
28
34
  browser_version: caps?.browserVersion || caps?.version || 'latest',
35
+ platform_name: caps?.platformName,
36
+ platform_version: this._getCapabilityValue(caps, 'appium:platformVersion', 'platformVersion'),
29
37
  os_name: this._getCapabilityValue(_capabilities, 'os', 'os'),
30
38
  os_version: this._getCapabilityValue(_capabilities, 'osVersion', 'os_version')
31
39
  };
@@ -74,19 +82,30 @@ class _AccessibilityHandler {
74
82
  async before(sessionId) {
75
83
  this._sessionId = sessionId;
76
84
  this._accessibility = isTrue(this._getCapabilityValue(this._caps, 'accessibility', 'browserstack.accessibility'));
77
- if (isBrowserstackSession(this._browser) && isAccessibilityAutomationSession(this._accessibility)) {
78
- const deviceName = this._getCapabilityValue(this._caps, 'deviceName', 'device');
79
- const chromeOptions = this._getCapabilityValue(this._caps, 'goog:chromeOptions', '');
80
- this._accessibility = validateCapsWithA11y(deviceName, this._platformA11yMeta, chromeOptions);
85
+ if (isBrowserstackSession(this._browser)) {
86
+ if (isAccessibilityAutomationSession(this._accessibility) && !this.isAppAutomate) {
87
+ const deviceName = this._getCapabilityValue(this._caps, 'deviceName', 'device');
88
+ const chromeOptions = this._getCapabilityValue(this._caps, 'goog:chromeOptions', '');
89
+ this._accessibility = validateCapsWithA11y(deviceName, this._platformA11yMeta, chromeOptions);
90
+ }
91
+ if (isAppAccessibilityAutomationSession(this._accessibility, this.isAppAutomate)) {
92
+ this._accessibility = validateCapsWithAppA11y(this._platformA11yMeta);
93
+ }
81
94
  }
82
95
  this._browser.getAccessibilityResultsSummary = async () => {
83
- return await getA11yResultsSummary(this._browser, isBrowserstackSession(this._browser), this._accessibility);
96
+ if (isAppAccessibilityAutomationSession(this._accessibility, this.isAppAutomate)) {
97
+ return await getAppA11yResultsSummary(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility, this._sessionId);
98
+ }
99
+ return await getA11yResultsSummary(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility);
84
100
  };
85
101
  this._browser.getAccessibilityResults = async () => {
86
- return await getA11yResults(this._browser, isBrowserstackSession(this._browser), this._accessibility);
102
+ if (isAppAccessibilityAutomationSession(this._accessibility, this.isAppAutomate)) {
103
+ return await getAppA11yResults(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility, this._sessionId);
104
+ }
105
+ return await getA11yResults(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility);
87
106
  };
88
107
  this._browser.performScan = async () => {
89
- return await performA11yScan(this._browser, isBrowserstackSession(this._browser), this._accessibility);
108
+ return await performA11yScan(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility);
90
109
  };
91
110
  if (!this._accessibility) {
92
111
  return;
@@ -105,18 +124,22 @@ class _AccessibilityHandler {
105
124
  try {
106
125
  if (this._framework !== 'mocha' ||
107
126
  !this.shouldRunTestHooks(this._browser, this._accessibility)) {
127
+ /* This is to be used when test events are sent */
128
+ Listener.setTestRunAccessibilityVar(false);
108
129
  return;
109
130
  }
110
131
  const shouldScanTest = shouldScanTestForAccessibility(suiteTitle, test.title, this._accessibilityOptions);
111
132
  const testIdentifier = this.getIdentifier(test);
112
- const isPageOpened = await this.checkIfPageOpened(this._browser, testIdentifier, shouldScanTest);
113
133
  if (this._sessionId) {
114
134
  /* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
115
135
  AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanTest;
116
136
  }
117
- if (!isPageOpened) {
118
- return;
119
- }
137
+ /* This is to be used when test events are sent */
138
+ Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanTest);
139
+ this._testMetadata[testIdentifier] = {
140
+ scanTestForAccessibility: shouldScanTest,
141
+ accessibilityScanStarted: true
142
+ };
120
143
  this._testMetadata[testIdentifier].accessibilityScanStarted = shouldScanTest;
121
144
  if (shouldScanTest) {
122
145
  BStackLogger.info('Automate test case execution has started.');
@@ -141,19 +164,12 @@ class _AccessibilityHandler {
141
164
  }
142
165
  if (shouldScanTestForAccessibility) {
143
166
  BStackLogger.info('Automate test case execution has ended. Processing for accessibility testing is underway. ');
144
- }
145
- const dataForExtension = {
146
- saveResults: shouldScanTestForAccessibility,
147
- testDetails: {
148
- 'name': test.title,
149
- 'testRunId': process.env.BS_A11Y_TEST_RUN_ID,
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) {
167
+ const dataForExtension = {
168
+ 'thTestRunUuid': process.env.TEST_ANALYTICS_ID,
169
+ 'thBuildUuid': process.env.BROWSERSTACK_TESTHUB_UUID,
170
+ 'thJwtToken': process.env.BROWSERSTACK_TESTHUB_JWT
171
+ };
172
+ await this.sendTestStopEvent(this._browser, dataForExtension);
157
173
  BStackLogger.info('Accessibility testing for this test case has ended.');
158
174
  }
159
175
  }
@@ -170,19 +186,23 @@ class _AccessibilityHandler {
170
186
  const featureData = gherkinDocument.feature;
171
187
  const uniqueId = getUniqueIdentifierForCucumber(world);
172
188
  if (!this.shouldRunTestHooks(this._browser, this._accessibility)) {
189
+ /* This is to be used when test events are sent */
190
+ Listener.setTestRunAccessibilityVar(false);
173
191
  return;
174
192
  }
175
193
  try {
176
194
  const shouldScanScenario = shouldScanTestForAccessibility(featureData?.name, pickleData.name, this._accessibilityOptions, world, true);
177
- const isPageOpened = await this.checkIfPageOpened(this._browser, uniqueId, shouldScanScenario);
195
+ this._testMetadata[uniqueId] = {
196
+ scanTestForAccessibility: shouldScanScenario,
197
+ accessibilityScanStarted: true
198
+ };
199
+ this._testMetadata[uniqueId].accessibilityScanStarted = shouldScanScenario;
178
200
  if (this._sessionId) {
179
201
  /* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
180
202
  AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanScenario;
181
203
  }
182
- if (!isPageOpened) {
183
- return;
184
- }
185
- this._testMetadata[uniqueId].accessibilityScanStarted = shouldScanScenario;
204
+ /* This is to be used when test events are sent */
205
+ Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanScenario);
186
206
  if (shouldScanScenario) {
187
207
  BStackLogger.info('Automate test case execution has started.');
188
208
  }
@@ -198,8 +218,6 @@ class _AccessibilityHandler {
198
218
  }
199
219
  const pickleData = world.pickle;
200
220
  try {
201
- const gherkinDocument = world.gherkinDocument;
202
- const featureData = gherkinDocument.feature;
203
221
  const uniqueId = getUniqueIdentifierForCucumber(world);
204
222
  const accessibilityScanStarted = this._testMetadata[uniqueId]?.accessibilityScanStarted;
205
223
  const shouldScanTestForAccessibility = this._testMetadata[uniqueId]?.scanTestForAccessibility;
@@ -208,19 +226,12 @@ class _AccessibilityHandler {
208
226
  }
209
227
  if (shouldScanTestForAccessibility) {
210
228
  BStackLogger.info('Automate test case execution has ended. Processing for accessibility testing is underway. ');
211
- }
212
- const dataForExtension = {
213
- saveResults: shouldScanTestForAccessibility,
214
- testDetails: {
215
- 'name': pickleData.name,
216
- 'testRunId': process.env.BS_A11Y_TEST_RUN_ID,
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) {
229
+ const dataForExtension = {
230
+ 'thTestRunUuid': process.env.TEST_ANALYTICS_ID,
231
+ 'thBuildUuid': process.env.BROWSERSTACK_TESTHUB_UUID,
232
+ 'thJwtToken': process.env.BROWSERSTACK_TESTHUB_JWT
233
+ };
234
+ await this.sendTestStopEvent(this._browser, dataForExtension);
224
235
  BStackLogger.info('Accessibility testing for this test case has ended.');
225
236
  }
226
237
  }
@@ -236,15 +247,22 @@ class _AccessibilityHandler {
236
247
  (!command.name.includes('execute') ||
237
248
  !AccessibilityHandler.shouldPatchExecuteScript(args.length ? args[0] : null))) {
238
249
  BStackLogger.debug(`Performing scan for ${command.class} ${command.name}`);
239
- await performA11yScan(this._browser, true, true, command.name);
250
+ await performA11yScan(this.isAppAutomate, this._browser, true, true, command.name);
240
251
  }
241
252
  return origFunction(...args);
242
253
  }
243
254
  async sendTestStopEvent(browser, dataForExtension) {
244
255
  BStackLogger.debug('Performing scan before saving results');
245
- await performA11yScan(browser, true, true);
246
- const results = await browser.executeAsync(accessibilityScripts.saveTestResults, dataForExtension);
247
- BStackLogger.debug(util.format(results));
256
+ await PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.A11Y_EVENTS.PERFORM_SCAN, async () => {
257
+ await performA11yScan(this.isAppAutomate, browser, true, true);
258
+ }, { command: 'afterTest' })();
259
+ if (isAppAccessibilityAutomationSession(this._accessibility, this.isAppAutomate)) {
260
+ return;
261
+ }
262
+ await PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.A11Y_EVENTS.SAVE_RESULTS, async () => {
263
+ const results = await browser.executeAsync(accessibilityScripts.saveTestResults, dataForExtension);
264
+ BStackLogger.debug(util.format(results));
265
+ })();
248
266
  }
249
267
  getIdentifier(test) {
250
268
  if ('pickle' in test) {
@@ -1 +1 @@
1
- {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,aAAa;WACjB,YAAY;WAuBZ,2BAA2B,CAAC,UAAU,EAAE,GAAG;IAoBxD,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,OAAmB;WAkBxE,cAAc,CAAC,UAAU,EAAE,GAAG;IAS3C,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM;IAY7C,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;CAMhD"}
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,OAAO,aAAa;WACjB,YAAY;WA+BZ,2BAA2B,CAAC,UAAU,EAAE,GAAG;IAoBxD,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,OAAmB;WAkBxE,cAAc,CAAC,UAAU,EAAE,GAAG;IAS3C,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM;IAY7C,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;CAMhD"}
package/build/cleanup.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { getErrorString, stopBuildUpstream } from './util.js';
2
2
  import { BStackLogger } from './bstackLogger.js';
3
3
  import fs from 'node:fs';
4
+ import util from 'node:util';
4
5
  import { fireFunnelRequest } from './instrumentation/funnelInstrumentation.js';
5
- import { TESTOPS_BUILD_ID_ENV, TESTOPS_JWT_ENV } from './constants.js';
6
+ import { BROWSERSTACK_TESTHUB_UUID, BROWSERSTACK_TESTHUB_JWT, BROWSERSTACK_OBSERVABILITY } from './constants.js';
7
+ import PerformanceTester from './instrumentation/performance/performance-tester.js';
6
8
  export default class BStackCleanup {
7
9
  static async startCleanup() {
8
10
  try {
@@ -25,17 +27,25 @@ export default class BStackCleanup {
25
27
  const error = err;
26
28
  BStackLogger.error(error);
27
29
  }
30
+ try {
31
+ if (process.argv.includes('--performanceData')) {
32
+ await PerformanceTester.uploadEventsData();
33
+ }
34
+ }
35
+ catch (er) {
36
+ BStackLogger.debug(`Error in sending events data ${util.format(er)}`);
37
+ }
28
38
  }
29
39
  static async executeObservabilityCleanup(funnelData) {
30
- if (!process.env[TESTOPS_JWT_ENV]) {
40
+ if (!process.env[BROWSERSTACK_TESTHUB_JWT]) {
31
41
  return;
32
42
  }
33
43
  BStackLogger.debug('Executing observability cleanup');
34
44
  try {
35
45
  const killSignal = funnelData?.event_properties?.finishedMetadata?.signal;
36
46
  const result = await stopBuildUpstream(killSignal);
37
- if (process.env[TESTOPS_BUILD_ID_ENV]) {
38
- BStackLogger.info(`\nVisit https://observability.browserstack.com/builds/${process.env[TESTOPS_BUILD_ID_ENV]} to view build report, insights, and many more debugging information all at one place!\n`);
47
+ if (process.env[BROWSERSTACK_OBSERVABILITY] && process.env[BROWSERSTACK_TESTHUB_UUID]) {
48
+ 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
49
  }
40
50
  const status = (result && result.status) || 'failed';
41
51
  const message = (result && result.message);
@@ -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,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,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,MAAM;CAI5B;AAED,eAAe,kBAAkB,CAAA"}
package/build/config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import TestOpsConfig from './testOps/testOpsConfig.js';
2
2
  import { isUndefined } from './util.js';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
+ import { BStackLogger } from './bstackLogger.js';
4
5
  class BrowserStackConfig {
5
6
  static getInstance(options, config) {
6
7
  if (!this._instance && options && config) {
@@ -38,6 +39,7 @@ class BrowserStackConfig {
38
39
  this.automate = !this.appAutomate;
39
40
  this.buildIdentifier = options.buildIdentifier;
40
41
  this.sdkRunID = uuidv4();
42
+ BStackLogger.info(`BrowserStack service started with id: ${this.sdkRunID}`);
41
43
  }
42
44
  sentFunnelData() {
43
45
  this.funnelDataSent = true;
@@ -4,6 +4,9 @@ export declare const VALID_APP_EXTENSION: string[];
4
4
  export declare const DEFAULT_OPTIONS: Partial<BrowserstackConfig>;
5
5
  export declare const consoleHolder: typeof console;
6
6
  export declare const DATA_ENDPOINT = "https://collector-observability.browserstack.com";
7
+ export declare const APP_ALLY_ENDPOINT = "https://app-accessibility.browserstack.com/automate";
8
+ export declare const APP_ALLY_ISSUES_ENDPOINT = "api/v1/issues";
9
+ export declare const APP_ALLY_ISSUES_SUMMARY_ENDPOINT = "api/v1/issues-summary";
7
10
  export declare const DATA_EVENT_ENDPOINT = "api/v1/event";
8
11
  export declare const DATA_BATCH_ENDPOINT = "api/v1/batch";
9
12
  export declare const DATA_SCREENSHOT_ENDPOINT = "api/v1/screenshots";
@@ -13,7 +16,6 @@ export declare const BATCH_EVENT_TYPES: string[];
13
16
  export declare const DEFAULT_WAIT_TIMEOUT_FOR_PENDING_UPLOADS = 5000;
14
17
  export declare const DEFAULT_WAIT_INTERVAL_FOR_PENDING_UPLOADS = 100;
15
18
  export declare const BSTACK_SERVICE_VERSION: any;
16
- export declare const ACCESSIBILITY_API_URL = "https://accessibility.browserstack.com/api";
17
19
  export declare const NOT_ALLOWED_KEYS_IN_CAPS: string[];
18
20
  export declare const LOGS_FILE = "logs/bstack-wdio-service.log";
19
21
  export declare const UPLOAD_LOGS_ADDRESS = "https://upload-observability.browserstack.com";
@@ -28,20 +30,26 @@ export declare const LOG_KIND_USAGE_MAP: {
28
30
  HTTP: string;
29
31
  };
30
32
  export declare const FUNNEL_INSTRUMENTATION_URL = "https://api.browserstack.com/sdk/v1/event";
33
+ export declare const EDS_URL = "https://eds.browserstack.com";
31
34
  export declare const SUPPORTED_BROWSERS_FOR_AI: string[];
32
35
  export declare const TCG_URL = "https://tcg.browserstack.com";
33
36
  export declare const TCG_INFO: {
34
37
  tcgRegion: string;
35
38
  tcgUrl: string;
36
39
  };
37
- export declare const TESTOPS_JWT_ENV = "BS_TESTOPS_JWT";
40
+ export declare const BROWSERSTACK_TESTHUB_JWT = "BROWSERSTACK_TESTHUB_JWT";
38
41
  export declare const BSTACK_TCG_AUTH_RESULT = "BSTACK_TCG_AUTH_RESULT";
39
42
  export declare const TESTOPS_SCREENSHOT_ENV = "BS_TESTOPS_ALLOW_SCREENSHOTS";
40
- export declare const TESTOPS_BUILD_ID_ENV = "BS_TESTOPS_BUILD_HASHED_ID";
43
+ export declare const BROWSERSTACK_TESTHUB_UUID = "BROWSERSTACK_TESTHUB_UUID";
44
+ export declare const TEST_ANALYTICS_ID = "TEST_ANALYTICS_ID";
41
45
  export declare const PERF_MEASUREMENT_ENV = "BROWSERSTACK_O11Y_PERF_MEASUREMENT";
42
46
  export declare const RERUN_TESTS_ENV = "BROWSERSTACK_RERUN_TESTS";
43
47
  export declare const RERUN_ENV = "BROWSERSTACK_RERUN";
44
48
  export declare const TESTOPS_BUILD_COMPLETED_ENV = "BS_TESTOPS_BUILD_COMPLETED";
49
+ export declare const BROWSERSTACK_PERCY = "BROWSERSTACK_PERCY";
50
+ export declare const BSTACK_A11Y_POLLING_TIMEOUT = "BSTACK_A11Y_POLLING_TIMEOUT";
51
+ export declare const BROWSERSTACK_ACCESSIBILITY = "BROWSERSTACK_ACCESSIBILITY";
52
+ export declare const BROWSERSTACK_OBSERVABILITY = "BROWSERSTACK_OBSERVABILITY";
45
53
  export declare const MAX_GIT_META_DATA_SIZE_IN_BYTES: number;
46
54
  export declare const GIT_META_DATA_TRUNCATED = "...[TRUNCATED]";
47
55
  //# sourceMappingURL=constants.d.ts.map
@@ -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,eAAO,MAAM,qBAAqB,+CAA+C,CAAA;AACjF,eAAO,MAAM,wBAAwB,UAA6D,CAAA;AAElG,eAAO,MAAM,SAAS,iCAAiC,CAAA;AACvD,eAAO,MAAM,mBAAmB,kDAAkD,CAAA;AAClF,eAAO,MAAM,oBAAoB,uBAAuB,CAAA;AAExD,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAE/C,eAAO,MAAM,qCAAqC,UAQjD,CAAA;AAED,eAAO,MAAM,aAAa,UAAwD,CAAA;A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