@wdio/browserstack-service 8.41.0 → 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 (43) 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 +14 -0
  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 +3 -6
  9. package/build/accessibility-handler.d.ts +2 -1
  10. package/build/accessibility-handler.d.ts.map +1 -1
  11. package/build/accessibility-handler.js +45 -21
  12. package/build/cleanup.d.ts.map +1 -1
  13. package/build/cleanup.js +10 -0
  14. package/build/config.d.ts.map +1 -1
  15. package/build/config.js +2 -0
  16. package/build/constants.d.ts +5 -0
  17. package/build/constants.d.ts.map +1 -1
  18. package/build/constants.js +5 -0
  19. package/build/exitHandler.d.ts.map +1 -1
  20. package/build/exitHandler.js +8 -0
  21. package/build/instrumentation/funnelInstrumentation.d.ts.map +1 -1
  22. package/build/instrumentation/funnelInstrumentation.js +6 -1
  23. package/build/instrumentation/performance/constants.d.ts +79 -0
  24. package/build/instrumentation/performance/constants.d.ts.map +1 -0
  25. package/build/instrumentation/performance/constants.js +78 -0
  26. package/build/instrumentation/performance/performance-tester.d.ts +44 -0
  27. package/build/instrumentation/performance/performance-tester.d.ts.map +1 -0
  28. package/build/instrumentation/performance/performance-tester.js +280 -0
  29. package/build/launcher.d.ts.map +1 -1
  30. package/build/launcher.js +29 -5
  31. package/build/scripts/accessibility-scripts.d.ts +1 -0
  32. package/build/scripts/accessibility-scripts.d.ts.map +1 -1
  33. package/build/scripts/accessibility-scripts.js +27 -3
  34. package/build/service.d.ts.map +1 -1
  35. package/build/service.js +68 -14
  36. package/build/util.d.ts +26 -9
  37. package/build/util.d.ts.map +1 -1
  38. package/build/util.js +207 -37
  39. package/package.json +5 -5
  40. package/tsconfig.prod.tsbuildinfo +1 -1
  41. package/build/performance-tester.d.ts +0 -14
  42. package/build/performance-tester.d.ts.map +0 -1
  43. 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,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;IAmBrE,MAAM;IAIZ,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,I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,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;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"}
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';
@@ -6,6 +12,8 @@ import { nodeRequest, getBrowserStackUser, getBrowserStackKey, sleep } from '../
6
12
  import { PercyLogger } from './PercyLogger.js';
7
13
  import PercyBinary from './PercyBinary.js';
8
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';
9
17
  const logDir = 'logs';
10
18
  class Percy {
11
19
  #logfile = path.join(logDir, 'percy.log');
@@ -145,4 +153,10 @@ class Percy {
145
153
  });
146
154
  }
147
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);
148
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":"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"}
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"}
@@ -26,8 +26,7 @@ if (percySnapshot) {
26
26
  options ||= {};
27
27
  options = {
28
28
  ...options,
29
- testCase: name || '',
30
- thTestCaseExecutionId: uuid || '',
29
+ testCase: name || ''
31
30
  };
32
31
  return percySnapshot(browser, snapshotName, options);
33
32
  }
@@ -48,8 +47,7 @@ const screenshotHelper = (type, driverOrName, nameOrOptions, options) => {
48
47
  if (typeof nameOrOptions === 'object') {
49
48
  nameOrOptions = {
50
49
  ...nameOrOptions,
51
- testCase: name || '',
52
- thTestCaseExecutionId: uuid || '',
50
+ testCase: name || ''
53
51
  };
54
52
  }
55
53
  }
@@ -57,8 +55,7 @@ const screenshotHelper = (type, driverOrName, nameOrOptions, options) => {
57
55
  options ||= {};
58
56
  options = {
59
57
  ...options,
60
- testCase: name || '',
61
- thTestCaseExecutionId: uuid || '',
58
+ testCase: name || ''
62
59
  };
63
60
  }
64
61
  if (type === 'app') {
@@ -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?;
@@ -15,7 +16,7 @@ declare class _AccessibilityHandler {
15
16
  private static _a11yScanSessionMap;
16
17
  private _sessionId;
17
18
  private listener;
18
- constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate?: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
19
+ constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
19
20
  [key: string]: any;
20
21
  } | undefined);
21
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;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;I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aAAa,EAAE,MAAM;IA6BzF,MAAM,CAAE,SAAS,EAAE,MAAM;IAiDzB,UAAU,CAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI;IAmCjE,SAAS,CAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI;IAoCtE;;MAEE;IACI,cAAc,CAAE,KAAK,EAAE,sBAAsB;IAkC7C,aAAa,CAAE,KAAK,EAAE,sBAAsB;YAsCpC,cAAc;YAcd,iBAAiB;IAc/B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,kBAAkB;YAOZ,iBAAiB;IAkB/B,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAU1C;AAGD,QAAA,MAAM,oBAAoB,EAAE,OAAO,qBAAoE,CAAA;AACvG,KAAK,oBAAoB,GAAG,qBAAqB,CAAA;AAEjD,eAAe,oBAAoB,CAAA"}
@@ -1,11 +1,14 @@
1
1
  import util from 'node:util';
2
2
  import Listener from './testOps/listener.js';
3
- import { getA11yResultsSummary, getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, isTrue } from './util.js';
3
+ import { getA11yResultsSummary, getAppA11yResultsSummary, getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isAppAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, isTrue, validateCapsWithAppA11y, getAppA11yResults } from './util.js';
4
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';
5
7
  import { BStackLogger } from './bstackLogger.js';
6
8
  class _AccessibilityHandler {
7
9
  _browser;
8
10
  _capabilities;
11
+ isAppAutomate;
9
12
  _framework;
10
13
  _accessibilityAutomation;
11
14
  _accessibilityOpts;
@@ -21,6 +24,7 @@ class _AccessibilityHandler {
21
24
  constructor(_browser, _capabilities, isAppAutomate, _framework, _accessibilityAutomation, _accessibilityOpts) {
22
25
  this._browser = _browser;
23
26
  this._capabilities = _capabilities;
27
+ this.isAppAutomate = isAppAutomate;
24
28
  this._framework = _framework;
25
29
  this._accessibilityAutomation = _accessibilityAutomation;
26
30
  this._accessibilityOpts = _accessibilityOpts;
@@ -28,6 +32,8 @@ class _AccessibilityHandler {
28
32
  this._platformA11yMeta = {
29
33
  browser_name: caps.browserName,
30
34
  browser_version: caps?.browserVersion || caps?.version || 'latest',
35
+ platform_name: caps?.platformName,
36
+ platform_version: this._getCapabilityValue(caps, 'appium:platformVersion', 'platformVersion'),
31
37
  os_name: this._getCapabilityValue(_capabilities, 'os', 'os'),
32
38
  os_version: this._getCapabilityValue(_capabilities, 'osVersion', 'os_version')
33
39
  };
@@ -76,19 +82,30 @@ class _AccessibilityHandler {
76
82
  async before(sessionId) {
77
83
  this._sessionId = sessionId;
78
84
  this._accessibility = isTrue(this._getCapabilityValue(this._caps, 'accessibility', 'browserstack.accessibility'));
79
- if (isBrowserstackSession(this._browser) && isAccessibilityAutomationSession(this._accessibility)) {
80
- const deviceName = this._getCapabilityValue(this._caps, 'deviceName', 'device');
81
- const chromeOptions = this._getCapabilityValue(this._caps, 'goog:chromeOptions', '');
82
- 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
+ }
83
94
  }
84
95
  this._browser.getAccessibilityResultsSummary = async () => {
85
- 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);
86
100
  };
87
101
  this._browser.getAccessibilityResults = async () => {
88
- 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);
89
106
  };
90
107
  this._browser.performScan = async () => {
91
- return await performA11yScan(this._browser, isBrowserstackSession(this._browser), this._accessibility);
108
+ return await performA11yScan(this.isAppAutomate, this._browser, isBrowserstackSession(this._browser), this._accessibility);
92
109
  };
93
110
  if (!this._accessibility) {
94
111
  return;
@@ -113,16 +130,16 @@ class _AccessibilityHandler {
113
130
  }
114
131
  const shouldScanTest = shouldScanTestForAccessibility(suiteTitle, test.title, this._accessibilityOptions);
115
132
  const testIdentifier = this.getIdentifier(test);
116
- const isPageOpened = await this.checkIfPageOpened(this._browser, testIdentifier, shouldScanTest);
117
133
  if (this._sessionId) {
118
134
  /* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
119
135
  AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanTest;
120
136
  }
121
137
  /* This is to be used when test events are sent */
122
138
  Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanTest);
123
- if (!isPageOpened) {
124
- return;
125
- }
139
+ this._testMetadata[testIdentifier] = {
140
+ scanTestForAccessibility: shouldScanTest,
141
+ accessibilityScanStarted: true
142
+ };
126
143
  this._testMetadata[testIdentifier].accessibilityScanStarted = shouldScanTest;
127
144
  if (shouldScanTest) {
128
145
  BStackLogger.info('Automate test case execution has started.');
@@ -175,17 +192,17 @@ class _AccessibilityHandler {
175
192
  }
176
193
  try {
177
194
  const shouldScanScenario = shouldScanTestForAccessibility(featureData?.name, pickleData.name, this._accessibilityOptions, world, true);
178
- 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;
179
200
  if (this._sessionId) {
180
201
  /* For case with multiple tests under one browser, before hook of 2nd test should change this map value */
181
202
  AccessibilityHandler._a11yScanSessionMap[this._sessionId] = shouldScanScenario;
182
203
  }
183
204
  /* This is to be used when test events are sent */
184
205
  Listener.setTestRunAccessibilityVar(this._accessibility && shouldScanScenario);
185
- if (!isPageOpened) {
186
- return;
187
- }
188
- this._testMetadata[uniqueId].accessibilityScanStarted = shouldScanScenario;
189
206
  if (shouldScanScenario) {
190
207
  BStackLogger.info('Automate test case execution has started.');
191
208
  }
@@ -230,15 +247,22 @@ class _AccessibilityHandler {
230
247
  (!command.name.includes('execute') ||
231
248
  !AccessibilityHandler.shouldPatchExecuteScript(args.length ? args[0] : null))) {
232
249
  BStackLogger.debug(`Performing scan for ${command.class} ${command.name}`);
233
- await performA11yScan(this._browser, true, true, command.name);
250
+ await performA11yScan(this.isAppAutomate, this._browser, true, true, command.name);
234
251
  }
235
252
  return origFunction(...args);
236
253
  }
237
254
  async sendTestStopEvent(browser, dataForExtension) {
238
255
  BStackLogger.debug('Performing scan before saving results');
239
- await performA11yScan(browser, true, true);
240
- const results = await browser.executeAsync(accessibilityScripts.saveTestResults, dataForExtension);
241
- 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
+ })();
242
266
  }
243
267
  getIdentifier(test) {
244
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
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,6 +27,14 @@ 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
40
  if (!process.env[BROWSERSTACK_TESTHUB_JWT]) {
@@ -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,MA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A;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;IAeP,cAAc;IAId,aAAa,CAAC,GAAG,EAAE,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";
@@ -27,6 +30,7 @@ export declare const LOG_KIND_USAGE_MAP: {
27
30
  HTTP: string;
28
31
  };
29
32
  export declare const FUNNEL_INSTRUMENTATION_URL = "https://api.browserstack.com/sdk/v1/event";
33
+ export declare const EDS_URL = "https://eds.browserstack.com";
30
34
  export declare const SUPPORTED_BROWSERS_FOR_AI: string[];
31
35
  export declare const TCG_URL = "https://tcg.browserstack.com";
32
36
  export declare const TCG_INFO: {
@@ -43,6 +47,7 @@ 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";
45
49
  export declare const BROWSERSTACK_PERCY = "BROWSERSTACK_PERCY";
50
+ export declare const BSTACK_A11Y_POLLING_TIMEOUT = "BSTACK_A11Y_POLLING_TIMEOUT";
46
51
  export declare const BROWSERSTACK_ACCESSIBILITY = "BROWSERSTACK_ACCESSIBILITY";
47
52
  export declare const BROWSERSTACK_OBSERVABILITY = "BROWSERSTACK_OBSERVABILITY";
48
53
  export declare const MAX_GIT_META_DATA_SIZE_IN_BYTES: number;
@@ -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,OA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,uBAAuB,CAAA;AAExD,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAE/C,eAAO,MAAM,qCAAqC,UAQjD,CAAA;AAED,eAAO,MAAM,aAAa,UAAwD,CAAA;AAElF,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAA;AAED,eAAO,MAAM,0BAA0B,8CAA8C,CAAA;AAErF,eAAO,MAAM,OAAO,iCAAiC,CAAA;AAErD,eAAO,MAAM,yBAAyB,UAAyC,CAAA;AAE/E,eAAO,MAAM,OAAO,iCAAiC,CAAA;AAErD,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAKD,eAAO,MAAM,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;AAEtD,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AAGxE,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"}
@@ -24,6 +24,9 @@ export const DEFAULT_OPTIONS = {
24
24
  };
25
25
  export const consoleHolder = Object.assign({}, console);
26
26
  export const DATA_ENDPOINT = 'https://collector-observability.browserstack.com';
27
+ export const APP_ALLY_ENDPOINT = 'https://app-accessibility.browserstack.com/automate';
28
+ export const APP_ALLY_ISSUES_ENDPOINT = 'api/v1/issues';
29
+ export const APP_ALLY_ISSUES_SUMMARY_ENDPOINT = 'api/v1/issues-summary';
27
30
  export const DATA_EVENT_ENDPOINT = 'api/v1/event';
28
31
  export const DATA_BATCH_ENDPOINT = 'api/v1/batch';
29
32
  export const DATA_SCREENSHOT_ENDPOINT = 'api/v1/screenshots';
@@ -55,6 +58,7 @@ export const LOG_KIND_USAGE_MAP = {
55
58
  'HTTP': 'http'
56
59
  };
57
60
  export const FUNNEL_INSTRUMENTATION_URL = 'https://api.browserstack.com/sdk/v1/event';
61
+ export const EDS_URL = 'https://eds.browserstack.com';
58
62
  export const SUPPORTED_BROWSERS_FOR_AI = ['chrome', 'microsoftedge', 'firefox'];
59
63
  export const TCG_URL = 'https://tcg.browserstack.com';
60
64
  export const TCG_INFO = {
@@ -82,6 +86,7 @@ export const RERUN_ENV = 'BROWSERSTACK_RERUN';
82
86
  export const TESTOPS_BUILD_COMPLETED_ENV = 'BS_TESTOPS_BUILD_COMPLETED';
83
87
  // Whether percy has started successfully or not
84
88
  export const BROWSERSTACK_PERCY = 'BROWSERSTACK_PERCY';
89
+ export const BSTACK_A11Y_POLLING_TIMEOUT = 'BSTACK_A11Y_POLLING_TIMEOUT';
85
90
  // Whether session is a accessibility session
86
91
  export const BROWSERSTACK_ACCESSIBILITY = 'BROWSERSTACK_ACCESSIBILITY';
87
92
  // Whether session is a observability session
@@ -1 +1 @@
1
- {"version":3,"file":"exitHandler.d.ts","sourceRoot":"","sources":["../src/exitHandler.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,MAAM,aAAa,CAAA;AAyB5C,wBAAgB,iBAAiB,SAiBhC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAYtE"}
1
+ {"version":3,"file":"exitHandler.d.ts","sourceRoot":"","sources":["../src/exitHandler.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,MAAM,aAAa,CAAA;AA2B5C,wBAAgB,iBAAiB,SAiBhC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAmBtE"}
@@ -5,6 +5,8 @@ import { saveFunnelData } from './instrumentation/funnelInstrumentation.js';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { BROWSERSTACK_TESTHUB_JWT } from './constants.js';
7
7
  import { BStackLogger } from './bstackLogger.js';
8
+ import PerformanceTester from './instrumentation/performance/performance-tester.js';
9
+ import TestOpsConfig from './testOps/testOpsConfig.js';
8
10
  const __filename = fileURLToPath(import.meta.url);
9
11
  const __dirname = path.dirname(__filename);
10
12
  function getInterruptSignals() {
@@ -49,5 +51,11 @@ export function shouldCallCleanup(config) {
49
51
  const savedFilePath = saveFunnelData('SDKTestSuccessful', config);
50
52
  args.push('--funnelData', savedFilePath);
51
53
  }
54
+ if (PerformanceTester.isEnabled()) {
55
+ process.env.PERF_USER_NAME = config.userName;
56
+ process.env.PERF_TESTHUB_UUID = TestOpsConfig.getInstance().buildHashedId;
57
+ process.env.PERF_SDK_RUN_ID = config.sdkRunID;
58
+ args.push('--performanceData');
59
+ }
52
60
  return args;
53
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"funnelInstrumentation.d.ts","sourceRoot":"","sources":["../../src/instrumentation/funnelInstrumentation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,kBAAkB,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAoBpE,wBAAsB,SAAS,CAAC,MAAM,EAAE,kBAAkB,iBAIzD;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,kBAAkB,iBAE1D;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOpF;AAeD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAShE;AA8ID,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,mBAAmB,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,mBAAmB,EAC3F,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,OAAO,GAAG,SAAS,QA6BzC"}
1
+ {"version":3,"file":"funnelInstrumentation.d.ts","sourceRoot":"","sources":["../../src/instrumentation/funnelInstrumentation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,kBAAkB,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAoBpE,wBAAsB,SAAS,CAAC,MAAM,EAAE,kBAAkB,iBAIzD;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,kBAAkB,iBAE1D;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOpF;AAeD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAShE;AAoJD,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,mBAAmB,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,mBAAmB,EAC3F,MAAM,EAAE,kBAAkB,EAC1B,iBAAiB,EAAE,OAAO,GAAG,SAAS,QA6BzC"}
@@ -6,7 +6,7 @@ import got from 'got';
6
6
  import UsageStats from '../testOps/usageStats.js';
7
7
  import TestOpsConfig from '../testOps/testOpsConfig.js';
8
8
  import { BStackLogger } from '../bstackLogger.js';
9
- import { BSTACK_SERVICE_VERSION, FUNNEL_INSTRUMENTATION_URL } from '../constants.js';
9
+ import { BSTACK_A11Y_POLLING_TIMEOUT, BSTACK_SERVICE_VERSION, FUNNEL_INSTRUMENTATION_URL } from '../constants.js';
10
10
  import { getDataFromWorkers, removeWorkersDataDir } from '../data-store.js';
11
11
  import { getProductMap } from '../testHub/utils.js';
12
12
  async function fireFunnelTestEvent(eventType, config) {
@@ -99,6 +99,8 @@ function buildEventData(eventType, config) {
99
99
  // Product Details
100
100
  productMap: getProductMap(config),
101
101
  product: getProductList(config),
102
+ // framework details
103
+ framework: config.framework,
102
104
  };
103
105
  if (TestOpsConfig.getInstance().buildHashedId) {
104
106
  eventProperties.testhub_uuid = TestOpsConfig.getInstance().buildHashedId;
@@ -108,6 +110,9 @@ function buildEventData(eventType, config) {
108
110
  eventProperties.productUsage = getProductUsage(workerData);
109
111
  eventProperties.isPercyAutoEnabled = config.isPercyAutoEnabled;
110
112
  eventProperties.percyBuildId = config.percyBuildId;
113
+ if (process.env[BSTACK_A11Y_POLLING_TIMEOUT]) {
114
+ eventProperties.pollingTimeout = process.env[BSTACK_A11Y_POLLING_TIMEOUT];
115
+ }
111
116
  if (config.killSignal) {
112
117
  eventProperties.finishedMetadata = {
113
118
  reason: 'user_killed',
@@ -0,0 +1,79 @@
1
+ export declare const EVENTS: {
2
+ SDK_SETUP: string;
3
+ SDK_CLEANUP: string;
4
+ SDK_PRE_TEST: string;
5
+ SDK_TEST: string;
6
+ SDK_POST_TEST: string;
7
+ SDK_HOOK: string;
8
+ SDK_DRIVER: string;
9
+ SDK_A11Y: string;
10
+ SDK_O11Y: string;
11
+ SDK_AUTO_CAPTURE: string;
12
+ SDK_PROXY_SETUP: string;
13
+ SDK_TESTHUB: string;
14
+ SDK_AUTOMATE: string;
15
+ SDK_APP_AUTOMATE: string;
16
+ SDK_TURBOSCALE: string;
17
+ SDK_PERCY: string;
18
+ SDK_PRE_INITIALIZE: string;
19
+ SDK_POST_INITIALIZE: string;
20
+ };
21
+ export declare const TESTHUB_EVENTS: {
22
+ START: string;
23
+ STOP: string;
24
+ };
25
+ export declare const AUTOMATE_EVENTS: {
26
+ KEEP_ALIVE: string;
27
+ HUB_MANAGEMENT: string;
28
+ LOCAL_START: string;
29
+ LOCAL_STOP: string;
30
+ DRIVER_MANAGE: string;
31
+ SESSION_NAME: string;
32
+ SESSION_STATUS: string;
33
+ SESSION_ANNOTATION: string;
34
+ IDLE_TIMEOUT: string;
35
+ GENERATE_CI_ARTIFACT: string;
36
+ PRINT_BUILDLINK: string;
37
+ };
38
+ export declare const A11Y_EVENTS: {
39
+ PERFORM_SCAN: string;
40
+ SAVE_RESULTS: string;
41
+ GET_RESULTS: string;
42
+ GET_RESULTS_SUMMARY: string;
43
+ };
44
+ export declare const PERCY_EVENTS: {
45
+ DOWNLOAD: string;
46
+ SCREENSHOT: string;
47
+ START: string;
48
+ STOP: string;
49
+ AUTO_CAPTURE: string;
50
+ SNAPSHOT: string;
51
+ SCREENSHOT_APP: string;
52
+ };
53
+ export declare const O11Y_EVENTS: {
54
+ SYNC: string;
55
+ TAKE_SCREENSHOT: string;
56
+ PRINT_BUILDLINK: string;
57
+ };
58
+ export declare const HOOK_EVENTS: {
59
+ BEFORE_EACH: string;
60
+ AFTER_EACH: string;
61
+ AFTER_ALL: string;
62
+ BEFORE_ALL: string;
63
+ BEFORE: string;
64
+ AFTER: string;
65
+ };
66
+ export declare const TURBOSCALE_EVENTS: {
67
+ HUB_MANAGEMENT: string;
68
+ PRINT_BUILDLINK: string;
69
+ };
70
+ export declare const APP_AUTOMATE_EVENTS: {
71
+ APP_UPLOAD: string;
72
+ };
73
+ export declare const DRIVER_EVENT: {
74
+ QUIT: string;
75
+ GET: string;
76
+ PRE_EXECUTE: string;
77
+ POST_EXECUTE: string;
78
+ };
79
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/instrumentation/performance/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CAmBlB,CAAA;AAED,eAAO,MAAM,cAAc;;;CAG1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAA;AAED,eAAO,MAAM,WAAW;;;;;CAKvB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;CAQxB,CAAA;AAED,eAAO,MAAM,WAAW;;;;CAIvB,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,eAAO,MAAM,mBAAmB;;CAE/B,CAAA;AAED,eAAO,MAAM,YAAY;;;;;CAKxB,CAAA"}