@wdio/browserstack-service 8.44.1 → 8.45.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/accessibility-handler.d.ts +6 -2
- package/build/accessibility-handler.d.ts.map +1 -1
- package/build/accessibility-handler.js +16 -4
- package/build/config.d.ts +1 -1
- package/build/config.d.ts.map +1 -1
- package/build/config.js +1 -1
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +69 -7
- package/build/scripts/accessibility-scripts.d.ts +4 -0
- package/build/scripts/accessibility-scripts.d.ts.map +1 -1
- package/build/scripts/accessibility-scripts.js +6 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +7 -9
- package/build/testHub/utils.d.ts +3 -0
- package/build/testHub/utils.d.ts.map +1 -1
- package/build/testHub/utils.js +9 -0
- package/build/util.d.ts +7 -3
- package/build/util.d.ts.map +1 -1
- package/build/util.js +70 -21
- package/package.json +4 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Capabilities, Frameworks } from '@wdio/types';
|
|
1
|
+
import type { Capabilities, Frameworks, Options } from '@wdio/types';
|
|
2
|
+
import type { BrowserstackConfig, BrowserstackOptions } from './types.js';
|
|
2
3
|
import type { ITestCaseHookParameter } from './cucumber-types.js';
|
|
3
4
|
declare class _AccessibilityHandler {
|
|
4
5
|
private _browser;
|
|
@@ -11,12 +12,15 @@ declare class _AccessibilityHandler {
|
|
|
11
12
|
private _caps;
|
|
12
13
|
private _suiteFile?;
|
|
13
14
|
private _accessibility?;
|
|
15
|
+
private _turboscale?;
|
|
16
|
+
private _options;
|
|
17
|
+
private _config;
|
|
14
18
|
private _accessibilityOptions?;
|
|
15
19
|
private _testMetadata;
|
|
16
20
|
private static _a11yScanSessionMap;
|
|
17
21
|
private _sessionId;
|
|
18
22
|
private listener;
|
|
19
|
-
constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, isAppAutomate: boolean, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _accessibilityOpts?: {
|
|
23
|
+
constructor(_browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, _capabilities: Capabilities.RemoteCapability, _options: BrowserstackConfig & BrowserstackOptions, isAppAutomate: boolean, _config: Options.Testrunner, _framework?: string | undefined, _accessibilityAutomation?: (boolean | string) | undefined, _turboscale?: boolean | string, _accessibilityOpts?: {
|
|
20
24
|
[key: string]: any;
|
|
21
25
|
} | undefined);
|
|
22
26
|
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;
|
|
1
|
+
{"version":3,"file":"accessibility-handler.d.ts","sourceRoot":"","sources":["../src/accessibility-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AA6BjE,cAAM,qBAAqB;IAenB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,UAAU,CAAC;IACnB,OAAO,CAAC,wBAAwB,CAAC;IAEjC,OAAO,CAAC,kBAAkB,CAAC;IAtB/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,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAA0C;IAC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D,QAAA,MAAM,oBAAoB,EAAE,OAAO,qBAAoE,CAAA;AACvG,KAAK,oBAAoB,GAAG,qBAAqB,CAAA;AAEjD,eAAe,oBAAoB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import util from 'node:util';
|
|
2
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
|
+
import { getA11yResultsSummary, getAppA11yResultsSummary, getA11yResults, performA11yScan, getUniqueIdentifier, getUniqueIdentifierForCucumber, isAccessibilityAutomationSession, isAppAccessibilityAutomationSession, isBrowserstackSession, o11yClassErrorHandler, shouldScanTestForAccessibility, validateCapsWithA11y, shouldAddServiceVersion, validateCapsWithNonBstackA11y, isTrue, validateCapsWithAppA11y, getAppA11yResults } from './util.js';
|
|
4
4
|
import accessibilityScripts from './scripts/accessibility-scripts.js';
|
|
5
5
|
import PerformanceTester from './instrumentation/performance/performance-tester.js';
|
|
6
6
|
import * as PERFORMANCE_SDK_EVENTS from './instrumentation/performance/constants.js';
|
|
@@ -16,12 +16,15 @@ class _AccessibilityHandler {
|
|
|
16
16
|
_caps;
|
|
17
17
|
_suiteFile;
|
|
18
18
|
_accessibility;
|
|
19
|
+
_turboscale;
|
|
20
|
+
_options;
|
|
21
|
+
_config;
|
|
19
22
|
_accessibilityOptions;
|
|
20
23
|
_testMetadata = {};
|
|
21
24
|
static _a11yScanSessionMap = {};
|
|
22
25
|
_sessionId = null;
|
|
23
26
|
listener = Listener.getInstance();
|
|
24
|
-
constructor(_browser, _capabilities, isAppAutomate, _framework, _accessibilityAutomation, _accessibilityOpts) {
|
|
27
|
+
constructor(_browser, _capabilities, _options, isAppAutomate, _config, _framework, _accessibilityAutomation, _turboscale, _accessibilityOpts) {
|
|
25
28
|
this._browser = _browser;
|
|
26
29
|
this._capabilities = _capabilities;
|
|
27
30
|
this.isAppAutomate = isAppAutomate;
|
|
@@ -40,6 +43,9 @@ class _AccessibilityHandler {
|
|
|
40
43
|
this._caps = _capabilities;
|
|
41
44
|
this._accessibility = isTrue(_accessibilityAutomation);
|
|
42
45
|
this._accessibilityOptions = _accessibilityOpts;
|
|
46
|
+
this._options = _options;
|
|
47
|
+
this._config = _config;
|
|
48
|
+
this._turboscale = isTrue(_turboscale);
|
|
43
49
|
}
|
|
44
50
|
setSuiteFile(filename) {
|
|
45
51
|
this._suiteFile = filename;
|
|
@@ -82,7 +88,13 @@ class _AccessibilityHandler {
|
|
|
82
88
|
async before(sessionId) {
|
|
83
89
|
this._sessionId = sessionId;
|
|
84
90
|
this._accessibility = isTrue(this._getCapabilityValue(this._caps, 'accessibility', 'browserstack.accessibility'));
|
|
85
|
-
|
|
91
|
+
//checks for running ALLY on non-bstack infra
|
|
92
|
+
if (isAccessibilityAutomationSession(this._accessibility) && (this._turboscale || !shouldAddServiceVersion(this._config, this._options.testObservability))) {
|
|
93
|
+
if (validateCapsWithNonBstackA11y(this._platformA11yMeta.browser_name, this._platformA11yMeta?.browser_version)) {
|
|
94
|
+
this._accessibility = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
86
98
|
if (isAccessibilityAutomationSession(this._accessibility) && !this.isAppAutomate) {
|
|
87
99
|
const deviceName = this._getCapabilityValue(this._caps, 'deviceName', 'device');
|
|
88
100
|
const chromeOptions = this._getCapabilityValue(this._caps, 'goog:chromeOptions', '');
|
|
@@ -274,7 +286,7 @@ class _AccessibilityHandler {
|
|
|
274
286
|
if (!browser) {
|
|
275
287
|
return false;
|
|
276
288
|
}
|
|
277
|
-
return
|
|
289
|
+
return isAccessibilityAutomationSession(isAccessibility);
|
|
278
290
|
}
|
|
279
291
|
async checkIfPageOpened(browser, testIdentifier, shouldScanTest) {
|
|
280
292
|
let pageOpen = false;
|
package/build/config.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class BrowserStackConfig {
|
|
|
11
11
|
testObservability: TestOpsConfig;
|
|
12
12
|
percy: boolean;
|
|
13
13
|
percyCaptureMode?: string;
|
|
14
|
-
accessibility: boolean;
|
|
14
|
+
accessibility: boolean | null;
|
|
15
15
|
app?: string | AppConfig;
|
|
16
16
|
private static _instance;
|
|
17
17
|
appAutomate: boolean;
|
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;AAKtD,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;
|
|
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;AAKtD,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,GAAG,IAAI,CAAA;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,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
|
@@ -33,7 +33,7 @@ class BrowserStackConfig {
|
|
|
33
33
|
this.accessKey = config.key;
|
|
34
34
|
this.testObservability = new TestOpsConfig(options.testObservability !== false, !isUndefined(options.testObservability));
|
|
35
35
|
this.percy = options.percy || false;
|
|
36
|
-
this.accessibility = options.accessibility
|
|
36
|
+
this.accessibility = options.accessibility !== undefined ? options.accessibility : null;
|
|
37
37
|
this.app = options.app;
|
|
38
38
|
this.appAutomate = !isUndefined(options.app);
|
|
39
39
|
this.automate = !this.appAutomate;
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,yBAAyB,MAAM,oBAAoB,CAAA;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,yBAAyB,MAAM,oBAAoB,CAAA;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAIlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AA0CxH,KAAK,iBAAiB,GAAG,yBAAyB,CAAC,KAAK,GAAG;IACvD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,2BAA4B,YAAW,QAAQ,CAAC,eAAe;IAY5E,OAAO,CAAC,QAAQ;IAEhB,OAAO,CAAC,OAAO;IAbnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,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AAsB,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,SAAS,CAAC,EAAC,MAAM,EAAE,eAAe,CAAC,EAAC,MAAM;IASnF,mBAAmB;CAStB"}
|
package/build/launcher.js
CHANGED
|
@@ -16,7 +16,7 @@ import { SevereServiceError } from 'webdriverio';
|
|
|
16
16
|
import * as BrowserstackLocalLauncher from 'browserstack-local';
|
|
17
17
|
import { startPercy, stopPercy, getBestPlatformForPercySnapshot } from './Percy/PercyHelper.js';
|
|
18
18
|
import { BSTACK_SERVICE_VERSION, NOT_ALLOWED_KEYS_IN_CAPS, PERF_MEASUREMENT_ENV, RERUN_ENV, RERUN_TESTS_ENV, BROWSERSTACK_TESTHUB_UUID, VALID_APP_EXTENSION, BROWSERSTACK_PERCY, BROWSERSTACK_OBSERVABILITY } from './constants.js';
|
|
19
|
-
import { launchTestSession, shouldAddServiceVersion, stopBuildUpstream, getCiInfo, isBStackSession, isUndefined, isAccessibilityAutomationSession, isTrue, getBrowserStackUser, getBrowserStackKey, uploadLogs, ObjectsAreEqual, isValidCapsForHealing } from './util.js';
|
|
19
|
+
import { launchTestSession, shouldAddServiceVersion, stopBuildUpstream, getCiInfo, isBStackSession, isUndefined, isAccessibilityAutomationSession, isTrue, getBrowserStackUser, getBrowserStackKey, uploadLogs, ObjectsAreEqual, isValidCapsForHealing, getBooleanValueFromString, validateCapsWithNonBstackA11y, mergeChromeOptions } from './util.js';
|
|
20
20
|
import { getProductMap } from './testHub/utils.js';
|
|
21
21
|
import CrashReporter from './crash-reporter.js';
|
|
22
22
|
import { BStackLogger } from './bstackLogger.js';
|
|
@@ -29,6 +29,7 @@ import AiHandler from './ai-handler.js';
|
|
|
29
29
|
import TestOpsConfig from './testOps/testOpsConfig.js';
|
|
30
30
|
import PerformanceTester from './instrumentation/performance/performance-tester.js';
|
|
31
31
|
import * as PERFORMANCE_SDK_EVENTS from './instrumentation/performance/constants.js';
|
|
32
|
+
import accessibilityScripts from './scripts/accessibility-scripts.js';
|
|
32
33
|
export default class BrowserstackLauncherService {
|
|
33
34
|
_options;
|
|
34
35
|
_config;
|
|
@@ -37,7 +38,7 @@ export default class BrowserstackLauncherService {
|
|
|
37
38
|
_projectName;
|
|
38
39
|
_buildTag;
|
|
39
40
|
_buildIdentifier;
|
|
40
|
-
_accessibilityAutomation;
|
|
41
|
+
_accessibilityAutomation = null;
|
|
41
42
|
_percy;
|
|
42
43
|
_percyBestPlatformCaps;
|
|
43
44
|
browserStackConfig;
|
|
@@ -104,7 +105,6 @@ export default class BrowserstackLauncherService {
|
|
|
104
105
|
caps.capabilities['bstack:options'] = { wdioService: BSTACK_SERVICE_VERSION };
|
|
105
106
|
if (!isUndefined(caps.capabilities['browserstack.accessibility'])) {
|
|
106
107
|
this._accessibilityAutomation ||= isTrue(caps.capabilities['browserstack.accessibility']);
|
|
107
|
-
this.browserStackConfig.accessibility = this._accessibilityAutomation;
|
|
108
108
|
}
|
|
109
109
|
else if (isTrue(this._options.accessibility)) {
|
|
110
110
|
caps.capabilities['bstack:options'] = { wdioService: BSTACK_SERVICE_VERSION, accessibility: (isTrue(this._options.accessibility)) };
|
|
@@ -135,7 +135,9 @@ export default class BrowserstackLauncherService {
|
|
|
135
135
|
this.browserStackConfig.buildIdentifier = this._buildIdentifier;
|
|
136
136
|
this.browserStackConfig.buildName = this._buildName;
|
|
137
137
|
PerformanceTester.startMonitoring('performance-report-launcher.csv');
|
|
138
|
-
|
|
138
|
+
if (!isUndefined(this._options.accessibility)) {
|
|
139
|
+
this._accessibilityAutomation ||= isTrue(this._options.accessibility);
|
|
140
|
+
}
|
|
139
141
|
this._options.accessibility = this._accessibilityAutomation;
|
|
140
142
|
// by default observability will be true unless specified as false
|
|
141
143
|
this._options.testObservability = this._options.testObservability !== false;
|
|
@@ -239,16 +241,32 @@ export default class BrowserstackLauncherService {
|
|
|
239
241
|
// remove accessibilityOptions from the capabilities if present
|
|
240
242
|
this._updateObjectTypeCaps(capabilities, 'accessibilityOptions');
|
|
241
243
|
const shouldSetupPercy = this._options.percy || (isUndefined(this._options.percy) && this._options.app);
|
|
242
|
-
|
|
244
|
+
let buildStartResponse = null;
|
|
243
245
|
if (this._options.testObservability || this._accessibilityAutomation || shouldSetupPercy) {
|
|
244
246
|
BStackLogger.debug('Sending launch start event');
|
|
245
|
-
await launchTestSession(this._options, this._config, {
|
|
247
|
+
buildStartResponse = await launchTestSession(this._options, this._config, {
|
|
246
248
|
projectName: this._projectName,
|
|
247
249
|
buildName: this._buildName,
|
|
248
250
|
buildTag: this._buildTag,
|
|
249
251
|
bstackServiceVersion: BSTACK_SERVICE_VERSION,
|
|
250
252
|
buildIdentifier: this._buildIdentifier
|
|
251
|
-
}, this.browserStackConfig);
|
|
253
|
+
}, this.browserStackConfig, this._accessibilityAutomation);
|
|
254
|
+
//added checks for Accessibility running on non-bstack infra
|
|
255
|
+
if (isAccessibilityAutomationSession(this._accessibilityAutomation) && (process.env.BROWSERSTACK_TURBOSCALE || !shouldAddServiceVersion(this._config, this._options.testObservability))) {
|
|
256
|
+
const overrideOptions = accessibilityScripts.ChromeExtension;
|
|
257
|
+
this._updateObjectTypeCaps(capabilities, 'goog:chromeOptions', overrideOptions);
|
|
258
|
+
}
|
|
259
|
+
if (buildStartResponse?.accessibility) {
|
|
260
|
+
if (this._accessibilityAutomation === null) {
|
|
261
|
+
this.browserStackConfig.accessibility = buildStartResponse.accessibility.success;
|
|
262
|
+
this._accessibilityAutomation = buildStartResponse.accessibility.success;
|
|
263
|
+
this._options.accessibility = buildStartResponse.accessibility.success;
|
|
264
|
+
if (buildStartResponse.accessibility.success === true) {
|
|
265
|
+
this._updateCaps(capabilities, 'accessibility', 'true');
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
this.browserStackConfig.accessibility = this._accessibilityAutomation;
|
|
252
270
|
if (this._accessibilityAutomation && this._options.accessibilityOptions) {
|
|
253
271
|
const filteredOpts = Object.keys(this._options.accessibilityOptions)
|
|
254
272
|
.filter(key => !NOT_ALLOWED_KEYS_IN_CAPS.includes(key))
|
|
@@ -484,6 +502,19 @@ export default class BrowserstackLauncherService {
|
|
|
484
502
|
return c;
|
|
485
503
|
})
|
|
486
504
|
.forEach((capability) => {
|
|
505
|
+
if (validateCapsWithNonBstackA11y(capability.browserName, capability.browserVersion)) {
|
|
506
|
+
if (capType === 'goog:chromeOptions' && value) {
|
|
507
|
+
const chromeOptions = capability['goog:chromeOptions'];
|
|
508
|
+
if (chromeOptions) {
|
|
509
|
+
const finalChromeOptions = mergeChromeOptions(chromeOptions, value);
|
|
510
|
+
capability['goog:chromeOptions'] = finalChromeOptions;
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
capability['goog:chromeOptions'] = value;
|
|
514
|
+
}
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
487
518
|
if (!capability['bstack:options']) {
|
|
488
519
|
const extensionCaps = Object.keys(capability).filter((cap) => cap.includes(':'));
|
|
489
520
|
if (extensionCaps.length) {
|
|
@@ -522,6 +553,19 @@ export default class BrowserstackLauncherService {
|
|
|
522
553
|
}
|
|
523
554
|
else if (typeof capabilities === 'object') {
|
|
524
555
|
Object.entries(capabilities).forEach(([, caps]) => {
|
|
556
|
+
if (validateCapsWithNonBstackA11y(caps.capabilities.browserName, caps.capabilities.browserVersion)) {
|
|
557
|
+
if (capType === 'goog:chromeOptions' && value) {
|
|
558
|
+
const chromeOptions = caps.capabilities['goog:chromeOptions'];
|
|
559
|
+
if (chromeOptions) {
|
|
560
|
+
const finalChromeOptions = mergeChromeOptions(chromeOptions, value);
|
|
561
|
+
caps.capabilities['goog:chromeOptions'] = finalChromeOptions;
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
caps.capabilities['goog:chromeOptions'] = value;
|
|
565
|
+
}
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
525
569
|
if (!caps.capabilities['bstack:options']) {
|
|
526
570
|
const extensionCaps = Object.keys(caps.capabilities).filter((cap) => cap.includes(':'));
|
|
527
571
|
if (extensionCaps.length) {
|
|
@@ -591,6 +635,9 @@ export default class BrowserstackLauncherService {
|
|
|
591
635
|
else if (capType === 'buildProductMap' && getProductMap(this.browserStackConfig)) {
|
|
592
636
|
capability['bstack:options'] = { buildProductMap: getProductMap(this.browserStackConfig) };
|
|
593
637
|
}
|
|
638
|
+
else if (capType === 'accessibility') {
|
|
639
|
+
capability['bstack:options'] = { accessibility: getBooleanValueFromString(value) };
|
|
640
|
+
}
|
|
594
641
|
}
|
|
595
642
|
else if (capType === 'local') {
|
|
596
643
|
capability['browserstack.local'] = true;
|
|
@@ -615,6 +662,9 @@ export default class BrowserstackLauncherService {
|
|
|
615
662
|
else if (capType === 'buildProductMap') {
|
|
616
663
|
capability['browserstack.buildProductMap'] = getProductMap(this.browserStackConfig);
|
|
617
664
|
}
|
|
665
|
+
else if (capType === 'accessibility') {
|
|
666
|
+
capability['browserstack.accessibility'] = getBooleanValueFromString(value);
|
|
667
|
+
}
|
|
618
668
|
}
|
|
619
669
|
else if (capType === 'local') {
|
|
620
670
|
capability['bstack:options'].local = true;
|
|
@@ -639,6 +689,9 @@ export default class BrowserstackLauncherService {
|
|
|
639
689
|
else if (capType === 'buildProductMap') {
|
|
640
690
|
capability['bstack:options'].buildProductMap = getProductMap(this.browserStackConfig);
|
|
641
691
|
}
|
|
692
|
+
else if (capType === 'accessibility') {
|
|
693
|
+
capability['bstack:options'].accessibility = getBooleanValueFromString(value);
|
|
694
|
+
}
|
|
642
695
|
});
|
|
643
696
|
}
|
|
644
697
|
else if (typeof capabilities === 'object') {
|
|
@@ -661,6 +714,9 @@ export default class BrowserstackLauncherService {
|
|
|
661
714
|
else if (capType === 'buildProductMap') {
|
|
662
715
|
caps.capabilities['bstack:options'] = { buildProductMap: getProductMap(this.browserStackConfig) };
|
|
663
716
|
}
|
|
717
|
+
else if (capType === 'accessibility') {
|
|
718
|
+
caps.capabilities['bstack:options'] = { accessibility: getBooleanValueFromString(value) };
|
|
719
|
+
}
|
|
664
720
|
}
|
|
665
721
|
else if (capType === 'local') {
|
|
666
722
|
caps.capabilities['browserstack.local'] = true;
|
|
@@ -685,6 +741,9 @@ export default class BrowserstackLauncherService {
|
|
|
685
741
|
else if (capType === 'buildProductMap') {
|
|
686
742
|
caps.capabilities['browserstack.buildProductMap'] = getProductMap(this.browserStackConfig);
|
|
687
743
|
}
|
|
744
|
+
else if (capType === 'accessibility') {
|
|
745
|
+
caps.capabilities['browserstack.accessibility'] = getBooleanValueFromString(value);
|
|
746
|
+
}
|
|
688
747
|
}
|
|
689
748
|
else if (capType === 'local') {
|
|
690
749
|
caps.capabilities['bstack:options'].local = true;
|
|
@@ -709,6 +768,9 @@ export default class BrowserstackLauncherService {
|
|
|
709
768
|
else if (capType === 'buildProductMap') {
|
|
710
769
|
caps.capabilities['bstack:options'].buildProductMap = getProductMap(this.browserStackConfig);
|
|
711
770
|
}
|
|
771
|
+
else if (capType === 'accessibility') {
|
|
772
|
+
caps.capabilities['bstack:options'].accessibility = getBooleanValueFromString(value);
|
|
773
|
+
}
|
|
712
774
|
});
|
|
713
775
|
}
|
|
714
776
|
else {
|
|
@@ -5,6 +5,9 @@ declare class AccessibilityScripts {
|
|
|
5
5
|
getResultsSummary: string | null;
|
|
6
6
|
saveTestResults: string | null;
|
|
7
7
|
commandsToWrap: Array<any> | null;
|
|
8
|
+
ChromeExtension: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
8
11
|
browserstackFolderPath: string;
|
|
9
12
|
commandsPath: string;
|
|
10
13
|
private constructor();
|
|
@@ -14,6 +17,7 @@ declare class AccessibilityScripts {
|
|
|
14
17
|
update(data: {
|
|
15
18
|
commands: any[];
|
|
16
19
|
scripts: Record<string, any>;
|
|
20
|
+
nonBStackInfraA11yChromeOptions: {};
|
|
17
21
|
}): void;
|
|
18
22
|
store(): void;
|
|
19
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-scripts.d.ts","sourceRoot":"","sources":["../../src/scripts/accessibility-scripts.ts"],"names":[],"mappings":"AAIA,cAAM,oBAAoB;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoC;IAEpD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAO;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAO;IACrC,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAO;
|
|
1
|
+
{"version":3,"file":"accessibility-scripts.d.ts","sourceRoot":"","sources":["../../src/scripts/accessibility-scripts.ts"],"names":[],"mappings":"AAIA,cAAM,oBAAoB;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoC;IAEpD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAO;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAO;IACrC,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAO;IACxC,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAK;IAEhD,sBAAsB,SAAK;IAC3B,YAAY,SAAK;IAGxB,OAAO;WAKO,mBAAmB;IAQ1B,cAAc,IAAI,MAAM;IAuBxB,oBAAoB;IAapB,MAAM,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,+BAA+B,EAAE,EAAE,CAAA;KAAE;IAenG,KAAK;CAgBf;;AAED,wBAAyD"}
|
|
@@ -8,6 +8,7 @@ class AccessibilityScripts {
|
|
|
8
8
|
getResultsSummary = null;
|
|
9
9
|
saveTestResults = null;
|
|
10
10
|
commandsToWrap = null;
|
|
11
|
+
ChromeExtension = {};
|
|
11
12
|
browserstackFolderPath = '';
|
|
12
13
|
commandsPath = '';
|
|
13
14
|
// don't allow to create instances from it other than through `checkAndGetInstance`
|
|
@@ -66,6 +67,9 @@ class AccessibilityScripts {
|
|
|
66
67
|
if (data.commands && data.commands.length) {
|
|
67
68
|
this.commandsToWrap = data.commands;
|
|
68
69
|
}
|
|
70
|
+
if (data.nonBStackInfraA11yChromeOptions) {
|
|
71
|
+
this.ChromeExtension = data.nonBStackInfraA11yChromeOptions;
|
|
72
|
+
}
|
|
69
73
|
}
|
|
70
74
|
store() {
|
|
71
75
|
if (!fs.existsSync(this.browserstackFolderPath)) {
|
|
@@ -78,7 +82,8 @@ class AccessibilityScripts {
|
|
|
78
82
|
getResults: this.getResults,
|
|
79
83
|
getResultsSummary: this.getResultsSummary,
|
|
80
84
|
saveResults: this.saveTestResults,
|
|
81
|
-
}
|
|
85
|
+
},
|
|
86
|
+
nonBStackInfraA11yChromeOptions: this.ChromeExtension,
|
|
82
87
|
}));
|
|
83
88
|
}
|
|
84
89
|
}
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAY9E,OAAO,KAAK,EAAE,kBAAkB,EAAuB,iBAAiB,EAA8C,MAAM,YAAY,CAAA;AACxI,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAgBhG,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,QAAQ,CAAC,eAAe;IAuBpE,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO;IAvBnB,OAAO,CAAC,eAAe,CAAmD;IAC1E,OAAO,CAAC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YAIR,eAAe;IAsB7B,OAAO,CAAC,cAAc;CAKzB"}
|
package/build/service.js
CHANGED
|
@@ -119,15 +119,13 @@ export default class BrowserstackService {
|
|
|
119
119
|
if (this._browser) {
|
|
120
120
|
try {
|
|
121
121
|
const sessionId = this._browser.sessionId;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
BStackLogger.error(`[Accessibility Test Run] Error in service class before function: ${err}`);
|
|
130
|
-
}
|
|
122
|
+
try {
|
|
123
|
+
this._accessibilityHandler = new AccessibilityHandler(this._browser, this._caps, this._options, this._isAppAutomate(), this._config, this._config.framework, this._accessibility, this._turboScale, this._options.accessibilityOptions);
|
|
124
|
+
await this._accessibilityHandler.before(sessionId);
|
|
125
|
+
Listener.setAccessibilityOptions(this._options.accessibilityOptions);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
BStackLogger.error(`[Accessibility Test Run] Error in service class before function: ${err}`);
|
|
131
129
|
}
|
|
132
130
|
if (shouldProcessEventForTesthub('')) {
|
|
133
131
|
patchConsoleLogs();
|
package/build/testHub/utils.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export declare const shouldProcessEventForTesthub: (eventType: string) => boolea
|
|
|
4
4
|
export declare const handleErrorForObservability: (error: any) => void;
|
|
5
5
|
export declare const handleErrorForAccessibility: (error: any) => void;
|
|
6
6
|
export declare const logBuildError: (error: any, product?: string) => void;
|
|
7
|
+
export declare const getProductMapForBuildStartCall: (config: BrowserStackConfig, accessibilityAutomation: boolean | null) => {
|
|
8
|
+
[key: string]: boolean | null;
|
|
9
|
+
};
|
|
7
10
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/testHub/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,cAAc,CAAA;AAIlD,eAAO,MAAM,aAAa,WAAY,kBAAkB,KAAG,GAQ1D,CAAA;AAED,eAAO,MAAM,4BAA4B,cAAe,MAAM,KAAG,OAWhE,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,KAAG,IAGxD,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,KAAG,IAGxD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,GAAG,YAAW,MAAM,KAAQ,IAyBhE,CAAA"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/testHub/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,cAAc,CAAA;AAIlD,eAAO,MAAM,aAAa,WAAY,kBAAkB,KAAG,GAQ1D,CAAA;AAED,eAAO,MAAM,4BAA4B,cAAe,MAAM,KAAG,OAWhE,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,KAAG,IAGxD,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,KAAG,IAGxD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,GAAG,YAAW,MAAM,KAAQ,IAyBhE,CAAA;AAED,eAAO,MAAM,8BAA8B,WAAY,kBAAkB,2BAA2B,OAAO,GAAG,IAAI,KAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAQnJ,CAAA"}
|
package/build/testHub/utils.js
CHANGED
|
@@ -55,3 +55,12 @@ export const logBuildError = (error, product = '') => {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
export const getProductMapForBuildStartCall = (config, accessibilityAutomation) => {
|
|
59
|
+
return {
|
|
60
|
+
observability: config.testObservability.enabled,
|
|
61
|
+
accessibility: accessibilityAutomation,
|
|
62
|
+
percy: config.percy,
|
|
63
|
+
automate: config.automate,
|
|
64
|
+
app_automate: config.appAutomate
|
|
65
|
+
};
|
|
66
|
+
};
|
package/build/util.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ interface DataElement {
|
|
|
68
68
|
[key: string]: any;
|
|
69
69
|
}
|
|
70
70
|
export declare const jsonifyAccessibilityArray: (dataArray: DataElement[], keyName: keyof DataElement, valueName: keyof DataElement) => Record<string, any>;
|
|
71
|
-
export declare const processAccessibilityResponse: (response: LaunchResponse) => void;
|
|
71
|
+
export declare const processAccessibilityResponse: (response: LaunchResponse, options: BrowserstackConfig & Options.Testrunner) => void;
|
|
72
72
|
export declare const processLaunchBuildResponse: (response: LaunchResponse, options: BrowserstackConfig & Options.Testrunner) => void;
|
|
73
73
|
export declare const launchTestSession: (...args: any[]) => any;
|
|
74
74
|
export declare const validateCapsWithAppA11y: (platformMeta?: {
|
|
@@ -77,13 +77,14 @@ export declare const validateCapsWithAppA11y: (platformMeta?: {
|
|
|
77
77
|
export declare const validateCapsWithA11y: (deviceName?: any, platformMeta?: {
|
|
78
78
|
[key: string]: any;
|
|
79
79
|
}, chromeOptions?: any) => boolean;
|
|
80
|
+
export declare const validateCapsWithNonBstackA11y: (browserName?: string | undefined, browserVersion?: string | undefined) => boolean;
|
|
80
81
|
export declare const shouldScanTestForAccessibility: (suiteTitle: string | undefined, testTitle: string, accessibilityOptions?: {
|
|
81
82
|
[key: string]: any;
|
|
82
83
|
}, world?: {
|
|
83
84
|
[key: string]: any;
|
|
84
85
|
}, isCucumber?: boolean) => boolean;
|
|
85
|
-
export declare const isAccessibilityAutomationSession: (accessibilityFlag?: boolean | string) => boolean | "" | undefined;
|
|
86
|
-
export declare const isAppAccessibilityAutomationSession: (accessibilityFlag?: boolean | string, isAppAutomate?: boolean) => boolean | "" | undefined;
|
|
86
|
+
export declare const isAccessibilityAutomationSession: (accessibilityFlag?: boolean | string | null) => boolean | "" | null | undefined;
|
|
87
|
+
export declare const isAppAccessibilityAutomationSession: (accessibilityFlag?: boolean | string, isAppAutomate?: boolean) => boolean | "" | null | undefined;
|
|
87
88
|
export declare const formatString: (template: (string | null), ...values: (string | null)[]) => string;
|
|
88
89
|
export declare const _getParamsForAppAccessibility: (commandName?: string) => {
|
|
89
90
|
thTestRunUuid: any;
|
|
@@ -192,5 +193,8 @@ type PollingResult = {
|
|
|
192
193
|
message?: string;
|
|
193
194
|
};
|
|
194
195
|
export declare function pollApi(url: string, params: Record<string, any>, headers: Record<string, string>, upperLimit: number, startTime?: number): Promise<PollingResult>;
|
|
196
|
+
export declare function getBooleanValueFromString(value: string | undefined): boolean;
|
|
197
|
+
export declare function mergeDeep(target: Record<string, any>, ...sources: any[]): Record<string, any>;
|
|
198
|
+
export declare function mergeChromeOptions(base: Capabilities.ChromeOptions, override: Partial<Capabilities.ChromeOptions>): Capabilities.ChromeOptions;
|
|
195
199
|
export {};
|
|
196
200
|
//# sourceMappingURL=util.d.ts.map
|
package/build/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,KAAK,MAAM,YAAY,CAAA;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAIjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,OAAO,KAAK,EAAc,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAc,MAAM,YAAY,CAAA;AACxG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AA+BjE,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAA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MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,SAAS,SAAa,GACvB,OAAO,CAAC,aAAa,CAAC,CA6DxB;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAK5E;AACD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB7F;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC,aAAa,CAe9I"}
|
package/build/util.js
CHANGED
|
@@ -14,7 +14,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
14
14
|
import logPatcher from './logPatcher.js';
|
|
15
15
|
import PerformanceTester from './instrumentation/performance/performance-tester.js';
|
|
16
16
|
import * as PERFORMANCE_SDK_EVENTS from './instrumentation/performance/constants.js';
|
|
17
|
-
import {
|
|
17
|
+
import { logBuildError, handleErrorForObservability, handleErrorForAccessibility, getProductMapForBuildStartCall } from './testHub/utils.js';
|
|
18
18
|
import { BROWSER_DESCRIPTION, DATA_ENDPOINT, UPLOAD_LOGS_ADDRESS, UPLOAD_LOGS_ENDPOINT, consoleHolder, BSTACK_A11Y_POLLING_TIMEOUT, TESTOPS_SCREENSHOT_ENV, BROWSERSTACK_TESTHUB_UUID, PERF_MEASUREMENT_ENV, RERUN_ENV, TESTOPS_BUILD_COMPLETED_ENV, BROWSERSTACK_TESTHUB_JWT, BROWSERSTACK_OBSERVABILITY, BROWSERSTACK_ACCESSIBILITY, MAX_GIT_META_DATA_SIZE_IN_BYTES, GIT_META_DATA_TRUNCATED, APP_ALLY_ENDPOINT, APP_ALLY_ISSUES_SUMMARY_ENDPOINT, APP_ALLY_ISSUES_ENDPOINT } from './constants.js';
|
|
19
19
|
import CrashReporter from './crash-reporter.js';
|
|
20
20
|
import { BStackLogger } from './bstackLogger.js';
|
|
@@ -226,9 +226,11 @@ export const jsonifyAccessibilityArray = (dataArray, keyName, valueName) => {
|
|
|
226
226
|
});
|
|
227
227
|
return result;
|
|
228
228
|
};
|
|
229
|
-
export const processAccessibilityResponse = (response) => {
|
|
229
|
+
export const processAccessibilityResponse = (response, options) => {
|
|
230
230
|
if (!response.accessibility) {
|
|
231
|
-
|
|
231
|
+
if (options.accessibility === true) {
|
|
232
|
+
handleErrorForAccessibility(null);
|
|
233
|
+
}
|
|
232
234
|
return;
|
|
233
235
|
}
|
|
234
236
|
if (!response.accessibility.success) {
|
|
@@ -237,9 +239,11 @@ export const processAccessibilityResponse = (response) => {
|
|
|
237
239
|
}
|
|
238
240
|
if (response.accessibility.options) {
|
|
239
241
|
const { accessibilityToken, pollingTimeout, scannerVersion } = jsonifyAccessibilityArray(response.accessibility.options.capabilities, 'name', 'value');
|
|
242
|
+
const result = jsonifyAccessibilityArray(response.accessibility.options.capabilities, 'name', 'value');
|
|
240
243
|
const scriptsJson = {
|
|
241
244
|
'scripts': jsonifyAccessibilityArray(response.accessibility.options.scripts, 'name', 'command'),
|
|
242
|
-
'commands': response.accessibility.options.commandsToWrap.commands
|
|
245
|
+
'commands': response.accessibility.options.commandsToWrap.commands,
|
|
246
|
+
'nonBStackInfraA11yChromeOptions': result['goog:chromeOptions']
|
|
243
247
|
};
|
|
244
248
|
if (scannerVersion) {
|
|
245
249
|
process.env.BSTACK_A11Y_SCANNER_VERSION = scannerVersion;
|
|
@@ -262,11 +266,9 @@ export const processLaunchBuildResponse = (response, options) => {
|
|
|
262
266
|
if (options.testObservability) {
|
|
263
267
|
processTestObservabilityResponse(response);
|
|
264
268
|
}
|
|
265
|
-
|
|
266
|
-
processAccessibilityResponse(response);
|
|
267
|
-
}
|
|
269
|
+
processAccessibilityResponse(response, options);
|
|
268
270
|
};
|
|
269
|
-
export const launchTestSession = PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.TESTHUB_EVENTS.START, o11yErrorHandler(async function launchTestSession(options, config, bsConfig, bStackConfig) {
|
|
271
|
+
export const launchTestSession = PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.TESTHUB_EVENTS.START, o11yErrorHandler(async function launchTestSession(options, config, bsConfig, bStackConfig, accessibilityAutomation) {
|
|
270
272
|
const launchBuildUsage = UsageStats.getInstance().launchBuildUsage;
|
|
271
273
|
launchBuildUsage.triggered();
|
|
272
274
|
const data = {
|
|
@@ -301,9 +303,13 @@ export const launchTestSession = PerformanceTester.measureWrapper(PERFORMANCE_SD
|
|
|
301
303
|
version: bsConfig.bstackServiceVersion
|
|
302
304
|
}
|
|
303
305
|
},
|
|
304
|
-
product_map:
|
|
306
|
+
product_map: getProductMapForBuildStartCall(bStackConfig, accessibilityAutomation),
|
|
305
307
|
config: {}
|
|
306
308
|
};
|
|
309
|
+
if (accessibilityAutomation && (isTurboScale(options) || data.browserstackAutomation === false)) {
|
|
310
|
+
data.accessibility.settings ??= {};
|
|
311
|
+
data.accessibility.settings.includeEncodedExtension = true;
|
|
312
|
+
}
|
|
307
313
|
try {
|
|
308
314
|
if (Object.keys(CrashReporter.userConfigForReporting).length === 0) {
|
|
309
315
|
CrashReporter.userConfigForReporting = process.env.USER_CONFIG_FOR_REPORTING !== undefined ? JSON.parse(process.env.USER_CONFIG_FOR_REPORTING) : {};
|
|
@@ -321,6 +327,7 @@ export const launchTestSession = PerformanceTester.measureWrapper(PERFORMANCE_SD
|
|
|
321
327
|
password: getObservabilityKey(options, config),
|
|
322
328
|
json: data
|
|
323
329
|
}).json();
|
|
330
|
+
delete data?.accessibility?.settings?.includeEncodedExtension;
|
|
324
331
|
BStackLogger.debug(`[Start_Build] Success response: ${JSON.stringify(response)}`);
|
|
325
332
|
process.env[TESTOPS_BUILD_COMPLETED_ENV] = 'true';
|
|
326
333
|
if (response.jwt) {
|
|
@@ -333,13 +340,14 @@ export const launchTestSession = PerformanceTester.measureWrapper(PERFORMANCE_SD
|
|
|
333
340
|
}
|
|
334
341
|
processLaunchBuildResponse(response, options);
|
|
335
342
|
launchBuildUsage.success();
|
|
343
|
+
return response;
|
|
336
344
|
}
|
|
337
345
|
catch (error) {
|
|
338
346
|
if (!error.success) {
|
|
339
347
|
launchBuildUsage.failed(error);
|
|
340
348
|
logBuildError(error);
|
|
341
|
-
return;
|
|
342
349
|
}
|
|
350
|
+
return null;
|
|
343
351
|
}
|
|
344
352
|
}));
|
|
345
353
|
export const validateCapsWithAppA11y = (platformMeta) => {
|
|
@@ -381,6 +389,17 @@ export const validateCapsWithA11y = (deviceName, platformMeta, chromeOptions) =>
|
|
|
381
389
|
}
|
|
382
390
|
return false;
|
|
383
391
|
};
|
|
392
|
+
export const validateCapsWithNonBstackA11y = (browserName, browserVersion) => {
|
|
393
|
+
if (browserName?.toLowerCase() !== 'chrome') {
|
|
394
|
+
BStackLogger.warn('Accessibility Automation will run only on Chrome browsers.');
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
if (!isUndefined(browserVersion) && !(browserVersion === 'latest' || parseFloat(browserVersion + '') > 100)) {
|
|
398
|
+
BStackLogger.warn('Accessibility Automation will run only on Chrome browser version greater than 100.');
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
return true;
|
|
402
|
+
};
|
|
384
403
|
export const shouldScanTestForAccessibility = (suiteTitle, testTitle, accessibilityOptions, world, isCucumber) => {
|
|
385
404
|
try {
|
|
386
405
|
const includeTags = Array.isArray(accessibilityOptions?.includeTagsInTestingScope) ? accessibilityOptions?.includeTagsInTestingScope : [];
|
|
@@ -438,10 +457,6 @@ export const _getParamsForAppAccessibility = (commandName) => {
|
|
|
438
457
|
};
|
|
439
458
|
export const performA11yScan = async (isAppAutomate, browser, isBrowserStackSession, isAccessibility, commandName) => {
|
|
440
459
|
return await PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.A11Y_EVENTS.PERFORM_SCAN, async () => {
|
|
441
|
-
if (!isBrowserStackSession) {
|
|
442
|
-
BStackLogger.warn('Not a BrowserStack Automate session, cannot perform Accessibility scan.');
|
|
443
|
-
return; // since we are running only on Automate as of now
|
|
444
|
-
}
|
|
445
460
|
if (!isAccessibilityAutomationSession(isAccessibility)) {
|
|
446
461
|
BStackLogger.warn('Not an Accessibility Automation session, cannot perform Accessibility scan.');
|
|
447
462
|
return;
|
|
@@ -463,10 +478,6 @@ export const performA11yScan = async (isAppAutomate, browser, isBrowserStackSess
|
|
|
463
478
|
}, { command: commandName })();
|
|
464
479
|
};
|
|
465
480
|
export const getA11yResults = PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.A11Y_EVENTS.GET_RESULTS, async (isAppAutomate, browser, isBrowserStackSession, isAccessibility) => {
|
|
466
|
-
if (!isBrowserStackSession) {
|
|
467
|
-
BStackLogger.warn('Not a BrowserStack Automate session, cannot retrieve Accessibility results.');
|
|
468
|
-
return []; // since we are running only on Automate as of now
|
|
469
|
-
}
|
|
470
481
|
if (!isAccessibilityAutomationSession(isAccessibility)) {
|
|
471
482
|
BStackLogger.warn('Not an Accessibility Automation session, cannot retrieve Accessibility results.');
|
|
472
483
|
return [];
|
|
@@ -535,9 +546,6 @@ const getAppA11yResultResponse = async (apiUrl, isAppAutomate, browser, isBrowse
|
|
|
535
546
|
return apiRespone;
|
|
536
547
|
};
|
|
537
548
|
export const getA11yResultsSummary = PerformanceTester.measureWrapper(PERFORMANCE_SDK_EVENTS.A11Y_EVENTS.GET_RESULTS_SUMMARY, async (isAppAutomate, browser, isBrowserStackSession, isAccessibility) => {
|
|
538
|
-
if (!isBrowserStackSession) {
|
|
539
|
-
return {}; // since we are running only on Automate as of now
|
|
540
|
-
}
|
|
541
549
|
if (!isAccessibilityAutomationSession(isAccessibility)) {
|
|
542
550
|
BStackLogger.warn('Not an Accessibility Automation session, cannot retrieve Accessibility results summary.');
|
|
543
551
|
return {};
|
|
@@ -1369,3 +1377,44 @@ export async function pollApi(url, params, headers, upperLimit, startTime = Date
|
|
|
1369
1377
|
}
|
|
1370
1378
|
}
|
|
1371
1379
|
}
|
|
1380
|
+
export function getBooleanValueFromString(value) {
|
|
1381
|
+
if (!value) {
|
|
1382
|
+
return false;
|
|
1383
|
+
}
|
|
1384
|
+
return ['true'].includes(value.trim().toLowerCase());
|
|
1385
|
+
}
|
|
1386
|
+
export function mergeDeep(target, ...sources) {
|
|
1387
|
+
if (!sources.length) {
|
|
1388
|
+
return target;
|
|
1389
|
+
}
|
|
1390
|
+
const source = sources.shift();
|
|
1391
|
+
if (isObject(target) && isObject(source)) {
|
|
1392
|
+
for (const key in source) {
|
|
1393
|
+
const sourceValue = source[key];
|
|
1394
|
+
const targetValue = target[key];
|
|
1395
|
+
if (isObject(sourceValue)) {
|
|
1396
|
+
if (!targetValue || !isObject(targetValue)) {
|
|
1397
|
+
target[key] = {};
|
|
1398
|
+
}
|
|
1399
|
+
mergeDeep(target[key], sourceValue);
|
|
1400
|
+
}
|
|
1401
|
+
else {
|
|
1402
|
+
target[key] = sourceValue;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
return mergeDeep(target, ...sources);
|
|
1407
|
+
}
|
|
1408
|
+
export function mergeChromeOptions(base, override) {
|
|
1409
|
+
const merged = { ...base };
|
|
1410
|
+
if (override.args) {
|
|
1411
|
+
merged.args = [...(base.args || []), ...override.args];
|
|
1412
|
+
}
|
|
1413
|
+
if (override.extensions) {
|
|
1414
|
+
merged.extensions = [...(base.extensions || []), ...override.extensions];
|
|
1415
|
+
}
|
|
1416
|
+
if (override.prefs) {
|
|
1417
|
+
merged.prefs = mergeDeep({ ...(base.prefs || {}) }, override.prefs);
|
|
1418
|
+
}
|
|
1419
|
+
return merged;
|
|
1420
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browserstack-service",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.45.0",
|
|
4
4
|
"description": "WebdriverIO service for better Browserstack integration",
|
|
5
5
|
"author": "Adam Bjerstedt <abjerstedt@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browserstack-service",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"gitconfiglocal": "^2.1.0",
|
|
46
46
|
"got": "^12.6.1",
|
|
47
47
|
"uuid": "^10.0.0",
|
|
48
|
-
"webdriverio": "8.
|
|
48
|
+
"webdriverio": "8.45.0",
|
|
49
49
|
"winston-transport": "^4.5.0",
|
|
50
50
|
"yauzl": "^3.0.0"
|
|
51
51
|
},
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^22.2.0",
|
|
57
|
-
"@wdio/globals": "8.
|
|
57
|
+
"@wdio/globals": "8.45.0"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "7836fbee7a85a16f2b7faa592969f914c504ba8a"
|
|
63
63
|
}
|