@wdio/browserstack-service 9.20.0 → 9.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Percy/Percy-Handler.d.ts.map +1 -1
- package/build/Percy/Percy.d.ts.map +1 -1
- package/build/accessibility-handler.d.ts +6 -3
- package/build/accessibility-handler.d.ts.map +1 -1
- package/build/cleanup.js +59 -19
- package/build/cli/apiUtils.d.ts +14 -0
- package/build/cli/apiUtils.d.ts.map +1 -0
- package/build/cli/cliLogger.d.ts +16 -0
- package/build/cli/cliLogger.d.ts.map +1 -0
- package/build/cli/cliUtils.d.ts +46 -0
- package/build/cli/cliUtils.d.ts.map +1 -0
- package/build/cli/eventDispatcher.d.ts +28 -0
- package/build/cli/eventDispatcher.d.ts.map +1 -0
- package/build/cli/frameworks/automationFramework.d.ts +89 -0
- package/build/cli/frameworks/automationFramework.d.ts.map +1 -0
- package/build/cli/frameworks/constants/automationFrameworkConstants.d.ts +18 -0
- package/build/cli/frameworks/constants/automationFrameworkConstants.d.ts.map +1 -0
- package/build/cli/frameworks/constants/testFrameworkConstants.d.ts +43 -0
- package/build/cli/frameworks/constants/testFrameworkConstants.d.ts.map +1 -0
- package/build/cli/frameworks/testFramework.d.ts +89 -0
- package/build/cli/frameworks/testFramework.d.ts.map +1 -0
- package/build/cli/frameworks/wdioAutomationFramework.d.ts +28 -0
- package/build/cli/frameworks/wdioAutomationFramework.d.ts.map +1 -0
- package/build/cli/frameworks/wdioMochaTestFramework.d.ts +82 -0
- package/build/cli/frameworks/wdioMochaTestFramework.d.ts.map +1 -0
- package/build/cli/grpcClient.d.ts +70 -0
- package/build/cli/grpcClient.d.ts.map +1 -0
- package/build/cli/index.d.ts +148 -0
- package/build/cli/index.d.ts.map +1 -0
- package/build/cli/instances/automationFrameworkInstance.d.ts +33 -0
- package/build/cli/instances/automationFrameworkInstance.d.ts.map +1 -0
- package/build/cli/instances/testFrameworkInstance.d.ts +62 -0
- package/build/cli/instances/testFrameworkInstance.d.ts.map +1 -0
- package/build/cli/instances/trackedContext.d.ts +32 -0
- package/build/cli/instances/trackedContext.d.ts.map +1 -0
- package/build/cli/instances/trackedInstance.d.ts +40 -0
- package/build/cli/instances/trackedInstance.d.ts.map +1 -0
- package/build/cli/modules/accessibilityModule.d.ts +34 -0
- package/build/cli/modules/accessibilityModule.d.ts.map +1 -0
- package/build/cli/modules/automateModule.d.ts +26 -0
- package/build/cli/modules/automateModule.d.ts.map +1 -0
- package/build/cli/modules/baseModule.d.ts +34 -0
- package/build/cli/modules/baseModule.d.ts.map +1 -0
- package/build/cli/modules/observabilityModule.d.ts +22 -0
- package/build/cli/modules/observabilityModule.d.ts.map +1 -0
- package/build/cli/modules/percyModule.d.ts +19 -0
- package/build/cli/modules/percyModule.d.ts.map +1 -0
- package/build/cli/modules/testHubModule.d.ts +30 -0
- package/build/cli/modules/testHubModule.d.ts.map +1 -0
- package/build/cli/modules/webdriverIOModule.d.ts +29 -0
- package/build/cli/modules/webdriverIOModule.d.ts.map +1 -0
- package/build/cli/states/automationFrameworkState.d.ts +65 -0
- package/build/cli/states/automationFrameworkState.d.ts.map +1 -0
- package/build/cli/states/hookState.d.ts +45 -0
- package/build/cli/states/hookState.d.ts.map +1 -0
- package/build/cli/states/testFrameworkState.d.ts +125 -0
- package/build/cli/states/testFrameworkState.d.ts.map +1 -0
- package/build/constants.d.ts +5 -0
- package/build/constants.d.ts.map +1 -1
- package/build/crash-reporter.d.ts.map +1 -1
- package/build/exitHandler.d.ts.map +1 -1
- package/build/index.d.ts +48 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6483 -2671
- package/build/insights-handler.d.ts +2 -0
- package/build/insights-handler.d.ts.map +1 -1
- package/build/instrumentation/funnelInstrumentation.d.ts.map +1 -1
- package/build/instrumentation/performance/constants.d.ts +8 -0
- package/build/instrumentation/performance/constants.d.ts.map +1 -1
- package/build/instrumentation/performance/performance-tester.d.ts.map +1 -1
- package/build/launcher.d.ts.map +1 -1
- package/build/scripts/accessibility-scripts.d.ts +1 -0
- package/build/scripts/accessibility-scripts.d.ts.map +1 -1
- package/build/service.d.ts +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/types.d.ts +5 -0
- package/build/types.d.ts.map +1 -1
- package/build/util.d.ts +11 -1
- package/build/util.d.ts.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type TrackedContext from '../instances/trackedContext.js';
|
|
2
|
+
import TrackedInstance from '../instances/trackedInstance.js';
|
|
3
|
+
import type TestFrameworkInstance from '../instances/testFrameworkInstance.js';
|
|
4
|
+
export default class TestFramework {
|
|
5
|
+
static instances: Map<any, any>;
|
|
6
|
+
testFrameworks: Array<string>;
|
|
7
|
+
testFrameworkVersions: Record<string, string>;
|
|
8
|
+
binSessionId: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Constructor for the TestFramework
|
|
11
|
+
* @param {Array} testFrameworks - List of Test frameworks
|
|
12
|
+
* @param {Map} testFrameworkVersions - Name of the Test frameworks
|
|
13
|
+
* @param {string} binSessionId - BinSessionId
|
|
14
|
+
*/
|
|
15
|
+
constructor(testFrameworks: Array<string>, testFrameworkVersions: Record<string, string>, binSessionId: string);
|
|
16
|
+
/**
|
|
17
|
+
* get all instances
|
|
18
|
+
* @return {Map} - return all instances Map
|
|
19
|
+
*/
|
|
20
|
+
getInstances(): Map<any, any>;
|
|
21
|
+
/**
|
|
22
|
+
* set testFrameworkInstance
|
|
23
|
+
* @param {TrackedContext} context
|
|
24
|
+
* @param {TestFrameworkInstance} instance
|
|
25
|
+
*/
|
|
26
|
+
setInstance(context: TrackedContext, instance: TestFrameworkInstance): void;
|
|
27
|
+
/**
|
|
28
|
+
* Find instance and track any state for the test framework
|
|
29
|
+
* @returns instance
|
|
30
|
+
*/
|
|
31
|
+
static getTrackedInstance(): any;
|
|
32
|
+
/**
|
|
33
|
+
* Set tracked instance
|
|
34
|
+
* @returns {string} The name of the test framework
|
|
35
|
+
*/
|
|
36
|
+
static setTrackedInstance(context: TrackedContext, instance: TestFrameworkInstance): void;
|
|
37
|
+
/**
|
|
38
|
+
* get all test framework versions
|
|
39
|
+
* @returns {Map} - return all versions of framework available.
|
|
40
|
+
*/
|
|
41
|
+
getTestFrameworksVersions(): Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* get all test frameworks
|
|
44
|
+
* @returns {Array} - return all test frameworks
|
|
45
|
+
*/
|
|
46
|
+
getTestFrameworks(): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Track an event
|
|
49
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
50
|
+
* @param {HookState} hookState
|
|
51
|
+
* @param {*} args
|
|
52
|
+
* @returns {void}
|
|
53
|
+
*/
|
|
54
|
+
trackEvent(testFrameworkState: State, hookState: State, args?: unknown): void;
|
|
55
|
+
/**
|
|
56
|
+
* run test hooks
|
|
57
|
+
* @param {TestFrameworkInstance} instance
|
|
58
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
59
|
+
* @param {HookState} hookState
|
|
60
|
+
* @param {*} args
|
|
61
|
+
*/
|
|
62
|
+
runHooks(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State, args?: unknown): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Register an observer
|
|
65
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
66
|
+
* @param {HookState} hookState
|
|
67
|
+
* @param {*} callback
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
70
|
+
static registerObserver(testFrameworkState: State, hookState: State, callback: Function): void;
|
|
71
|
+
/**
|
|
72
|
+
* Resolve instance for the test framework
|
|
73
|
+
* @param {TestFrameworkInstance} testFrameworkInstance
|
|
74
|
+
* @param {string} key
|
|
75
|
+
* @returns {TestFrameworkInstance}
|
|
76
|
+
*/
|
|
77
|
+
static getState(instance: TestFrameworkInstance, key: string): any;
|
|
78
|
+
static hasState(instance: TestFrameworkInstance, key: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Set the state
|
|
81
|
+
* @param {TrackedInstance} instance - The instance
|
|
82
|
+
* @param {string} key - The key
|
|
83
|
+
* @param {*} value - The value
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
static setState(instance: TrackedInstance, key: string, value: unknown): void;
|
|
87
|
+
updateInstanceState(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State): void;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=testFramework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testFramework.d.ts","sourceRoot":"","sources":["../../../src/cli/frameworks/testFramework.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAA;AAChE,OAAO,eAAe,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,qBAAqB,MAAM,uCAAuC,CAAA;AAE9E,MAAM,CAAC,OAAO,OAAO,aAAa;IAC9B,MAAM,CAAC,SAAS,gBAAY;IAC5B,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAK;IAClC,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAClD,YAAY,EAAE,MAAM,GAAC,IAAI,CAAO;IAEhC;;;;;IAKA;gBACY,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM;IAM9G;;;IAGA;IACA,YAAY;IAIZ;;;;IAIA;IACA,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,qBAAqB;IAIpE;;;IAGA;IACA,MAAM,CAAC,kBAAkB;IAKzB;;;KAGC;IACD,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,qBAAqB;IAIlF;;;KAGC;IACD,yBAAyB;IAIzB;;;KAGC;IACD,iBAAiB;IAIjB;;;;;;KAMC;IACD,UAAU,CAAC,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,OAAY;IAI1E;;;;;;KAMC;IACK,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,OAAY;IAO/G;;;;;;KAMC;IACD,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;IAIvF;;;;;KAKC;IACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM;IAI5D,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM;IAI5D;;;;;;KAMC;IACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAItE,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK;CAOnG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AutomationFramework from './automationFramework.js';
|
|
2
|
+
/**
|
|
3
|
+
* WebdriverIO Framework class
|
|
4
|
+
*/
|
|
5
|
+
export default class WdioAutomationFramework extends AutomationFramework {
|
|
6
|
+
constructor(automationFrameworkName: string, automationFrameworkVersion: string);
|
|
7
|
+
/**
|
|
8
|
+
* Find instance and track any state for the automation framework
|
|
9
|
+
* @param {*} automationFrameworkState
|
|
10
|
+
* @param {*} hookState
|
|
11
|
+
* @param {*} args
|
|
12
|
+
*/
|
|
13
|
+
trackEvent(automationFrameworkState: State, hookState: State, args?: Record<string, unknown>): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve instance for the automation framework
|
|
16
|
+
* @param {*} automationFrameworkState
|
|
17
|
+
* @param {*} hookState
|
|
18
|
+
* @param {*} args
|
|
19
|
+
* @returns instance
|
|
20
|
+
*/
|
|
21
|
+
resolveInstance(automationFrameworkState: State, hookState: State, args?: Record<string, unknown>): any;
|
|
22
|
+
/**
|
|
23
|
+
* Create instance for WebdriverIO
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
trackWebdriverIOInstance(automationFrameworkState: State, args?: Record<string, unknown>): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=wdioAutomationFramework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wdioAutomationFramework.d.ts","sourceRoot":"","sources":["../../../src/cli/frameworks/wdioAutomationFramework.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAO1D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,mBAAmB;gBAExD,uBAAuB,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM;IAI/E;;;;;OAKG;IACG,UAAU,CAAC,wBAAwB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAatG;;;;;;OAMG;IACH,eAAe,CAAC,wBAAwB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAWrG;;;OAGG;IACH,wBAAwB,CAAC,wBAAwB,EAAE,KAAK,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAwB/F"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import TestFramework from './testFramework.js';
|
|
2
|
+
import TestFrameworkInstance from '../instances/testFrameworkInstance.js';
|
|
3
|
+
import type { Frameworks } from '@wdio/types';
|
|
4
|
+
export default class WdioMochaTestFramework extends TestFramework {
|
|
5
|
+
static KEY_HOOK_LAST_STARTED: string;
|
|
6
|
+
static KEY_HOOK_LAST_FINISHED: string;
|
|
7
|
+
/**
|
|
8
|
+
* Constructor for the TestFramework
|
|
9
|
+
* @param {Array} testFrameworks - List of Test frameworks
|
|
10
|
+
* @param {Map} testFrameworkVersions - Name of the Test frameworks
|
|
11
|
+
* @param {string} binSessionId - BinSessionId
|
|
12
|
+
*/
|
|
13
|
+
constructor(testFrameworks: string[], testFrameworkVersions: Record<string, string>, binSessionId: string);
|
|
14
|
+
/**
|
|
15
|
+
* Find instance and track any state for the test framework
|
|
16
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
17
|
+
* @param {HookState} hookState
|
|
18
|
+
* @param {*} args
|
|
19
|
+
*/
|
|
20
|
+
trackEvent(testFrameworkState: State, hookState: State, args?: Record<string, unknown>): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve instance for the test framework
|
|
23
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
24
|
+
* @param {HookState} hookState
|
|
25
|
+
* @param {*} args
|
|
26
|
+
* @returns {TestFrameworkInstance}
|
|
27
|
+
*/
|
|
28
|
+
resolveInstance(testFrameworkState: State, hookState: State, args?: Record<string, unknown>): TestFrameworkInstance | null;
|
|
29
|
+
/**
|
|
30
|
+
* Track WebdriverIO instance
|
|
31
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
32
|
+
* @param {*} args
|
|
33
|
+
*/
|
|
34
|
+
trackWdioMochaInstance(testFrameworkState: State, args: Record<string, unknown>): void;
|
|
35
|
+
getTestData(instance: TestFrameworkInstance, test: Frameworks.Test): Promise<Record<string, unknown>>;
|
|
36
|
+
loadTestResult(instance: TestFrameworkInstance, args: Record<string, unknown>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Load log entries into the test framework instance.
|
|
39
|
+
* @param instance TestFrameworkInstance
|
|
40
|
+
* @param testFrameworkState TestFrameworkState
|
|
41
|
+
* @param hookState HookState
|
|
42
|
+
* @param args Additional arguments (level, message, etc.)
|
|
43
|
+
*/
|
|
44
|
+
loadLogEntries(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State, logEntry: Record<string, unknown>): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get the last active hook for the given instance and hook key.
|
|
47
|
+
* @param instance TestFrameworkInstance
|
|
48
|
+
* @param lastHookKey string
|
|
49
|
+
* @returns Record<string, unknown> | null
|
|
50
|
+
*/
|
|
51
|
+
static lastActiveHook(instance: TestFrameworkInstance, lastHookKey: string): Record<string, unknown> | null;
|
|
52
|
+
/**
|
|
53
|
+
* Clear logs for a specific hook.
|
|
54
|
+
* @param instance TestFrameworkInstance
|
|
55
|
+
* @param lastHookKey string
|
|
56
|
+
*/
|
|
57
|
+
static clearHookLogs(instance: TestFrameworkInstance, lastHookKey: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Clear all logs for the given instance, test framework state, and hook state.
|
|
60
|
+
* @param instance TestFrameworkInstance
|
|
61
|
+
* @param testFrameworkState TestFrameworkState
|
|
62
|
+
* @param hookState HookState
|
|
63
|
+
*/
|
|
64
|
+
static clearLogs(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get all log entries for the given instance, test framework state, and hook state.
|
|
67
|
+
* @param instance TestFrameworkInstance
|
|
68
|
+
* @param testFrameworkState TestFrameworkState
|
|
69
|
+
* @param hookState HookState
|
|
70
|
+
* @returns unknown[]
|
|
71
|
+
*/
|
|
72
|
+
static getLogEntries(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State): unknown[];
|
|
73
|
+
/**
|
|
74
|
+
* Track hook events for the test framework.
|
|
75
|
+
* @param instance TestFrameworkInstance
|
|
76
|
+
* @param testFrameworkState TestFrameworkState
|
|
77
|
+
* @param hookState HookState
|
|
78
|
+
* @param args Additional arguments (e.g., test result, test method)
|
|
79
|
+
*/
|
|
80
|
+
trackHookEvents(instance: TestFrameworkInstance, testFrameworkState: State, hookState: State, args: Record<string, unknown>): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=wdioMochaTestFramework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wdioMochaTestFramework.d.ts","sourceRoot":"","sources":["../../../src/cli/frameworks/wdioMochaTestFramework.ts"],"names":[],"mappings":"AAGA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAG9C,OAAO,qBAAqB,MAAM,uCAAuC,CAAA;AAKzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI7C,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,aAAa;IAC7D,MAAM,CAAC,qBAAqB,SAA2B;IACvD,MAAM,CAAC,sBAAsB,SAA4B;IAEzD;;;;;IAKA;gBACY,cAAc,EAAE,MAAM,EAAE,EAAE,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM;IAIzG;;;;;IAKA;IACM,UAAU,CAAC,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAoDhG;;;;;;KAMC;IACD,eAAe,CAAC,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,qBAAqB,GAAC,IAAI;IAa5H;;;;KAIC;IACD,sBAAsB,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAqCzE,WAAW,CAAC,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI;IAmBxE,cAAc,CAAC,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAwB7E;;;;;;OAMG;IACH,cAAc,CAAC,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA6B9H;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAqB3G;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM;IAOzE;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK;IAY7F;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,EAAE;IAY7G;;;;;;OAMG;IACG,eAAe,CACjB,QAAQ,EAAE,qBAAqB,EAC/B,kBAAkB,EAAE,KAAK,EACzB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAwDpC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SDKClient, grpcChannel } from '@browserstack/wdio-browserstack-service';
|
|
2
|
+
import type { TestFrameworkEventRequest, TestSessionEventRequest, LogCreatedEventRequest, DriverInitRequest, FetchDriverExecuteParamsEventRequest, ConnectBinSessionResponse, StartBinSessionResponse, TestFrameworkEventResponse, TestSessionEventResponse, LogCreatedEventResponse, DriverInitResponse, FetchDriverExecuteParamsEventResponse } from '@browserstack/wdio-browserstack-service';
|
|
3
|
+
import { BStackLogger } from './cliLogger.js';
|
|
4
|
+
/**
|
|
5
|
+
* GrpcClient - Singleton class for managing gRPC client connections
|
|
6
|
+
*
|
|
7
|
+
* This class uses the singleton pattern to ensure only one gRPC client instance exists
|
|
8
|
+
* throughout the application lifecycle.
|
|
9
|
+
*/
|
|
10
|
+
export declare class GrpcClient {
|
|
11
|
+
#private;
|
|
12
|
+
binSessionId: string | undefined;
|
|
13
|
+
listenAddress: string | undefined;
|
|
14
|
+
channel: grpcChannel | null;
|
|
15
|
+
client: SDKClient | null;
|
|
16
|
+
logger: typeof BStackLogger;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Get the singleton instance of GrpcClient
|
|
20
|
+
* @returns {GrpcClient} The singleton instance
|
|
21
|
+
*/
|
|
22
|
+
static getInstance(): GrpcClient;
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the gRPC client connection
|
|
25
|
+
* @param {string} host The gRPC server host
|
|
26
|
+
* @param {number} port The gRPC server port
|
|
27
|
+
*/
|
|
28
|
+
init(params: Record<string, string>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Connect to the gRPC server
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
connect(): void;
|
|
34
|
+
startBinSession(wdioConfig: string): Promise<StartBinSessionResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Connect to the bin session
|
|
37
|
+
* @returns {Promise<Object>} The response from the gRPC call
|
|
38
|
+
*/
|
|
39
|
+
connectBinSession(): Promise<ConnectBinSessionResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Stop the bin session
|
|
42
|
+
* @returns {Promise<void>}
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
stopBinSession(): Promise<unknown>;
|
|
46
|
+
testSessionEvent(data: Omit<TestSessionEventRequest, 'binSessionId'>): Promise<TestSessionEventResponse>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* Send TestFrameworkEvent
|
|
50
|
+
*/
|
|
51
|
+
testFrameworkEvent(data: Omit<TestFrameworkEventRequest, 'binSessionId'>): Promise<TestFrameworkEventResponse>;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* Send driverInitEvent
|
|
55
|
+
*/
|
|
56
|
+
driverInitEvent(data: Omit<DriverInitRequest, 'binSessionId'>): Promise<DriverInitResponse>;
|
|
57
|
+
logCreatedEvent(data: Omit<LogCreatedEventRequest, 'binSessionId'>): Promise<LogCreatedEventResponse>;
|
|
58
|
+
fetchDriverExecuteParamsEvent(data: Omit<FetchDriverExecuteParamsEventRequest, 'binSessionId'>): Promise<FetchDriverExecuteParamsEventResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Get the gRPC channel
|
|
61
|
+
* @returns {grpc.Channel} The gRPC channel
|
|
62
|
+
*/
|
|
63
|
+
getClient(): SDKClient | null;
|
|
64
|
+
/**
|
|
65
|
+
* Get the gRPC channel
|
|
66
|
+
* @returns {grpc.Channel} The gRPC channel
|
|
67
|
+
*/
|
|
68
|
+
getChannel(): grpcChannel | null;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=grpcClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpcClient.d.ts","sourceRoot":"","sources":["../../src/cli/grpcClient.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,SAAS,EAET,WAAW,EAad,MAAM,yCAAyC,CAAA;AAGhD,OAAO,KAAK,EAGR,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EAEtB,iBAAiB,EACjB,oCAAoC,EACpC,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,qCAAqC,EACxC,MAAM,yCAAyC,CAAA;AAIhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C;;;;;GAKG;AACH,qBAAa,UAAU;;IAGnB,YAAY,EAAE,MAAM,GAAC,SAAS,CAAA;IAC9B,aAAa,EAAE,MAAM,GAAC,SAAS,CAAA;IAC/B,OAAO,EAAE,WAAW,GAAC,IAAI,CAAO;IAChC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAO;IAC/B,MAAM,sBAAe;;IAIrB;;;OAGG;IACH,MAAM,CAAC,WAAW;IAOlB;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAcnC;;;OAGG;IACH,OAAO;IAkCD,eAAe,CAAC,UAAU,EAAE,MAAM;IAkDxC;;;OAGG;IACG,iBAAiB;IAgCvB;;;;OAIG;IACG,cAAc;IAoCd,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,uBAAuB,EAAE,cAAc,CAAC;IAoD1E;;;OAGG;IAEG,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE,cAAc,CAAC;IA0C9E;;;OAGG;IAEG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IA8B7D,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAoDlE,6BAA6B,CAAC,IAAI,EAAE,IAAI,CAAC,oCAAoC,EAAE,cAAc,CAAC;IA6BpG;;;OAGG;IACH,SAAS;IAIT;;;OAGG;IACH,UAAU;CAGb"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { BStackLogger } from './cliLogger.js';
|
|
2
|
+
import type { ChildProcess } from 'node:child_process';
|
|
3
|
+
import type { StartBinSessionResponse } from '@browserstack/wdio-browserstack-service';
|
|
4
|
+
import type BaseModule from './modules/baseModule.js';
|
|
5
|
+
import type { Options } from '@wdio/types';
|
|
6
|
+
import WdioMochaTestFramework from './frameworks/wdioMochaTestFramework.js';
|
|
7
|
+
import WdioAutomationFramework from './frameworks/wdioAutomationFramework.js';
|
|
8
|
+
import type { BrowserstackConfig, BrowserstackOptions } from '../types.js';
|
|
9
|
+
/**
|
|
10
|
+
* BrowserstackCLI - Singleton class for managing CLI operations
|
|
11
|
+
*
|
|
12
|
+
* This class uses the singleton pattern to ensure only one instance exists
|
|
13
|
+
* throughout the application lifecycle.
|
|
14
|
+
*/
|
|
15
|
+
export declare class BrowserstackCLI {
|
|
16
|
+
#private;
|
|
17
|
+
static enabled: boolean;
|
|
18
|
+
initialized: boolean;
|
|
19
|
+
config: Record<string, unknown>;
|
|
20
|
+
wdioConfig: string;
|
|
21
|
+
cliArgs: object;
|
|
22
|
+
browserstackConfig: Options.Testrunner | {};
|
|
23
|
+
process: ChildProcess | null;
|
|
24
|
+
isMainConnected: boolean;
|
|
25
|
+
isChildConnected: boolean;
|
|
26
|
+
binSessionId: string | null;
|
|
27
|
+
modules: Record<string, BaseModule>;
|
|
28
|
+
testFramework: WdioMochaTestFramework | null;
|
|
29
|
+
cliParams: Record<string, string> | null;
|
|
30
|
+
automationFramework: WdioAutomationFramework | null;
|
|
31
|
+
SDK_CLI_BIN_PATH: string | null;
|
|
32
|
+
logger: typeof BStackLogger;
|
|
33
|
+
options: BrowserstackConfig & BrowserstackOptions | {};
|
|
34
|
+
constructor();
|
|
35
|
+
/**
|
|
36
|
+
* Get the singleton instance of BrowserstackCLI
|
|
37
|
+
* @returns {BrowserstackCLI} The singleton instance
|
|
38
|
+
*/
|
|
39
|
+
static getInstance(): BrowserstackCLI;
|
|
40
|
+
/**
|
|
41
|
+
* Bootstrap the CLI
|
|
42
|
+
* Initializes and starts the CLI based on environment settings
|
|
43
|
+
* @returns {Promise<void>}
|
|
44
|
+
*/
|
|
45
|
+
bootstrap(options: BrowserstackConfig & BrowserstackOptions, config?: Options.Testrunner, wdioConfig?: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Start as a main process
|
|
48
|
+
* @returns {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
startMain(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Load modules
|
|
53
|
+
* @param {Object} startBinResponse - StartBinSession response
|
|
54
|
+
*/
|
|
55
|
+
loadModules(startBinResponse: StartBinSessionResponse): void;
|
|
56
|
+
/**
|
|
57
|
+
* Configure modules
|
|
58
|
+
* @returns {Promise<void>}
|
|
59
|
+
*/
|
|
60
|
+
configureModules(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Start the CLI process and return a promise that resolves when it's ready
|
|
63
|
+
* @returns {Promise<void>}
|
|
64
|
+
* @throws {Error} If the process fails to start
|
|
65
|
+
*/
|
|
66
|
+
start(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Stop the CLI
|
|
69
|
+
* @returns {Promise<void>}
|
|
70
|
+
*/
|
|
71
|
+
stop(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Unconfigure modules
|
|
74
|
+
* @returns {Promise<void>}
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
unConfigureModules(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Load CLI parameters from the output
|
|
80
|
+
* @param {Object} params - Parameters parsed from CLI output
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
loadCliParams(params: Record<string, string>): void;
|
|
84
|
+
/**
|
|
85
|
+
* Start as a child process with the specified binSessionId
|
|
86
|
+
* @param {string} binSessionId - session ID to connect to the CLI process
|
|
87
|
+
* @returns {Promise<void>}
|
|
88
|
+
*/
|
|
89
|
+
startChild(binSessionId: string): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Check if the CLI is running
|
|
92
|
+
* @returns {boolean} True if the CLI is running
|
|
93
|
+
*/
|
|
94
|
+
isRunning(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Get the Browserstack configuration
|
|
97
|
+
* @returns {Object} The Browserstack configuration
|
|
98
|
+
*/
|
|
99
|
+
getBrowserstackConfig(): {} | Options.Testrunner;
|
|
100
|
+
/**
|
|
101
|
+
* Set the Browserstack configuration
|
|
102
|
+
* @param {Object}
|
|
103
|
+
* @returns {void}
|
|
104
|
+
*/
|
|
105
|
+
setBrowserstackConfig(browserstackConfig: Options.Testrunner): void;
|
|
106
|
+
/**
|
|
107
|
+
* Get the CLI binary path
|
|
108
|
+
* @returns {string} The CLI binary path
|
|
109
|
+
*/
|
|
110
|
+
getCliBinPath(): Promise<string>;
|
|
111
|
+
/**
|
|
112
|
+
* Check if the CLI is enabled
|
|
113
|
+
* @returns {boolean} True if the CLI is enabled
|
|
114
|
+
*/
|
|
115
|
+
isCliEnabled(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Get the configuration
|
|
118
|
+
* @returns {Object} The configuration
|
|
119
|
+
*/
|
|
120
|
+
getConfig(): Record<string, unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* Set the configuration
|
|
123
|
+
* @param {Object}
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
setConfig(response: StartBinSessionResponse): void;
|
|
127
|
+
/**
|
|
128
|
+
* Setup the test framework
|
|
129
|
+
* @returns {void}
|
|
130
|
+
*/
|
|
131
|
+
setupTestFramework(): void;
|
|
132
|
+
/**
|
|
133
|
+
* Setup the automation framework
|
|
134
|
+
* @returns {void}
|
|
135
|
+
*/
|
|
136
|
+
setupAutomationFramework(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Get the test framework
|
|
139
|
+
* @returns {Object} The test framework
|
|
140
|
+
*/
|
|
141
|
+
getTestFramework(): WdioMochaTestFramework | null;
|
|
142
|
+
/**
|
|
143
|
+
* Get the automation framework
|
|
144
|
+
* @returns {Object} The automation framework
|
|
145
|
+
*/
|
|
146
|
+
getAutomationFramework(): WdioAutomationFramework | null;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AACtF,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAA;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,sBAAsB,MAAM,wCAAwC,CAAA;AAC3E,OAAO,uBAAuB,MAAM,yCAAyC,CAAA;AAK7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAkB,MAAM,aAAa,CAAA;AAI1F;;;;;GAKG;AACH,qBAAa,eAAe;;IAExB,MAAM,CAAC,OAAO,UAAQ;IACtB,WAAW,EAAC,OAAO,CAAA;IACnB,MAAM,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAC,MAAM,CAAA;IACd,kBAAkB,EAAE,OAAO,CAAC,UAAU,GAAC,EAAE,CAAA;IACzC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAO;IACnC,eAAe,UAAQ;IACvB,gBAAgB,UAAQ;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAK;IACxC,aAAa,EAAE,sBAAsB,GAAC,IAAI,CAAO;IACjD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAO;IAC/C,mBAAmB,EAAE,uBAAuB,GAAC,IAAI,CAAO;IACxD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IACtC,MAAM,sBAAe;IACrB,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,EAAE,CAAA;;IAWtD;;;OAGG;IACH,MAAM,CAAC,WAAW;IAOlB;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,EAAE,UAAU,SAAG;IA2B7G;;;OAGG;IACG,SAAS;IAWf;;;OAGG;IACH,WAAW,CAAC,gBAAgB,EAAE,uBAAuB;IAgDrD;;;OAGG;IACG,gBAAgB;IAUtB;;;;OAIG;IACG,KAAK;IAuEX;;;OAGG;IACG,IAAI;IA8CV;;;;OAIG;IACG,kBAAkB;IASxB;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAM5C;;;;OAIG;IACG,UAAU,CAAC,YAAY,EAAE,MAAM;IAgBrC;;;OAGG;IACH,SAAS;IAWT;;;OAGG;IACH,qBAAqB;IAIrB;;;;OAIG;IACH,qBAAqB,CAAC,kBAAkB,EAAC,OAAO,CAAC,UAAU;IAI3D;;;OAGG;IACG,aAAa;IAOnB;;;OAGG;IACH,YAAY;IAIZ;;;OAGG;IACH,SAAS;IAIT;;;;MAIE;IACF,SAAS,CAAC,QAAQ,EAAE,uBAAuB;IAS3C;;;OAGG;IACH,kBAAkB;IAOlB;;;OAGG;IACH,wBAAwB;IAOxB;;;OAGG;IACH,gBAAgB;IAIhB;;;OAGG;IACH,sBAAsB;CAGzB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type TrackedContext from './trackedContext.js';
|
|
2
|
+
import TrackedInstance from './trackedInstance.js';
|
|
3
|
+
/**
|
|
4
|
+
* Class representing an automation framework instance
|
|
5
|
+
* @extends TrackedInstance
|
|
6
|
+
*/
|
|
7
|
+
export default class AutomationFrameworkInstance extends TrackedInstance {
|
|
8
|
+
frameworkName: string;
|
|
9
|
+
frameworkVersion: string;
|
|
10
|
+
state: State;
|
|
11
|
+
constructor(context: TrackedContext, frameworkName: string, frameworkVersion: string, state: State);
|
|
12
|
+
/**
|
|
13
|
+
* Get the framework name
|
|
14
|
+
* @returns {string} The name of the automation framework
|
|
15
|
+
*/
|
|
16
|
+
getFrameworkName(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the framework version
|
|
19
|
+
* @returns {string} The version of the automation framework
|
|
20
|
+
*/
|
|
21
|
+
getFrameworkVersion(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the current state
|
|
24
|
+
* @returns {AutomationFrameworkState} The current state of the automation framework
|
|
25
|
+
*/
|
|
26
|
+
getState(): State;
|
|
27
|
+
/**
|
|
28
|
+
* Set the current state
|
|
29
|
+
* @param {AutomationFrameworkState} state - The new state to set
|
|
30
|
+
*/
|
|
31
|
+
setState(state: State): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=automationFrameworkInstance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automationFrameworkInstance.d.ts","sourceRoot":"","sources":["../../../src/cli/instances/automationFrameworkInstance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAElD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,eAAe;IACpE,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,KAAK,CAAA;gBAEA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IAOlG;;;KAGC;IACD,gBAAgB;IAIhB;;;KAGC;IACD,mBAAmB;IAInB;;;KAGC;IACD,QAAQ;IAIR;;;KAGC;IACD,QAAQ,CAAC,KAAK,EAAE,KAAK;CAGxB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import TrackedInstance from './trackedInstance.js';
|
|
2
|
+
import type TrackedContext from './trackedContext.js';
|
|
3
|
+
export default class TestFrameworkInstance extends TrackedInstance {
|
|
4
|
+
#private;
|
|
5
|
+
testFrameworks: Array<string>;
|
|
6
|
+
testFrameworksVersions: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* create TestFrameworkInstance
|
|
9
|
+
* @param {TrackedContext} context
|
|
10
|
+
* @param {Array} testFrameworks
|
|
11
|
+
* @param {Map} testFrameworksVersions
|
|
12
|
+
* @param {TestFrameworkState} testFrameworkState
|
|
13
|
+
* @param {HookState} hookState
|
|
14
|
+
*/
|
|
15
|
+
constructor(context: TrackedContext, testFrameworks: Array<string>, testFrameworksVersions: Record<string, string>, testFrameworkState: State, hookState: State);
|
|
16
|
+
/**
|
|
17
|
+
* get CurrentTestState of instance
|
|
18
|
+
* @returns {*} - returns TestFramework State
|
|
19
|
+
*/
|
|
20
|
+
getCurrentTestState(): State;
|
|
21
|
+
/**
|
|
22
|
+
* set CurrentTestState of instance
|
|
23
|
+
* @param {TestFrameworkState} currentTestState - Set Current TestFramework State
|
|
24
|
+
*/
|
|
25
|
+
setCurrentTestState(currentTestState: State): void;
|
|
26
|
+
/**
|
|
27
|
+
* get CurrentHookState of instance
|
|
28
|
+
* @returns {HookState} - return current hook state.
|
|
29
|
+
*/
|
|
30
|
+
getCurrentHookState(): State;
|
|
31
|
+
/**
|
|
32
|
+
* set CurrentHookState of instance
|
|
33
|
+
* @param {HookState} currentHookState - set current hook state.
|
|
34
|
+
*/
|
|
35
|
+
setCurrentHookState(currentHookState: State): void;
|
|
36
|
+
/**
|
|
37
|
+
* get LastTestState of instance
|
|
38
|
+
* @returns {TestFrameworkState} - return last test framework state
|
|
39
|
+
*/
|
|
40
|
+
getLastTestState(): State;
|
|
41
|
+
/**
|
|
42
|
+
* set LastTestState of instance
|
|
43
|
+
* @param {TestFrameworkState} lastTestState - set last test framework state
|
|
44
|
+
*/
|
|
45
|
+
setLastTestState(lastTestState: State): void;
|
|
46
|
+
/**
|
|
47
|
+
* get LastHookState of instance
|
|
48
|
+
* @returns {HookState} get last hook state
|
|
49
|
+
*/
|
|
50
|
+
getLastHookState(): State;
|
|
51
|
+
/**
|
|
52
|
+
* set LastHookState of instance
|
|
53
|
+
* @param {HookState} lastHookState - returns late hook state
|
|
54
|
+
*/
|
|
55
|
+
setLastHookState(lastHookState: State): void;
|
|
56
|
+
/**
|
|
57
|
+
* get CreatedAt of instance
|
|
58
|
+
* @returns {string} - return created time
|
|
59
|
+
*/
|
|
60
|
+
getCreatedAt(): string;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=testFrameworkInstance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testFrameworkInstance.d.ts","sourceRoot":"","sources":["../../../src/cli/instances/testFrameworkInstance.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAIrD,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,eAAe;;IAC9D,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAO9C;;;;;;;KAOC;gBACW,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK;IAW/J;;;KAGC;IACD,mBAAmB;IAInB;;;KAGC;IACD,mBAAmB,CAAC,gBAAgB,EAAE,KAAK;IAK3C;;;KAGC;IACD,mBAAmB;IAInB;;;KAGC;IACD,mBAAmB,CAAC,gBAAgB,EAAE,KAAK;IAK3C;;;KAGC;IACD,gBAAgB;IAIhB;;;KAGC;IACD,gBAAgB,CAAC,aAAa,EAAE,KAAK;IAIrC;;;KAGC;IACD,gBAAgB;IAIhB;;;KAGC;IACD,gBAAgB,CAAC,aAAa,EAAE,KAAK;IAIrC;;;KAGC;IACD,YAAY;CAIf"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default class TrackedContext {
|
|
2
|
+
#private;
|
|
3
|
+
/**
|
|
4
|
+
* Create TrackedContext
|
|
5
|
+
* @param {number} string - string Id for context - VERIFY
|
|
6
|
+
* @param {number} threadId- Integer Thread Id for context
|
|
7
|
+
* @param {number} processId - Integer Process Id for context
|
|
8
|
+
* @param {string} type
|
|
9
|
+
*/
|
|
10
|
+
constructor(id: string, threadId: number, processId: number, type: string);
|
|
11
|
+
/**
|
|
12
|
+
* get TrackedContext thread id
|
|
13
|
+
* @returns {number} - return thread id of context
|
|
14
|
+
*/
|
|
15
|
+
getThreadId(): number;
|
|
16
|
+
/**
|
|
17
|
+
* get TrackedContext process id
|
|
18
|
+
* @returns {number} - return process id of context
|
|
19
|
+
*/
|
|
20
|
+
getProcessId(): number;
|
|
21
|
+
/**
|
|
22
|
+
* get TrackedContext id
|
|
23
|
+
* @returns {string} - returns context id
|
|
24
|
+
*/
|
|
25
|
+
getId(): string;
|
|
26
|
+
/**
|
|
27
|
+
* get TrackedContext type
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
getType(): string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=trackedContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackedContext.d.ts","sourceRoot":"","sources":["../../../src/cli/instances/trackedContext.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,cAAc;;IAM/B;;;;;;KAMC;gBACW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOzE;;;KAGC;IACD,WAAW;IAIX;;;KAGC;IACD,YAAY;IAIZ;;;KAGC;IACD,KAAK;IAIL;;;KAGC;IACD,OAAO;CAIV"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import TrackedContext from './trackedContext.js';
|
|
2
|
+
export default class TrackedInstance {
|
|
3
|
+
#private;
|
|
4
|
+
/**
|
|
5
|
+
* create TrackedInstance
|
|
6
|
+
* @param {TrackedContext} context
|
|
7
|
+
*/
|
|
8
|
+
constructor(context: TrackedContext);
|
|
9
|
+
/**
|
|
10
|
+
* get TrackedInstance ref
|
|
11
|
+
* @returns {number} - returns ref id
|
|
12
|
+
*/
|
|
13
|
+
getRef(): string;
|
|
14
|
+
/**
|
|
15
|
+
* get TrackedInstance context
|
|
16
|
+
* @return {TrackedContext} - returns tracked context
|
|
17
|
+
*/
|
|
18
|
+
getContext(): TrackedContext;
|
|
19
|
+
/**
|
|
20
|
+
* get All data of Instance
|
|
21
|
+
* @returns {Map} - returns all data
|
|
22
|
+
*/
|
|
23
|
+
getAllData(): Map<string, any>;
|
|
24
|
+
/**
|
|
25
|
+
* set multiple data in the instance
|
|
26
|
+
* @param {*} key
|
|
27
|
+
* @param {*} value
|
|
28
|
+
*/
|
|
29
|
+
updateMultipleEntries(entries: Record<string, any>): void;
|
|
30
|
+
updateData(key: string, value: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* get Specific data of instance.
|
|
33
|
+
* @param {*} key
|
|
34
|
+
* @returns {*}
|
|
35
|
+
*/
|
|
36
|
+
getData(key: string): any;
|
|
37
|
+
hasData(key: string): boolean;
|
|
38
|
+
static createContext(target: string): TrackedContext;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=trackedInstance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackedInstance.d.ts","sourceRoot":"","sources":["../../../src/cli/instances/trackedInstance.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAIhD,MAAM,CAAC,OAAO,OAAO,eAAe;;IAMhC;;;KAGC;gBACW,OAAO,EAAE,cAAc;IAKnC;;;KAGC;IACD,MAAM;IAIN;;;KAGC;IACD,UAAU;IAIV;;;KAGC;IACD,UAAU;IAIV;;;;KAIC;IAGD,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAQlD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAIlC;;;;KAIC;IACD,OAAO,CAAC,GAAG,EAAE,MAAM;IAInB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI7B,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;CAQtC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import BaseModule from './baseModule.js';
|
|
2
|
+
import { BStackLogger } from '../cliLogger.js';
|
|
3
|
+
import accessibilityScripts from '../../scripts/accessibility-scripts.js';
|
|
4
|
+
import type { Accessibility } from '@browserstack/wdio-browserstack-service';
|
|
5
|
+
export default class AccessibilityModule extends BaseModule {
|
|
6
|
+
logger: typeof BStackLogger;
|
|
7
|
+
name: string;
|
|
8
|
+
scriptInstance: typeof accessibilityScripts;
|
|
9
|
+
accessibility: boolean;
|
|
10
|
+
autoScanning: boolean;
|
|
11
|
+
isAppAccessibility: boolean;
|
|
12
|
+
isNonBstackA11y: boolean;
|
|
13
|
+
accessibilityConfig: Accessibility;
|
|
14
|
+
static MODULE_NAME: string;
|
|
15
|
+
accessibilityMap: Map<number, boolean>;
|
|
16
|
+
LOG_DISABLED_SHOWN: Map<number, boolean>;
|
|
17
|
+
testMetadata: Record<string, {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
constructor(accessibilityConfig: Accessibility, isNonBstackA11y: boolean);
|
|
21
|
+
onBeforeExecute(): Promise<void>;
|
|
22
|
+
private commandWrapper;
|
|
23
|
+
onBeforeTest(args: Record<string, unknown>): Promise<void>;
|
|
24
|
+
onAfterTest(): Promise<void>;
|
|
25
|
+
private shouldPatchExecuteScript;
|
|
26
|
+
private getCapability;
|
|
27
|
+
private performScanCli;
|
|
28
|
+
private sendTestStopEvent;
|
|
29
|
+
getA11yResults(browser: WebdriverIO.Browser): Promise<Array<Record<string, unknown>>>;
|
|
30
|
+
getA11yResultsSummary(browser: WebdriverIO.Browser): Promise<Record<string, unknown>>;
|
|
31
|
+
getDriverExecuteParams(): Promise<Record<string, unknown>>;
|
|
32
|
+
_setAnnotation(message: string): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=accessibilityModule.d.ts.map
|