browserstack-cypress-cli 1.32.8 → 1.34.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/.claude/settings.local.json +13 -0
- package/.nyc_output/1c1b6051-514d-4847-bd2a-d03b2d537cfb.json +1 -0
- package/.nyc_output/20afa9bb-5b9f-42e2-adfe-9dbf55591bb8.json +1 -0
- package/.nyc_output/22e511c5-8971-4265-b783-553560573bdc.json +1 -0
- package/.nyc_output/2d21e700-0ac9-4ac9-8f8c-322a5cbefe8d.json +1 -0
- package/.nyc_output/3c54171a-9bf6-478d-a4c0-28ec402806cf.json +1 -0
- package/.nyc_output/52675bfd-ff62-4f5b-944c-e3f48af2972c.json +1 -0
- package/.nyc_output/5766c03a-3d68-4298-89f7-c298c025e176.json +1 -0
- package/.nyc_output/625adc06-9859-4c11-8892-0498922cc2aa.json +1 -0
- package/.nyc_output/730f797e-97d0-44a8-b5d0-7fd3f8c06d75.json +1 -0
- package/.nyc_output/73501809-7c04-439e-8c09-9a1bff7962c6.json +1 -0
- package/.nyc_output/77484870-1b25-4c2d-a361-2ac51c0951bc.json +1 -0
- package/.nyc_output/8098fa2d-312d-4762-ad96-3e9827eaef09.json +1 -0
- package/.nyc_output/87357e21-685f-4861-9a6f-4c6b62f85ac0.json +1 -0
- package/.nyc_output/8fcd9f27-af41-43f7-bdf8-7bea2efd7abb.json +1 -0
- package/.nyc_output/9f8ad8fd-775b-4a99-ba77-c6142e7df5e9.json +1 -0
- package/.nyc_output/a1de1cdd-5eed-409d-a528-1c7cf16d56b5.json +1 -0
- package/.nyc_output/a25237ac-032d-4a27-af09-fb32326b539a.json +1 -0
- package/.nyc_output/a5d38a55-372c-4676-b4bc-c6def0669c0d.json +1 -0
- package/.nyc_output/a67d3cbf-0548-4fcb-8aad-2af60b532670.json +1 -0
- package/.nyc_output/aa2117b0-10c0-4f5b-9d8d-1f96375f0240.json +1 -0
- package/.nyc_output/ac17471f-3f16-45ab-b53e-ba8956afd5d4.json +1 -0
- package/.nyc_output/bbbe672a-8524-4850-b6b3-b725aa2b6c16.json +1 -0
- package/.nyc_output/c7289c09-7047-47cb-9737-f11fe7fc9628.json +1 -0
- package/.nyc_output/ceeeac29-3ca3-40af-b779-12c0408cf05d.json +1 -0
- package/.nyc_output/d08d37a4-6abc-41a7-98bd-de074a1fca7f.json +1 -0
- package/.nyc_output/d1dbecb0-8458-41bc-86c8-9d2470b60415.json +1 -0
- package/.nyc_output/d7245fa2-3732-4790-831b-44dbcba15a16.json +1 -0
- package/.nyc_output/e184572f-281b-4bd6-81e3-58842eac98ee.json +1 -0
- package/.nyc_output/efd98bd9-1699-472b-ab98-0808e5d39899.json +1 -0
- package/.nyc_output/processinfo/1c1b6051-514d-4847-bd2a-d03b2d537cfb.json +1 -0
- package/.nyc_output/processinfo/20afa9bb-5b9f-42e2-adfe-9dbf55591bb8.json +1 -0
- package/.nyc_output/processinfo/22e511c5-8971-4265-b783-553560573bdc.json +1 -0
- package/.nyc_output/processinfo/2d21e700-0ac9-4ac9-8f8c-322a5cbefe8d.json +1 -0
- package/.nyc_output/processinfo/3c54171a-9bf6-478d-a4c0-28ec402806cf.json +1 -0
- package/.nyc_output/processinfo/52675bfd-ff62-4f5b-944c-e3f48af2972c.json +1 -0
- package/.nyc_output/processinfo/5766c03a-3d68-4298-89f7-c298c025e176.json +1 -0
- package/.nyc_output/processinfo/625adc06-9859-4c11-8892-0498922cc2aa.json +1 -0
- package/.nyc_output/processinfo/730f797e-97d0-44a8-b5d0-7fd3f8c06d75.json +1 -0
- package/.nyc_output/processinfo/73501809-7c04-439e-8c09-9a1bff7962c6.json +1 -0
- package/.nyc_output/processinfo/77484870-1b25-4c2d-a361-2ac51c0951bc.json +1 -0
- package/.nyc_output/processinfo/8098fa2d-312d-4762-ad96-3e9827eaef09.json +1 -0
- package/.nyc_output/processinfo/87357e21-685f-4861-9a6f-4c6b62f85ac0.json +1 -0
- package/.nyc_output/processinfo/8fcd9f27-af41-43f7-bdf8-7bea2efd7abb.json +1 -0
- package/.nyc_output/processinfo/9f8ad8fd-775b-4a99-ba77-c6142e7df5e9.json +1 -0
- package/.nyc_output/processinfo/a1de1cdd-5eed-409d-a528-1c7cf16d56b5.json +1 -0
- package/.nyc_output/processinfo/a25237ac-032d-4a27-af09-fb32326b539a.json +1 -0
- package/.nyc_output/processinfo/a5d38a55-372c-4676-b4bc-c6def0669c0d.json +1 -0
- package/.nyc_output/processinfo/a67d3cbf-0548-4fcb-8aad-2af60b532670.json +1 -0
- package/.nyc_output/processinfo/aa2117b0-10c0-4f5b-9d8d-1f96375f0240.json +1 -0
- package/.nyc_output/processinfo/ac17471f-3f16-45ab-b53e-ba8956afd5d4.json +1 -0
- package/.nyc_output/processinfo/bbbe672a-8524-4850-b6b3-b725aa2b6c16.json +1 -0
- package/.nyc_output/processinfo/c7289c09-7047-47cb-9737-f11fe7fc9628.json +1 -0
- package/.nyc_output/processinfo/ceeeac29-3ca3-40af-b779-12c0408cf05d.json +1 -0
- package/.nyc_output/processinfo/d08d37a4-6abc-41a7-98bd-de074a1fca7f.json +1 -0
- package/.nyc_output/processinfo/d1dbecb0-8458-41bc-86c8-9d2470b60415.json +1 -0
- package/.nyc_output/processinfo/d7245fa2-3732-4790-831b-44dbcba15a16.json +1 -0
- package/.nyc_output/processinfo/e184572f-281b-4bd6-81e3-58842eac98ee.json +1 -0
- package/.nyc_output/processinfo/efd98bd9-1699-472b-ab98-0808e5d39899.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/bin/accessibility-automation/cypress/index.js +1 -1
- package/bin/accessibility-automation/helper.js +60 -32
- package/bin/commands/runs.js +10 -3
- package/bin/helpers/build.js +2 -0
- package/bin/helpers/capabilityHelper.js +7 -1
- package/bin/helpers/constants.js +22 -0
- package/bin/helpers/helper.js +2 -1
- package/bin/helpers/packageInstaller.js +3 -2
- package/bin/helpers/readCypressConfigUtil.js +133 -11
- package/bin/helpers/utils.js +241 -3
- package/bin/templates/configTemplate.js +2 -0
- package/bin/testObservability/crashReporter/index.js +2 -2
- package/bin/testObservability/cypress/index.js +194 -96
- package/bin/testObservability/helper/cleanupQueueSync.js +1 -2
- package/bin/testObservability/helper/constants.js +4 -0
- package/bin/testObservability/helper/helper.js +21 -22
- package/bin/testObservability/helper/requestQueueHandler.js +1 -1
- package/bin/testObservability/plugin/index.js +6 -0
- package/bin/testObservability/plugin/ipcServer.js +1 -1
- package/bin/testObservability/reporter/index.js +26 -18
- package/log/usage.log +393 -4
- package/package.json +6 -5
|
@@ -12,7 +12,7 @@ const Mocha = requireModule('mocha');
|
|
|
12
12
|
const Runnable = require('mocha/lib/runnable'); // need to handle as this isn't present in older mocha versions
|
|
13
13
|
const { v4: uuidv4 } = require('uuid');
|
|
14
14
|
|
|
15
|
-
const { IPC_EVENTS } = require('../helper/constants');
|
|
15
|
+
const { IPC_EVENTS, TEST_REPORTING_ANALYTICS } = require('../helper/constants');
|
|
16
16
|
const { startIPCServer } = require('../plugin/ipcServer');
|
|
17
17
|
|
|
18
18
|
const HOOK_TYPES_MAP = {
|
|
@@ -52,7 +52,6 @@ const {
|
|
|
52
52
|
mapTestHooks,
|
|
53
53
|
debug,
|
|
54
54
|
isBrowserstackInfra,
|
|
55
|
-
requestQueueHandler,
|
|
56
55
|
getHookSkippedTests,
|
|
57
56
|
getOSDetailsFromSystem,
|
|
58
57
|
findGitConfig,
|
|
@@ -88,6 +87,7 @@ class MyReporter {
|
|
|
88
87
|
})
|
|
89
88
|
|
|
90
89
|
.on(EVENT_HOOK_BEGIN, async (hook) => {
|
|
90
|
+
if (this.isInternalHook(hook)) return;
|
|
91
91
|
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_BEGIN`);
|
|
92
92
|
if(this.testObservability == true) {
|
|
93
93
|
if(!hook.hookAnalyticsId) {
|
|
@@ -105,6 +105,7 @@ class MyReporter {
|
|
|
105
105
|
})
|
|
106
106
|
|
|
107
107
|
.on(EVENT_HOOK_END, async (hook) => {
|
|
108
|
+
if (this.isInternalHook(hook)) return;
|
|
108
109
|
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_END`);
|
|
109
110
|
if(this.testObservability == true) {
|
|
110
111
|
if(!this.runStatusMarkedHash[hook.hookAnalyticsId]) {
|
|
@@ -206,6 +207,13 @@ class MyReporter {
|
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
209
|
|
|
210
|
+
isInternalHook(hook) {
|
|
211
|
+
if (hook && hook.body && hook.body.includes('/* browserstack internal helper hook */')) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
|
|
209
217
|
registerListeners() {
|
|
210
218
|
startIPCServer(
|
|
211
219
|
(server) => {
|
|
@@ -247,7 +255,7 @@ class MyReporter {
|
|
|
247
255
|
}
|
|
248
256
|
}
|
|
249
257
|
|
|
250
|
-
uploadTestSteps = async (shouldClearCurrentSteps = true, cypressSteps = null) => {
|
|
258
|
+
uploadTestSteps = async (shouldClearCurrentSteps = true, cypressSteps = null) => {
|
|
251
259
|
const currentTestSteps = cypressSteps ? cypressSteps : JSON.parse(JSON.stringify(this.currentTestSteps));
|
|
252
260
|
/* TODO - Send as test logs */
|
|
253
261
|
const allStepsAsLogs = [];
|
|
@@ -511,14 +519,14 @@ class MyReporter {
|
|
|
511
519
|
});
|
|
512
520
|
}
|
|
513
521
|
} catch(error) {
|
|
514
|
-
debug(`Exception in uploading log data to
|
|
522
|
+
debug(`Exception in uploading log data to ${TEST_REPORTING_ANALYTICS} with error : ${error}`, true, error);
|
|
515
523
|
}
|
|
516
524
|
}
|
|
517
525
|
|
|
518
526
|
cypressConfigListener = async (config) => {
|
|
519
527
|
}
|
|
520
528
|
|
|
521
|
-
cypressCucumberStepListener = async ({log}) => {
|
|
529
|
+
cypressCucumberStepListener = async ({log, started_at, finished_at}) => {
|
|
522
530
|
if(log.name == 'step' && log.consoleProps && log.consoleProps.step && log.consoleProps.step.keyword) {
|
|
523
531
|
this.currentTestCucumberSteps = [
|
|
524
532
|
...this.currentTestCucumberSteps,
|
|
@@ -526,8 +534,8 @@ class MyReporter {
|
|
|
526
534
|
id: log.chainerId,
|
|
527
535
|
keyword: log.consoleProps.step.keyword,
|
|
528
536
|
text: log.consoleProps.step.text,
|
|
529
|
-
started_at: new Date().toISOString(),
|
|
530
|
-
finished_at: new Date().toISOString(),
|
|
537
|
+
started_at: started_at || new Date().toISOString(),
|
|
538
|
+
finished_at: finished_at || new Date().toISOString(),
|
|
531
539
|
duration: 0,
|
|
532
540
|
result: 'passed'
|
|
533
541
|
}
|
|
@@ -537,8 +545,8 @@ class MyReporter {
|
|
|
537
545
|
if(gherkinStep.id == log.chainerId) {
|
|
538
546
|
this.currentTestCucumberSteps[idx] = {
|
|
539
547
|
...gherkinStep,
|
|
540
|
-
finished_at: new Date().toISOString(),
|
|
541
|
-
duration: Date.now() - (new Date(gherkinStep.started_at)).getTime(),
|
|
548
|
+
finished_at: finished_at || new Date().toISOString(),
|
|
549
|
+
duration: (finished_at ? new Date(finished_at).getTime() : Date.now()) - (new Date(gherkinStep.started_at)).getTime(),
|
|
542
550
|
result: log.state,
|
|
543
551
|
failure: log.err?.stack || log.err?.message,
|
|
544
552
|
failure_reason: log.err?.stack || log.err?.message,
|
|
@@ -549,9 +557,9 @@ class MyReporter {
|
|
|
549
557
|
}
|
|
550
558
|
}
|
|
551
559
|
|
|
552
|
-
cypressLogListener = async ({level, message
|
|
560
|
+
cypressLogListener = async ({timestamp, level, message}) => {
|
|
553
561
|
this.appendTestItemLog({
|
|
554
|
-
timestamp: new Date().toISOString(),
|
|
562
|
+
timestamp: timestamp || new Date().toISOString(),
|
|
555
563
|
level: level.toUpperCase(),
|
|
556
564
|
message,
|
|
557
565
|
kind: 'TEST_LOG',
|
|
@@ -612,12 +620,12 @@ class MyReporter {
|
|
|
612
620
|
const currentStepObj = {
|
|
613
621
|
id: command.attributes.id,
|
|
614
622
|
text: 'cy.' + command.attributes.name + '(' + this.getFormattedArgs(command.attributes.args) + ')',
|
|
615
|
-
started_at: new Date().toISOString(),
|
|
623
|
+
started_at: command.started_at || new Date().toISOString(),
|
|
616
624
|
finished_at: null,
|
|
617
625
|
duration: null,
|
|
618
626
|
result: 'pending',
|
|
619
|
-
test_run_uuid:
|
|
620
|
-
hook_run_uuid :
|
|
627
|
+
test_run_uuid: command.location === 'test' ? this.current_test?.testAnalyticsId : null,
|
|
628
|
+
hook_run_uuid : command.location === 'hook' ? this.current_hook?.hookAnalyticsId : null
|
|
621
629
|
};
|
|
622
630
|
if(currentStepObj.hook_run_uuid && currentStepObj.test_run_uuid) delete currentStepObj.test_run_uuid;
|
|
623
631
|
this.currentTestSteps = [
|
|
@@ -630,8 +638,8 @@ class MyReporter {
|
|
|
630
638
|
if(val.id == command.attributes.id) {
|
|
631
639
|
this.currentTestSteps[idx] = {
|
|
632
640
|
...val,
|
|
633
|
-
finished_at: new Date().toISOString(),
|
|
634
|
-
duration: Date.now() - (new Date(val.started_at)).getTime(),
|
|
641
|
+
finished_at: command.finished_at || new Date().toISOString(),
|
|
642
|
+
duration: (command.finished_at ? new Date(command.finished_at).getTime() : Date.now()) - (new Date(val.started_at)).getTime(),
|
|
635
643
|
result: command.state
|
|
636
644
|
};
|
|
637
645
|
stepUpdated = true;
|
|
@@ -647,8 +655,8 @@ class MyReporter {
|
|
|
647
655
|
finished_at: new Date().toISOString(),
|
|
648
656
|
duration: 0,
|
|
649
657
|
result: command.state,
|
|
650
|
-
test_run_uuid:
|
|
651
|
-
hook_run_uuid :
|
|
658
|
+
test_run_uuid: command.location === 'test' ? this.current_test?.testAnalyticsId : null,
|
|
659
|
+
hook_run_uuid : command.location === 'hook' ? this.current_hook?.hookAnalyticsId : null
|
|
652
660
|
};
|
|
653
661
|
if(currentStepObj.hook_run_uuid && currentStepObj.test_run_uuid) delete currentStepObj.test_run_uuid;
|
|
654
662
|
this.currentTestSteps = [
|