spana-test 0.9.0 → 0.10.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/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +6 -6
- package/dist/{allure-RAEK4SIH.js → allure-FGVR5LND.js} +5 -1
- package/dist/allure-FGVR5LND.js.map +1 -0
- package/dist/{app-DSh1ejLh.d.ts → app-xIYd2jde.d.ts} +44 -1
- package/dist/{chunk-ALPQES3J.js → chunk-66D3C7NB.js} +142 -28
- package/dist/chunk-66D3C7NB.js.map +1 -0
- package/dist/{chunk-IGTK5MHB.js → chunk-6GBAPW6K.js} +12 -8
- package/dist/chunk-6GBAPW6K.js.map +1 -0
- package/dist/{chunk-JZZ2W2XH.js → chunk-7QFJ7MDH.js} +2 -1
- package/dist/chunk-7QFJ7MDH.js.map +1 -0
- package/dist/{chunk-3UVSUVHW.js → chunk-B35G77DN.js} +694 -404
- package/dist/chunk-B35G77DN.js.map +1 -0
- package/dist/{chunk-UEWZ2EXL.js → chunk-B473XZOM.js} +90 -13
- package/dist/chunk-B473XZOM.js.map +1 -0
- package/dist/{chunk-Y2RZNOKU.js → chunk-C2HBFEMQ.js} +2 -2
- package/dist/{chunk-PLE7RFQE.js → chunk-DP7MGXHN.js} +26 -1
- package/dist/chunk-DP7MGXHN.js.map +1 -0
- package/dist/{chunk-FP6PVHHR.js → chunk-IXON7DMB.js} +2 -2
- package/dist/{chunk-2KRVN4WN.js → chunk-Y6KMJJ2T.js} +3 -3
- package/dist/cli.js +16 -11
- package/dist/cli.js.map +1 -1
- package/dist/config-loader-WLPQ5WVH.js +9 -0
- package/dist/{console-BGAK7Z2L.js → console-DIYEJSSP.js} +9 -2
- package/dist/console-DIYEJSSP.js.map +1 -0
- package/dist/{doctor-command-YTCQ2SC7.js → doctor-command-QIYBI7ZF.js} +3 -3
- package/dist/{flow-CSMwD9Fh.d.ts → flow-CI5parw2.d.ts} +24 -3
- package/dist/gherkin/steps.d.ts +2 -2
- package/dist/{html-JO2YNRWX.js → html-FLMWPFQD.js} +2 -1
- package/dist/html-FLMWPFQD.js.map +1 -0
- package/dist/index.d.ts +17 -5
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/dist/{junit-HLC62MK6.js → junit-CGB3LKHD.js} +3 -2
- package/dist/junit-CGB3LKHD.js.map +1 -0
- package/dist/{runner-TF4OKPYP.js → runner-JID2YWRE.js} +6 -2
- package/dist/{server-4YLBAZEM.js → server-6KQSTQIG.js} +12 -12
- package/dist/{server-IS4K5FCT.js → server-UIRGHUYM.js} +2 -2
- package/dist/{session-K7FCRKOC.js → session-BE6U34DA.js} +5 -5
- package/dist/{session-CgvT-Oso.d.ts → session-Bt_mbUWg.d.ts} +1 -1
- package/dist/{studio-command-RFPV2DS7.js → studio-command-TXQTIWRS.js} +2 -2
- package/dist/{test-command-UEJG5AI6.js → test-command-CCSQPKWU.js} +106 -27
- package/dist/test-command-CCSQPKWU.js.map +1 -0
- package/dist/{validator-BLOLIHUY.js → validator-YWNHCU2S.js} +3 -3
- package/package.json +1 -1
- package/dist/allure-RAEK4SIH.js.map +0 -1
- package/dist/chunk-3UVSUVHW.js.map +0 -1
- package/dist/chunk-ALPQES3J.js.map +0 -1
- package/dist/chunk-IGTK5MHB.js.map +0 -1
- package/dist/chunk-JZZ2W2XH.js.map +0 -1
- package/dist/chunk-PLE7RFQE.js.map +0 -1
- package/dist/chunk-UEWZ2EXL.js.map +0 -1
- package/dist/config-loader-F5YAY7RP.js +0 -9
- package/dist/console-BGAK7Z2L.js.map +0 -1
- package/dist/html-JO2YNRWX.js.map +0 -1
- package/dist/junit-HLC62MK6.js.map +0 -1
- package/dist/test-command-UEJG5AI6.js.map +0 -1
- /package/dist/{chunk-Y2RZNOKU.js.map → chunk-C2HBFEMQ.js.map} +0 -0
- /package/dist/{chunk-FP6PVHHR.js.map → chunk-IXON7DMB.js.map} +0 -0
- /package/dist/{chunk-2KRVN4WN.js.map → chunk-Y6KMJJ2T.js.map} +0 -0
- /package/dist/{config-loader-F5YAY7RP.js.map → config-loader-WLPQ5WVH.js.map} +0 -0
- /package/dist/{doctor-command-YTCQ2SC7.js.map → doctor-command-QIYBI7ZF.js.map} +0 -0
- /package/dist/{runner-TF4OKPYP.js.map → runner-JID2YWRE.js.map} +0 -0
- /package/dist/{server-4YLBAZEM.js.map → server-6KQSTQIG.js.map} +0 -0
- /package/dist/{server-IS4K5FCT.js.map → server-UIRGHUYM.js.map} +0 -0
- /package/dist/{session-K7FCRKOC.js.map → session-BE6U34DA.js.map} +0 -0
- /package/dist/{studio-command-RFPV2DS7.js.map → studio-command-TXQTIWRS.js.map} +0 -0
- /package/dist/{validator-BLOLIHUY.js.map → validator-YWNHCU2S.js.map} +0 -0
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as ConnectOptions, D as Direction, S as Session, a as SuggestedSelector, c as connect } from '../session-
|
|
2
|
-
import '../app-
|
|
1
|
+
export { C as ConnectOptions, D as Direction, S as Session, a as SuggestedSelector, c as connect } from '../session-Bt_mbUWg.js';
|
|
2
|
+
import '../app-xIYd2jde.js';
|
|
3
3
|
import 'effect';
|
|
4
4
|
|
|
5
5
|
interface ValidationError {
|
package/dist/agent/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateFlows
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-PLE7RFQE.js";
|
|
3
|
+
} from "../chunk-C2HBFEMQ.js";
|
|
5
4
|
import {
|
|
6
5
|
Session,
|
|
7
6
|
connect
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-6GBAPW6K.js";
|
|
9
8
|
import "../chunk-SF7UYW4I.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-B35G77DN.js";
|
|
10
|
+
import "../chunk-B473XZOM.js";
|
|
11
|
+
import "../chunk-WV3ALL3H.js";
|
|
12
12
|
import "../chunk-VP6V4XEJ.js";
|
|
13
13
|
import "../chunk-Z6K4QQAR.js";
|
|
14
|
-
import "../chunk-WV3ALL3H.js";
|
|
15
14
|
import "../chunk-JPZCZHL4.js";
|
|
15
|
+
import "../chunk-DP7MGXHN.js";
|
|
16
16
|
import "../chunk-2AFWVHQK.js";
|
|
17
17
|
import "../chunk-DGUM43GV.js";
|
|
18
18
|
export {
|
|
@@ -128,6 +128,10 @@ function writeResult(result, outputDir) {
|
|
|
128
128
|
message: result.error.message,
|
|
129
129
|
trace: result.error.stack
|
|
130
130
|
};
|
|
131
|
+
} else if (result.modifier) {
|
|
132
|
+
allureResult.statusDetails = {
|
|
133
|
+
message: result.skipReason ? `${result.modifier}: ${result.skipReason}` : result.modifier
|
|
134
|
+
};
|
|
131
135
|
} else if (result.flaky) {
|
|
132
136
|
allureResult.statusDetails = {
|
|
133
137
|
message: `Flaky: passed on attempt ${result.attempts}`
|
|
@@ -161,4 +165,4 @@ function createAllureReporter(outputDir = "allure-results") {
|
|
|
161
165
|
export {
|
|
162
166
|
createAllureReporter
|
|
163
167
|
};
|
|
164
|
-
//# sourceMappingURL=allure-
|
|
168
|
+
//# sourceMappingURL=allure-FGVR5LND.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/report/allure.ts"],"sourcesContent":["import { randomUUID, createHash } from \"node:crypto\";\nimport { writeFileSync, mkdirSync, copyFileSync, existsSync, readdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { Reporter, FlowResult, StepResult } from \"./types.js\";\n\nfunction historyId(name: string, platform: string): string {\n return createHash(\"sha256\").update(`${name}:${platform}`).digest(\"hex\").slice(0, 32);\n}\n\nfunction allureStatus(status: string): string {\n if (status === \"passed\") return \"passed\";\n if (status === \"failed\") return \"failed\";\n if (status === \"skipped\") return \"skipped\";\n return \"broken\";\n}\n\nfunction mapSteps(steps: StepResult[], startTime: number): unknown[] {\n let time = startTime;\n return steps.map((step) => {\n const stepStart = time;\n const stepStop = time + step.durationMs;\n time = stepStop;\n return {\n name: step.selector ? `${step.command} ${JSON.stringify(step.selector)}` : step.command,\n status: allureStatus(step.status),\n start: stepStart,\n stop: stepStop,\n steps: [],\n ...(step.error ? { statusDetails: { message: step.error } } : {}),\n };\n });\n}\n\nfunction copyAttachments(result: FlowResult, outputDir: string): unknown[] {\n const allureAttachments: unknown[] = [];\n\n // Flow-level attachments\n for (const att of result.attachments ?? []) {\n if (att.path && existsSync(att.path)) {\n const ext = att.contentType === \"image/png\" ? \".png\" : \".json\";\n const filename = `${randomUUID()}-attachment${ext}`;\n copyFileSync(att.path, join(outputDir, filename));\n allureAttachments.push({\n name: att.name,\n source: filename,\n type: att.contentType,\n });\n }\n }\n\n // Step-level attachments\n for (const step of result.steps ?? []) {\n for (const att of step.attachments ?? []) {\n if (att.path && existsSync(att.path)) {\n const ext = att.contentType === \"image/png\" ? \".png\" : \".json\";\n const filename = `${randomUUID()}-attachment${ext}`;\n copyFileSync(att.path, join(outputDir, filename));\n allureAttachments.push({\n name: att.name,\n source: filename,\n type: att.contentType,\n });\n }\n }\n }\n\n // Visual diff attachments from spana-output\n const spanaOutputDir = join(outputDir, \"..\", \"spana-output\");\n const diffDir = join(spanaOutputDir, `${result.name}-${result.platform}`);\n if (existsSync(diffDir)) {\n let diffFiles: string[];\n try {\n diffFiles = readdirSync(diffDir).filter(\n (f) => f.endsWith(\"-expected.png\") || f.endsWith(\"-actual.png\") || f.endsWith(\"-diff.png\"),\n );\n } catch {\n diffFiles = [];\n }\n for (const f of diffFiles) {\n const srcPath = join(diffDir, f);\n if (existsSync(srcPath)) {\n const filename = `${randomUUID()}-attachment.png`;\n copyFileSync(srcPath, join(outputDir, filename));\n allureAttachments.push({\n name: f,\n source: filename,\n type: \"image/png\",\n });\n }\n }\n }\n\n // A11y violation JSON attachments for failed AccessibilityAudit steps\n for (const step of result.steps ?? []) {\n if (step.status === \"failed\" && step.command.includes(\"AccessibilityAudit\") && step.error) {\n const violationData = {\n step: step.command,\n selector: step.selector,\n error: step.error,\n };\n const filename = `${randomUUID()}-attachment.json`;\n writeFileSync(join(outputDir, filename), JSON.stringify(violationData, null, 2));\n allureAttachments.push({\n name: `a11y-violations-${step.command}`,\n source: filename,\n type: \"application/json\",\n });\n }\n }\n\n return allureAttachments;\n}\n\nfunction writeResult(result: FlowResult, outputDir: string): void {\n const uuid = randomUUID();\n const now = Date.now();\n const startTime = now - result.durationMs;\n\n const labels: { name: string; value: string }[] = [\n { name: \"suite\", value: result.platform },\n { name: \"framework\", value: \"spana\" },\n ];\n\n if (result.flaky) {\n labels.push({ name: \"tag\", value: \"flaky\" });\n }\n\n const allureResult: Record<string, unknown> = {\n uuid,\n historyId: historyId(result.name, result.platform),\n name: result.name,\n fullName: `[${result.platform}] ${result.name}`,\n status: result.flaky ? \"passed\" : allureStatus(result.status),\n stage: \"finished\",\n start: startTime,\n stop: now,\n labels,\n steps: result.steps ? mapSteps(result.steps, startTime) : [],\n attachments: copyAttachments(result, outputDir),\n };\n\n if (result.error) {\n allureResult.statusDetails = {\n message: result.error.message,\n trace: result.error.stack,\n };\n } else if (result.modifier) {\n allureResult.statusDetails = {\n message: result.skipReason ? `${result.modifier}: ${result.skipReason}` : result.modifier,\n };\n } else if (result.flaky) {\n allureResult.statusDetails = {\n message: `Flaky: passed on attempt ${result.attempts}`,\n };\n }\n\n writeFileSync(join(outputDir, `${uuid}-result.json`), JSON.stringify(allureResult, null, 2));\n}\n\nexport function createAllureReporter(outputDir: string = \"allure-results\"): Reporter {\n mkdirSync(outputDir, { recursive: true });\n\n return {\n onFlowPass(result: FlowResult) {\n writeResult(result, outputDir);\n },\n\n onFlowFail(result: FlowResult) {\n writeResult(result, outputDir);\n },\n\n onRunComplete(summary) {\n const envContent = [\n `Platform=${summary.platforms.join(\", \")}`,\n `Framework=spana`,\n `Total=${summary.total}`,\n `Passed=${summary.passed}`,\n `Failed=${summary.failed}`,\n ].join(\"\\n\");\n writeFileSync(join(outputDir, \"environment.properties\"), envContent);\n\n console.log(`Allure results written to ${outputDir}/`);\n console.log(`Run: npx allure generate ${outputDir} --clean -o allure-report`);\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,YAAY,kBAAkB;AACvC,SAAS,eAAe,WAAW,cAAc,YAAY,mBAAmB;AAChF,SAAS,YAAY;AAGrB,SAAS,UAAU,MAAc,UAA0B;AACzD,SAAO,WAAW,QAAQ,EAAE,OAAO,GAAG,IAAI,IAAI,QAAQ,EAAE,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AACrF;AAEA,SAAS,aAAa,QAAwB;AAC5C,MAAI,WAAW,SAAU,QAAO;AAChC,MAAI,WAAW,SAAU,QAAO;AAChC,MAAI,WAAW,UAAW,QAAO;AACjC,SAAO;AACT;AAEA,SAAS,SAAS,OAAqB,WAA8B;AACnE,MAAI,OAAO;AACX,SAAO,MAAM,IAAI,CAAC,SAAS;AACzB,UAAM,YAAY;AAClB,UAAM,WAAW,OAAO,KAAK;AAC7B,WAAO;AACP,WAAO;AAAA,MACL,MAAM,KAAK,WAAW,GAAG,KAAK,OAAO,IAAI,KAAK,UAAU,KAAK,QAAQ,CAAC,KAAK,KAAK;AAAA,MAChF,QAAQ,aAAa,KAAK,MAAM;AAAA,MAChC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO,CAAC;AAAA,MACR,GAAI,KAAK,QAAQ,EAAE,eAAe,EAAE,SAAS,KAAK,MAAM,EAAE,IAAI,CAAC;AAAA,IACjE;AAAA,EACF,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAoB,WAA8B;AACzE,QAAM,oBAA+B,CAAC;AAGtC,aAAW,OAAO,OAAO,eAAe,CAAC,GAAG;AAC1C,QAAI,IAAI,QAAQ,WAAW,IAAI,IAAI,GAAG;AACpC,YAAM,MAAM,IAAI,gBAAgB,cAAc,SAAS;AACvD,YAAM,WAAW,GAAG,WAAW,CAAC,cAAc,GAAG;AACjD,mBAAa,IAAI,MAAM,KAAK,WAAW,QAAQ,CAAC;AAChD,wBAAkB,KAAK;AAAA,QACrB,MAAM,IAAI;AAAA,QACV,QAAQ;AAAA,QACR,MAAM,IAAI;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAGA,aAAW,QAAQ,OAAO,SAAS,CAAC,GAAG;AACrC,eAAW,OAAO,KAAK,eAAe,CAAC,GAAG;AACxC,UAAI,IAAI,QAAQ,WAAW,IAAI,IAAI,GAAG;AACpC,cAAM,MAAM,IAAI,gBAAgB,cAAc,SAAS;AACvD,cAAM,WAAW,GAAG,WAAW,CAAC,cAAc,GAAG;AACjD,qBAAa,IAAI,MAAM,KAAK,WAAW,QAAQ,CAAC;AAChD,0BAAkB,KAAK;AAAA,UACrB,MAAM,IAAI;AAAA,UACV,QAAQ;AAAA,UACR,MAAM,IAAI;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAGA,QAAM,iBAAiB,KAAK,WAAW,MAAM,cAAc;AAC3D,QAAM,UAAU,KAAK,gBAAgB,GAAG,OAAO,IAAI,IAAI,OAAO,QAAQ,EAAE;AACxE,MAAI,WAAW,OAAO,GAAG;AACvB,QAAI;AACJ,QAAI;AACF,kBAAY,YAAY,OAAO,EAAE;AAAA,QAC/B,CAAC,MAAM,EAAE,SAAS,eAAe,KAAK,EAAE,SAAS,aAAa,KAAK,EAAE,SAAS,WAAW;AAAA,MAC3F;AAAA,IACF,QAAQ;AACN,kBAAY,CAAC;AAAA,IACf;AACA,eAAW,KAAK,WAAW;AACzB,YAAM,UAAU,KAAK,SAAS,CAAC;AAC/B,UAAI,WAAW,OAAO,GAAG;AACvB,cAAM,WAAW,GAAG,WAAW,CAAC;AAChC,qBAAa,SAAS,KAAK,WAAW,QAAQ,CAAC;AAC/C,0BAAkB,KAAK;AAAA,UACrB,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,MAAM;AAAA,QACR,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAGA,aAAW,QAAQ,OAAO,SAAS,CAAC,GAAG;AACrC,QAAI,KAAK,WAAW,YAAY,KAAK,QAAQ,SAAS,oBAAoB,KAAK,KAAK,OAAO;AACzF,YAAM,gBAAgB;AAAA,QACpB,MAAM,KAAK;AAAA,QACX,UAAU,KAAK;AAAA,QACf,OAAO,KAAK;AAAA,MACd;AACA,YAAM,WAAW,GAAG,WAAW,CAAC;AAChC,oBAAc,KAAK,WAAW,QAAQ,GAAG,KAAK,UAAU,eAAe,MAAM,CAAC,CAAC;AAC/E,wBAAkB,KAAK;AAAA,QACrB,MAAM,mBAAmB,KAAK,OAAO;AAAA,QACrC,QAAQ;AAAA,QACR,MAAM;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,YAAY,QAAoB,WAAyB;AAChE,QAAM,OAAO,WAAW;AACxB,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,YAAY,MAAM,OAAO;AAE/B,QAAM,SAA4C;AAAA,IAChD,EAAE,MAAM,SAAS,OAAO,OAAO,SAAS;AAAA,IACxC,EAAE,MAAM,aAAa,OAAO,QAAQ;AAAA,EACtC;AAEA,MAAI,OAAO,OAAO;AAChB,WAAO,KAAK,EAAE,MAAM,OAAO,OAAO,QAAQ,CAAC;AAAA,EAC7C;AAEA,QAAM,eAAwC;AAAA,IAC5C;AAAA,IACA,WAAW,UAAU,OAAO,MAAM,OAAO,QAAQ;AAAA,IACjD,MAAM,OAAO;AAAA,IACb,UAAU,IAAI,OAAO,QAAQ,KAAK,OAAO,IAAI;AAAA,IAC7C,QAAQ,OAAO,QAAQ,WAAW,aAAa,OAAO,MAAM;AAAA,IAC5D,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN;AAAA,IACA,OAAO,OAAO,QAAQ,SAAS,OAAO,OAAO,SAAS,IAAI,CAAC;AAAA,IAC3D,aAAa,gBAAgB,QAAQ,SAAS;AAAA,EAChD;AAEA,MAAI,OAAO,OAAO;AAChB,iBAAa,gBAAgB;AAAA,MAC3B,SAAS,OAAO,MAAM;AAAA,MACtB,OAAO,OAAO,MAAM;AAAA,IACtB;AAAA,EACF,WAAW,OAAO,UAAU;AAC1B,iBAAa,gBAAgB;AAAA,MAC3B,SAAS,OAAO,aAAa,GAAG,OAAO,QAAQ,KAAK,OAAO,UAAU,KAAK,OAAO;AAAA,IACnF;AAAA,EACF,WAAW,OAAO,OAAO;AACvB,iBAAa,gBAAgB;AAAA,MAC3B,SAAS,4BAA4B,OAAO,QAAQ;AAAA,IACtD;AAAA,EACF;AAEA,gBAAc,KAAK,WAAW,GAAG,IAAI,cAAc,GAAG,KAAK,UAAU,cAAc,MAAM,CAAC,CAAC;AAC7F;AAEO,SAAS,qBAAqB,YAAoB,kBAA4B;AACnF,YAAU,WAAW,EAAE,WAAW,KAAK,CAAC;AAExC,SAAO;AAAA,IACL,WAAW,QAAoB;AAC7B,kBAAY,QAAQ,SAAS;AAAA,IAC/B;AAAA,IAEA,WAAW,QAAoB;AAC7B,kBAAY,QAAQ,SAAS;AAAA,IAC/B;AAAA,IAEA,cAAc,SAAS;AACrB,YAAM,aAAa;AAAA,QACjB,YAAY,QAAQ,UAAU,KAAK,IAAI,CAAC;AAAA,QACxC;AAAA,QACA,SAAS,QAAQ,KAAK;AAAA,QACtB,UAAU,QAAQ,MAAM;AAAA,QACxB,UAAU,QAAQ,MAAM;AAAA,MAC1B,EAAE,KAAK,IAAI;AACX,oBAAc,KAAK,WAAW,wBAAwB,GAAG,UAAU;AAEnE,cAAQ,IAAI,6BAA6B,SAAS,GAAG;AACrD,cAAQ,IAAI,4BAA4B,SAAS,2BAA2B;AAAA,IAC9E;AAAA,EACF;AACF;","names":[]}
|
|
@@ -342,6 +342,24 @@ declare function buildDomActionabilityDiagScript(selector: Selector): string;
|
|
|
342
342
|
/** Build a ~70-byte call to the pre-injected `window.__spanaRt` runtime. */
|
|
343
343
|
declare function buildInjectedCallScript(method: InjectedRuntimeMethod, ...args: unknown[]): string;
|
|
344
344
|
|
|
345
|
+
interface Geolocation {
|
|
346
|
+
latitude: number;
|
|
347
|
+
longitude: number;
|
|
348
|
+
accuracy?: number;
|
|
349
|
+
}
|
|
350
|
+
type Orientation = "portrait" | "landscape";
|
|
351
|
+
interface PermissionOptions {
|
|
352
|
+
origin?: string;
|
|
353
|
+
}
|
|
354
|
+
type BiometricOptions = {
|
|
355
|
+
type: "faceId" | "touchId";
|
|
356
|
+
match?: boolean;
|
|
357
|
+
} | {
|
|
358
|
+
type: "fingerprint";
|
|
359
|
+
fingerId: number;
|
|
360
|
+
};
|
|
361
|
+
type PushPayload = Record<string, unknown>;
|
|
362
|
+
|
|
345
363
|
type RawHierarchy = string;
|
|
346
364
|
/**
|
|
347
365
|
* Per-launch device state overrides (language/locale/timeZone) applied at app
|
|
@@ -564,6 +582,13 @@ interface RawDriverService<_T extends string = string, R extends string = string
|
|
|
564
582
|
readonly hideKeyboard: () => Effect.Effect<void, DriverError>;
|
|
565
583
|
readonly takeScreenshot: () => Effect.Effect<Uint8Array, DriverError>;
|
|
566
584
|
readonly getDeviceInfo: () => Effect.Effect<DeviceInfo, DriverError>;
|
|
585
|
+
readonly setGeolocation?: (point: Geolocation) => Effect.Effect<void, DriverError>;
|
|
586
|
+
readonly setSystemTime?: (time: Date | number | string) => Effect.Effect<void, DriverError>;
|
|
587
|
+
readonly setPermission?: (appId: string, permission: string, state: "grant" | "deny", options?: PermissionOptions) => Effect.Effect<void, DriverError>;
|
|
588
|
+
readonly setOrientation?: (orientation: Orientation) => Effect.Effect<void, DriverError>;
|
|
589
|
+
readonly setBiometricEnrollment?: (enabled: boolean) => Effect.Effect<void, DriverError>;
|
|
590
|
+
readonly simulateBiometric?: (options: BiometricOptions) => Effect.Effect<void, DriverError>;
|
|
591
|
+
readonly sendPushNotification?: (appId: string, payload: PushPayload) => Effect.Effect<void, DriverError>;
|
|
567
592
|
readonly launchApp: (bundleId: string, opts?: LaunchOptions<R>) => Effect.Effect<void, DriverError>;
|
|
568
593
|
readonly stopApp: (bundleId: string) => Effect.Effect<void, DriverError>;
|
|
569
594
|
readonly killApp: (bundleId: string) => Effect.Effect<void, DriverError>;
|
|
@@ -612,6 +637,9 @@ interface RawDriverService<_T extends string = string, R extends string = string
|
|
|
612
637
|
readonly getJSErrors?: () => Effect.Effect<BrowserJSError[], DriverError>;
|
|
613
638
|
readonly getHAR?: () => Effect.Effect<BrowserHAR, DriverError>;
|
|
614
639
|
readonly getRawPage?: () => unknown;
|
|
640
|
+
readonly getAriaSnapshot?: (selector: Selector, timeout?: number) => Effect.Effect<string, DriverError>;
|
|
641
|
+
readonly startJSCoverage?: () => Effect.Effect<void, DriverError>;
|
|
642
|
+
readonly stopJSCoverage?: () => Effect.Effect<unknown[], DriverError>;
|
|
615
643
|
readonly getCdpSession?: () => CdpSessionHandle | undefined;
|
|
616
644
|
readonly enableVirtualAuthenticator?: (opts?: VirtualAuthenticatorOptions) => Effect.Effect<string, DriverError>;
|
|
617
645
|
readonly removeVirtualAuthenticator?: (authenticatorId?: string) => Effect.Effect<void, DriverError>;
|
|
@@ -850,6 +878,7 @@ interface ArtifactConfig {
|
|
|
850
878
|
consoleLogs?: boolean;
|
|
851
879
|
jsErrors?: boolean;
|
|
852
880
|
har?: boolean;
|
|
881
|
+
jsCoverage?: boolean;
|
|
853
882
|
/** Video / screencast recording mode: "off" (default), "on", or "retain-on-failure". */
|
|
854
883
|
video?: VideoRecordingMode;
|
|
855
884
|
/** Embed interactive step-by-step visual playback timeline inside report.html (auto-enabled when video !== "off"). */
|
|
@@ -1021,6 +1050,9 @@ interface PromiseExpectation<T extends string = string> {
|
|
|
1021
1050
|
toHaveAccessibleDescription(expected: string | RegExp, opts?: WaitOptions): Promise<void>;
|
|
1022
1051
|
/** Negated assertion chain (`expect(selector).not.*`). */
|
|
1023
1052
|
readonly not: NegatedPromiseExpectation;
|
|
1053
|
+
toMatchAriaSnapshot(expected: string | {
|
|
1054
|
+
path: string;
|
|
1055
|
+
}, opts?: RetryAssertionOptions): Promise<void>;
|
|
1024
1056
|
toMatchScreenshot(name: string, options?: {
|
|
1025
1057
|
threshold?: number;
|
|
1026
1058
|
maxDiffPixelRatio?: number;
|
|
@@ -1068,6 +1100,9 @@ interface PollExpectation<V> extends PollMatchers<V> {
|
|
|
1068
1100
|
interface PromiseExpectFn<T extends string = string> {
|
|
1069
1101
|
(selector: ExtendedSelector<T>): PromiseExpectation<T>;
|
|
1070
1102
|
(fn: () => unknown | Promise<unknown>): ToPassExpectation;
|
|
1103
|
+
soft: ((selector: ExtendedSelector<T>) => PromiseExpectation<T>) & {
|
|
1104
|
+
toHaveURL(expected: string | RegExp, opts?: WaitOptions): Promise<void>;
|
|
1105
|
+
};
|
|
1071
1106
|
/** Assert that the current page URL matches a substring/exact string or RegExp. */
|
|
1072
1107
|
toHaveURL(expected: string | RegExp, opts?: WaitOptions): Promise<void>;
|
|
1073
1108
|
/** Negated page-level matchers (`expect.not.toHaveURL(...)`). */
|
|
@@ -1180,6 +1215,14 @@ interface PromiseApp<T extends string = string, R extends string = string> {
|
|
|
1180
1215
|
takeScreenshot(name?: string): Promise<Uint8Array>;
|
|
1181
1216
|
evaluate<Result = unknown>(fn: ((...args: any[]) => Result) | string, ...args: any[]): Promise<Result>;
|
|
1182
1217
|
mockNetwork(matcher: BrowserRouteMatcher, response: BrowserMockResponse): Promise<void>;
|
|
1218
|
+
setGeolocation(point: Geolocation): Promise<void>;
|
|
1219
|
+
setSystemTime(time: Date | number | string): Promise<void>;
|
|
1220
|
+
grantPermission(permission: string, options?: PermissionOptions): Promise<void>;
|
|
1221
|
+
denyPermission(permission: string, options?: PermissionOptions): Promise<void>;
|
|
1222
|
+
setOrientation(orientation: Orientation): Promise<void>;
|
|
1223
|
+
setBiometricEnrollment(enabled: boolean): Promise<void>;
|
|
1224
|
+
simulateBiometric(options: BiometricOptions): Promise<void>;
|
|
1225
|
+
sendPushNotification(payload: PushPayload): Promise<void>;
|
|
1183
1226
|
blockNetwork(matcher: BrowserRouteMatcher): Promise<void>;
|
|
1184
1227
|
clearNetworkMocks(): Promise<void>;
|
|
1185
1228
|
setNetworkConditions(conditions: BrowserNetworkConditions): Promise<void>;
|
|
@@ -1263,4 +1306,4 @@ interface PromiseApp<T extends string = string, R extends string = string> {
|
|
|
1263
1306
|
switchToNativeApp(): Promise<void>;
|
|
1264
1307
|
}
|
|
1265
1308
|
|
|
1266
|
-
export { type
|
|
1309
|
+
export { type LaunchOptions as $, type AppiumExecutionConfig as A, type BrowserRouteMatcher as B, type BrowserCookie as C, DriverError as D, type ExtendedSelector as E, type BrowserHAR as F, type BrowserNetworkConditions as G, type BrowserRequestClient as H, type BrowserRequestOptions as I, type BrowserRequestResponse as J, type BrowserResponseInfo as K, type CdpSessionHandle as L, DeviceInfo as M, type DeviceStateConfig as N, type DismissKeyboardOptions as O, type Platform as P, type DomChannelKind as Q, type RawDriverService as R, type Selector as S, type TapMode as T, type DomRect as U, type VirtualAuthenticatorOptions as V, type ElectronAppConfig as W, type FrameScope as X, type Geolocation as Y, type InjectedRuntimeMethod as Z, type IsolatedBrowserContext as _, type DomElementMatch as a, type NegatedPromiseExpectation as a0, type ObjectSelector as a1, type Orientation as a2, type PermissionOptions as a3, type PollExpectation as a4, type PollMatchers as a5, type PromiseExpectFn as a6, type PromiseExpectation as a7, type PushPayload as a8, type RelativeSelector as a9, first as aA, inFrame as aB, isComposableDomSelector as aC, isSystemUISelector as aD, isTestIDSelector as aE, last as aF, nth as aG, or as aH, systemUI as aI, within as aJ, type RetryAssertionOptions as aa, SPANA_INJECTED_RUNTIME_SCRIPT as ab, type ScrollUntilVisibleOptions as ac, type SelectorModifiers as ad, type StorybookConfig as ae, type StorybookOpenOptions as af, type StorybookValue as ag, type ToPassExpectation as ah, type TouchAction as ai, type TouchSequence as aj, type VideoRecordingMode as ak, type WarmDaemonConfig as al, type WebBrowserEngine as am, type WebContextIsolation as an, type WebExecutionConfig as ao, type WebResourceBlockType as ap, buildDomActionabilityDiagScript as aq, buildDomFillScript as ar, buildDomWaitForHiddenScript as as, buildDomWaitForMatchScript as at, buildDomWaitForSelectorScript as au, buildInjectedCallScript as av, byCss as aw, byRole as ax, defineConfig as ay, filterSelector as az, type ProvConfig as b, type DomChannel as c, type DomTargetInfo as d, type DomWaitForSelectorOptions as e, type DomWaitForHiddenOptions as f, type DomWaitForMatchOptions as g, type DomWaitForMatchResult as h, type DomFillOptions as i, type BrowserMockResponse as j, type DomIdleOptions as k, type DomStorageEntries as l, type DomClearStorageOptions as m, type BrowserConsoleLog as n, type BrowserJSError as o, type BrowserName as p, type ElectrobunAppConfig as q, type ElectrobunRenderer as r, type AppConfig as s, type VirtualCredential as t, type VirtualCredentialInput as u, type PromiseApp as v, type ArtifactConfig as w, type BackUntilVisibleOptions as x, type BiometricOptions as y, type BridgeConfig as z };
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
parseWebHierarchy,
|
|
17
17
|
resolveNetworkConditions,
|
|
18
18
|
setupUiAutomator2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-B35G77DN.js";
|
|
20
20
|
import {
|
|
21
21
|
CdpDomChannel,
|
|
22
22
|
DriverError,
|
|
@@ -24,7 +24,13 @@ import {
|
|
|
24
24
|
buildDomFindElementScript,
|
|
25
25
|
createSpanaBridgeChannel,
|
|
26
26
|
makeElectrobunDriver
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-B473XZOM.js";
|
|
28
|
+
import {
|
|
29
|
+
connectPhysicalDevice,
|
|
30
|
+
ensureAppInstalled,
|
|
31
|
+
ensureIOSSimulator,
|
|
32
|
+
firstIOSPhysicalDevice
|
|
33
|
+
} from "./chunk-WV3ALL3H.js";
|
|
28
34
|
import {
|
|
29
35
|
setupWDA
|
|
30
36
|
} from "./chunk-VP6V4XEJ.js";
|
|
@@ -33,16 +39,14 @@ import {
|
|
|
33
39
|
registerWarmDaemon,
|
|
34
40
|
updateWarmDaemonSession
|
|
35
41
|
} from "./chunk-Z6K4QQAR.js";
|
|
36
|
-
import {
|
|
37
|
-
connectPhysicalDevice,
|
|
38
|
-
ensureAppInstalled,
|
|
39
|
-
ensureIOSSimulator,
|
|
40
|
-
firstIOSPhysicalDevice
|
|
41
|
-
} from "./chunk-WV3ALL3H.js";
|
|
42
42
|
import {
|
|
43
43
|
allocateFreePort,
|
|
44
44
|
allocatePort
|
|
45
45
|
} from "./chunk-JPZCZHL4.js";
|
|
46
|
+
import {
|
|
47
|
+
focusFlows,
|
|
48
|
+
getFlowSkip
|
|
49
|
+
} from "./chunk-DP7MGXHN.js";
|
|
46
50
|
import {
|
|
47
51
|
adbReverse,
|
|
48
52
|
adbReverseRemove,
|
|
@@ -51,7 +55,7 @@ import {
|
|
|
51
55
|
|
|
52
56
|
// src/core/session-manager.ts
|
|
53
57
|
import { Effect } from "effect";
|
|
54
|
-
function createSessions(manager, driverFactory, coordinatorConfig) {
|
|
58
|
+
function createSessions(manager, driverFactory, coordinatorConfig, flowContext) {
|
|
55
59
|
const coordConfig = coordinatorConfig ?? { parse: parseWebHierarchy };
|
|
56
60
|
return {
|
|
57
61
|
async open(opts) {
|
|
@@ -63,9 +67,10 @@ function createSessions(manager, driverFactory, coordinatorConfig) {
|
|
|
63
67
|
const baseUrl = opts.baseUrl ?? "http://localhost:3000";
|
|
64
68
|
await Effect.runPromise(driver.launchApp(baseUrl));
|
|
65
69
|
const app = createPromiseApp(driver, baseUrl, coordConfig, void 0, {
|
|
66
|
-
platform: "web"
|
|
70
|
+
platform: "web",
|
|
71
|
+
flowContext
|
|
67
72
|
});
|
|
68
|
-
const expect = createPromiseExpect(driver, coordConfig);
|
|
73
|
+
const expect = createPromiseExpect(driver, coordConfig, void 0, flowContext);
|
|
69
74
|
const session = {
|
|
70
75
|
name: opts.name,
|
|
71
76
|
platform: "web",
|
|
@@ -821,8 +826,49 @@ function makeLightweightCdpDriver(options) {
|
|
|
821
826
|
fetchInterceptEnabled = true;
|
|
822
827
|
await cdpChannel.sendCommand("Fetch.enable", { patterns: [{ urlPattern: "*" }] });
|
|
823
828
|
};
|
|
829
|
+
let coverageSession;
|
|
824
830
|
const service = {
|
|
825
831
|
domChannel: cdpChannel,
|
|
832
|
+
startJSCoverage: () => Effect2.tryPromise({
|
|
833
|
+
try: async () => {
|
|
834
|
+
const session = activeSlot?.sessionId ?? null;
|
|
835
|
+
await cdpChannel.sendCommand("Profiler.enable", {}, session);
|
|
836
|
+
try {
|
|
837
|
+
await cdpChannel.sendCommand(
|
|
838
|
+
"Profiler.startPreciseCoverage",
|
|
839
|
+
{ callCount: true, detailed: true },
|
|
840
|
+
session
|
|
841
|
+
);
|
|
842
|
+
coverageSession = session;
|
|
843
|
+
} catch (error) {
|
|
844
|
+
await cdpChannel.sendCommand("Profiler.disable", {}, session).catch(() => {
|
|
845
|
+
});
|
|
846
|
+
throw error;
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
catch: (error) => new DriverError({ message: `CDP JavaScript coverage is unavailable: ${error}` })
|
|
850
|
+
}),
|
|
851
|
+
stopJSCoverage: () => Effect2.tryPromise({
|
|
852
|
+
try: async () => {
|
|
853
|
+
const session = coverageSession;
|
|
854
|
+
coverageSession = void 0;
|
|
855
|
+
if (session === void 0) throw new Error("JavaScript coverage was not started");
|
|
856
|
+
try {
|
|
857
|
+
const { result } = await cdpChannel.sendCommand(
|
|
858
|
+
"Profiler.takePreciseCoverage",
|
|
859
|
+
{},
|
|
860
|
+
session
|
|
861
|
+
);
|
|
862
|
+
return result.filter(({ url }) => url && !url.startsWith("extensions::"));
|
|
863
|
+
} finally {
|
|
864
|
+
await cdpChannel.sendCommand("Profiler.stopPreciseCoverage", {}, session).catch(() => {
|
|
865
|
+
});
|
|
866
|
+
await cdpChannel.sendCommand("Profiler.disable", {}, session).catch(() => {
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
catch: (error) => new DriverError({ message: `CDP JavaScript coverage collection failed: ${error}` })
|
|
871
|
+
}),
|
|
826
872
|
beginFlow: (_flowName) => Effect2.tryPromise({
|
|
827
873
|
try: async () => {
|
|
828
874
|
consoleLogs.length = 0;
|
|
@@ -2696,6 +2742,7 @@ var DEFAULT_ARTIFACT_CONFIG = {
|
|
|
2696
2742
|
consoleLogs: true,
|
|
2697
2743
|
jsErrors: true,
|
|
2698
2744
|
har: true,
|
|
2745
|
+
jsCoverage: false,
|
|
2699
2746
|
video: "off",
|
|
2700
2747
|
playback: false
|
|
2701
2748
|
};
|
|
@@ -3503,6 +3550,8 @@ function buildPlaybackStepMarkers(steps) {
|
|
|
3503
3550
|
async function executeFlow(flow, driver, config) {
|
|
3504
3551
|
const start2 = Date.now();
|
|
3505
3552
|
const { platform, coordinatorConfig, appId } = config;
|
|
3553
|
+
const skip = getFlowSkip(flow, platform);
|
|
3554
|
+
if (skip) return skip;
|
|
3506
3555
|
const autoLaunch = flow.config.autoLaunch ?? config.autoLaunch ?? true;
|
|
3507
3556
|
const timeout = flow.config.timeout ?? config.flowTimeout ?? 6e4;
|
|
3508
3557
|
const artifactConfig = resolveArtifactConfig(config.artifactConfig, flow.config.artifacts);
|
|
@@ -3522,11 +3571,27 @@ async function executeFlow(flow, driver, config) {
|
|
|
3522
3571
|
typingDelay: flowDefaults.typingDelay ?? coordinatorConfig.typingDelay,
|
|
3523
3572
|
hierarchyCacheTtl: flowDefaults.hierarchyCacheTtl ?? coordinatorConfig.hierarchyCacheTtl
|
|
3524
3573
|
} : coordinatorConfig;
|
|
3574
|
+
const softFailures = [];
|
|
3575
|
+
const aggregateFailures = (hardFailure) => {
|
|
3576
|
+
const messages = softFailures.map(
|
|
3577
|
+
(error, i) => `${i + 1}. ${error instanceof Error ? error.message : String(error)}`
|
|
3578
|
+
);
|
|
3579
|
+
return new AggregateError(
|
|
3580
|
+
hardFailure ? [hardFailure, ...softFailures] : softFailures,
|
|
3581
|
+
`${hardFailure ? `${hardFailure.message}
|
|
3582
|
+
` : ""}${softFailures.length} soft assertion(s) failed:
|
|
3583
|
+
${messages.join("\n")}`,
|
|
3584
|
+
{ cause: hardFailure ?? softFailures[0] }
|
|
3585
|
+
);
|
|
3586
|
+
};
|
|
3525
3587
|
const flowMeta = {
|
|
3526
3588
|
flowFilePath: flow.sourcePath ?? "",
|
|
3527
3589
|
flowName: flow.name,
|
|
3528
3590
|
platform,
|
|
3529
|
-
updateBaselines: config.updateBaselines ?? false
|
|
3591
|
+
updateBaselines: config.updateBaselines ?? false,
|
|
3592
|
+
recordSoftFailure: (error) => {
|
|
3593
|
+
softFailures.push(error);
|
|
3594
|
+
}
|
|
3530
3595
|
};
|
|
3531
3596
|
const extraCleanups = [];
|
|
3532
3597
|
const app = createPromiseApp(driver, appId, mergedCoordinatorConfig, stepRecorder, {
|
|
@@ -3560,12 +3625,29 @@ async function executeFlow(flow, driver, config) {
|
|
|
3560
3625
|
);
|
|
3561
3626
|
return pwDriver;
|
|
3562
3627
|
},
|
|
3563
|
-
{ parse: (raw) => parseWebHierarchy(raw) }
|
|
3628
|
+
{ parse: (raw) => parseWebHierarchy(raw) },
|
|
3629
|
+
{ ...flowMeta, platform: "web" }
|
|
3564
3630
|
);
|
|
3565
3631
|
flowCtx.sessions = sessions;
|
|
3566
3632
|
let videoRecorder;
|
|
3633
|
+
let collectingCoverage = false;
|
|
3567
3634
|
let recordingFinalized = false;
|
|
3568
3635
|
const wantRecording = artifactConfig.video !== "off" || artifactConfig.playback;
|
|
3636
|
+
const captureCoverage = async (attachments, status) => {
|
|
3637
|
+
if (!collectingCoverage || !driver.stopJSCoverage) return;
|
|
3638
|
+
collectingCoverage = false;
|
|
3639
|
+
try {
|
|
3640
|
+
const entries = await Effect6.runPromise(driver.stopJSCoverage());
|
|
3641
|
+
const path = join5(flowArtifactDir(artifactConfig, flow.name, platform), "js-coverage.json");
|
|
3642
|
+
writeFileSync4(path, JSON.stringify(entries), "utf8");
|
|
3643
|
+
attachments.push({ name: "js-coverage", contentType: "application/json", path });
|
|
3644
|
+
} catch (error) {
|
|
3645
|
+
if (status === "passed") throw error;
|
|
3646
|
+
console.warn(
|
|
3647
|
+
`Failed to capture JavaScript coverage: ${error instanceof Error ? error.message : String(error)}`
|
|
3648
|
+
);
|
|
3649
|
+
}
|
|
3650
|
+
};
|
|
3569
3651
|
const finalizeRecording = async (status, attachments, steps, durationMs) => {
|
|
3570
3652
|
if (recordingFinalized || !wantRecording) return;
|
|
3571
3653
|
recordingFinalized = true;
|
|
@@ -3635,6 +3717,7 @@ async function executeFlow(flow, driver, config) {
|
|
|
3635
3717
|
platform,
|
|
3636
3718
|
"failed"
|
|
3637
3719
|
);
|
|
3720
|
+
await captureCoverage(attachments, "failed");
|
|
3638
3721
|
const steps = stepRecorder.getSteps();
|
|
3639
3722
|
const durationMs = Date.now() - start2;
|
|
3640
3723
|
await finalizeRecording("failed", attachments, steps, durationMs);
|
|
@@ -3660,6 +3743,21 @@ async function executeFlow(flow, driver, config) {
|
|
|
3660
3743
|
return buildFailureResult(error);
|
|
3661
3744
|
}
|
|
3662
3745
|
}
|
|
3746
|
+
if (artifactConfig.jsCoverage && platform === "web") {
|
|
3747
|
+
if (!driver.startJSCoverage || !driver.stopJSCoverage) {
|
|
3748
|
+
return buildFailureResult(
|
|
3749
|
+
new Error(
|
|
3750
|
+
"JavaScript coverage is not supported on web with the current driver; use Chromium with Playwright or direct CDP"
|
|
3751
|
+
)
|
|
3752
|
+
);
|
|
3753
|
+
}
|
|
3754
|
+
try {
|
|
3755
|
+
await Effect6.runPromise(driver.startJSCoverage());
|
|
3756
|
+
collectingCoverage = true;
|
|
3757
|
+
} catch (error) {
|
|
3758
|
+
return buildFailureResult(error);
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3663
3761
|
if (wantRecording) {
|
|
3664
3762
|
try {
|
|
3665
3763
|
if (isCdpScreencastCapable(driver.domChannel)) {
|
|
@@ -3689,6 +3787,7 @@ async function executeFlow(flow, driver, config) {
|
|
|
3689
3787
|
}
|
|
3690
3788
|
}
|
|
3691
3789
|
let result;
|
|
3790
|
+
let softFailureError;
|
|
3692
3791
|
try {
|
|
3693
3792
|
if (autoLaunch) {
|
|
3694
3793
|
await app.launch();
|
|
@@ -3702,6 +3801,10 @@ async function executeFlow(flow, driver, config) {
|
|
|
3702
3801
|
)
|
|
3703
3802
|
)
|
|
3704
3803
|
]);
|
|
3804
|
+
if (softFailures.length > 0) {
|
|
3805
|
+
softFailureError = aggregateFailures();
|
|
3806
|
+
throw softFailureError;
|
|
3807
|
+
}
|
|
3705
3808
|
const attachments = await captureArtifacts(
|
|
3706
3809
|
driver,
|
|
3707
3810
|
artifactConfig,
|
|
@@ -3709,6 +3812,7 @@ async function executeFlow(flow, driver, config) {
|
|
|
3709
3812
|
platform,
|
|
3710
3813
|
"passed"
|
|
3711
3814
|
);
|
|
3815
|
+
await captureCoverage(attachments, "passed");
|
|
3712
3816
|
const steps = stepRecorder.getSteps();
|
|
3713
3817
|
const durationMs = Date.now() - start2;
|
|
3714
3818
|
await finalizeRecording("passed", attachments, steps, durationMs);
|
|
@@ -3729,10 +3833,12 @@ async function executeFlow(flow, driver, config) {
|
|
|
3729
3833
|
platform,
|
|
3730
3834
|
"failed"
|
|
3731
3835
|
);
|
|
3836
|
+
await captureCoverage(attachments, "failed");
|
|
3732
3837
|
const steps = stepRecorder.getSteps();
|
|
3733
3838
|
const durationMs = Date.now() - start2;
|
|
3734
3839
|
await finalizeRecording("failed", attachments, steps, durationMs);
|
|
3735
|
-
const
|
|
3840
|
+
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
3841
|
+
const flowError = softFailures.length > 0 && error !== softFailureError ? aggregateFailures(normalized) : normalized;
|
|
3736
3842
|
result = {
|
|
3737
3843
|
name: flow.name,
|
|
3738
3844
|
platform,
|
|
@@ -3818,7 +3924,7 @@ async function runParallel(config) {
|
|
|
3818
3924
|
durationHintsMs,
|
|
3819
3925
|
claimNextFlow
|
|
3820
3926
|
} = config;
|
|
3821
|
-
const flows = orderFlowsLongestFirst(rawFlows, durationHintsMs);
|
|
3927
|
+
const flows = orderFlowsLongestFirst(focusFlows(rawFlows), durationHintsMs);
|
|
3822
3928
|
const start2 = Date.now();
|
|
3823
3929
|
const results = [];
|
|
3824
3930
|
let nextFlowIndex = 0;
|
|
@@ -3838,16 +3944,22 @@ async function runParallel(config) {
|
|
|
3838
3944
|
if (flowIdx >= flows.length) break;
|
|
3839
3945
|
flow = flows[flowIdx];
|
|
3840
3946
|
}
|
|
3841
|
-
|
|
3842
|
-
|
|
3947
|
+
const skip = getFlowSkip(flow, worker.engineConfig.platform);
|
|
3948
|
+
if (skip) {
|
|
3949
|
+
results.push(skip);
|
|
3950
|
+
onFlowComplete?.(skip, worker.name);
|
|
3951
|
+
continue;
|
|
3952
|
+
}
|
|
3953
|
+
const flowRetries = flow.config.retries ?? retries;
|
|
3843
3954
|
onFlowStart?.(flow.name, worker.name);
|
|
3844
|
-
|
|
3845
|
-
|
|
3955
|
+
let result = await executeFlow(flow, worker.driver, worker.engineConfig);
|
|
3956
|
+
let attempts = 1;
|
|
3957
|
+
while (result.status === "failed" && attempts <= flowRetries) {
|
|
3958
|
+
if (retryDelay > 0) {
|
|
3846
3959
|
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
3847
3960
|
}
|
|
3848
3961
|
result = await executeFlow(flow, worker.driver, worker.engineConfig);
|
|
3849
3962
|
attempts++;
|
|
3850
|
-
if (result.status === "passed") break;
|
|
3851
3963
|
}
|
|
3852
3964
|
if (result.status === "passed" && attempts > 1) {
|
|
3853
3965
|
result.flaky = true;
|
|
@@ -3868,13 +3980,15 @@ async function runParallel(config) {
|
|
|
3868
3980
|
bailedOut = true;
|
|
3869
3981
|
while (nextFlowIndex < flows.length) {
|
|
3870
3982
|
const flow = flows[nextFlowIndex++];
|
|
3871
|
-
results.push(
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3983
|
+
results.push(
|
|
3984
|
+
getFlowSkip(flow, workers[0].engineConfig.platform) ?? {
|
|
3985
|
+
name: flow.name,
|
|
3986
|
+
platform: workers[0].engineConfig.platform,
|
|
3987
|
+
status: "skipped",
|
|
3988
|
+
durationMs: 0,
|
|
3989
|
+
attempts: 0
|
|
3990
|
+
}
|
|
3991
|
+
);
|
|
3878
3992
|
}
|
|
3879
3993
|
}
|
|
3880
3994
|
const workerStats = /* @__PURE__ */ new Map();
|
|
@@ -4117,4 +4231,4 @@ export {
|
|
|
4117
4231
|
writeWorkerProcessReport,
|
|
4118
4232
|
runMultiProcessPool
|
|
4119
4233
|
};
|
|
4120
|
-
//# sourceMappingURL=chunk-
|
|
4234
|
+
//# sourceMappingURL=chunk-66D3C7NB.js.map
|