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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/report/junit.ts"],"sourcesContent":["import { writeFileSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { Reporter, FlowResult, RunSummary } from \"./types.js\";\n\nfunction escapeXml(str: string): string {\n return str\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\")\n .replaceAll('\"', \""\")\n .replaceAll(\"'\", \"'\");\n}\n\nfunction buildJUnitXML(summary: RunSummary): string {\n const timestamp = new Date().toISOString();\n const lines: string[] = [];\n\n lines.push('<?xml version=\"1.0\" encoding=\"UTF-8\"?>');\n lines.push(\n `<testsuites name=\"spana\" tests=\"${summary.total}\" failures=\"${summary.failed}\" time=\"${(summary.durationMs / 1000).toFixed(3)}\" timestamp=\"${timestamp}\">`,\n );\n\n // Group by platform\n const byPlatform = new Map<string, FlowResult[]>();\n for (const r of summary.results) {\n const list = byPlatform.get(r.platform) ?? [];\n list.push(r);\n byPlatform.set(r.platform, list);\n }\n\n for (const [platform, results] of byPlatform) {\n const failed = results.filter((r) => r.status === \"failed\").length;\n const skipped = results.filter((r) => r.status === \"skipped\").length;\n const totalTime = results.reduce((sum, r) => sum + r.durationMs, 0);\n\n lines.push(\n ` <testsuite name=\"${escapeXml(platform)}\" tests=\"${results.length}\" failures=\"${failed}\" skipped=\"${skipped}\" time=\"${(totalTime / 1000).toFixed(3)}\">`,\n );\n\n for (const result of results) {\n const time = (result.durationMs / 1000).toFixed(3);\n lines.push(\n ` <testcase name=\"${escapeXml(result.name)}\" classname=\"spana.${escapeXml(platform)}\" time=\"${time}\">`,\n );\n\n if (result.status === \"failed\" && result.error) {\n lines.push(` <failure message=\"${escapeXml(result.error.message)}\">`);\n if (result.error.stack) {\n lines.push(escapeXml(result.error.stack));\n }\n lines.push(` </failure>`);\n } else if (result.status === \"skipped\") {\n const reason = result.skipReason ?? result.modifier;\n lines.push(reason ? ` <skipped message=\"${escapeXml(reason)}\"/>` : ` <skipped/>`);\n }\n\n const systemOut = buildSystemOut(result);\n if (systemOut) {\n lines.push(` <system-out>${escapeXml(systemOut)}</system-out>`);\n }\n\n lines.push(` </testcase>`);\n }\n\n lines.push(` </testsuite>`);\n }\n\n lines.push(`</testsuites>`);\n return lines.join(\"\\n\");\n}\n\nfunction buildSystemOut(result: FlowResult): string | undefined {\n const lines: string[] = [];\n\n // Scenario-level steps (Gherkin Given/When/Then)\n if (result.scenarioSteps) {\n for (const step of result.scenarioSteps) {\n const duration = step.durationMs > 0 ? ` (${step.durationMs}ms)` : \"\";\n lines.push(`${step.keyword} ${step.text} [${step.status}]${duration}`);\n if (step.error) {\n lines.push(` error: ${step.error}`);\n }\n }\n }\n\n for (const attachment of result.attachments ?? []) {\n lines.push(`attachment ${attachment.name} (${attachment.contentType}): ${attachment.path}`);\n }\n\n // Driver-level steps\n for (const [index, step] of (result.steps ?? []).entries()) {\n const prefix = `step ${index + 1} ${step.command} [${step.status}]`;\n if (step.selector !== undefined) {\n lines.push(`${prefix} selector=${JSON.stringify(step.selector)}`);\n }\n if (step.error) {\n lines.push(`${prefix} error=${step.error}`);\n }\n for (const attachment of step.attachments ?? []) {\n lines.push(\n `${prefix} attachment ${attachment.name} (${attachment.contentType}): ${attachment.path}`,\n );\n }\n }\n\n return lines.length > 0 ? lines.join(\"\\n\") : undefined;\n}\n\nexport function createJUnitReporter(outputDir: string = \"./spana-output\"): Reporter {\n return {\n onRunComplete(summary) {\n const xml = buildJUnitXML(summary);\n mkdirSync(outputDir, { recursive: true });\n const outputPath = join(outputDir, \"junit-report.xml\");\n writeFileSync(outputPath, xml, \"utf-8\");\n console.log(`JUnit report written to ${outputPath}`);\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,YAAY;AAGrB,SAAS,UAAU,KAAqB;AACtC,SAAO,IACJ,WAAW,KAAK,OAAO,EACvB,WAAW,KAAK,MAAM,EACtB,WAAW,KAAK,MAAM,EACtB,WAAW,KAAK,QAAQ,EACxB,WAAW,KAAK,QAAQ;AAC7B;AAEA,SAAS,cAAc,SAA6B;AAClD,QAAM,aAAY,oBAAI,KAAK,GAAE,YAAY;AACzC,QAAM,QAAkB,CAAC;AAEzB,QAAM,KAAK,wCAAwC;AACnD,QAAM;AAAA,IACJ,mCAAmC,QAAQ,KAAK,eAAe,QAAQ,MAAM,YAAY,QAAQ,aAAa,KAAM,QAAQ,CAAC,CAAC,gBAAgB,SAAS;AAAA,EACzJ;AAGA,QAAM,aAAa,oBAAI,IAA0B;AACjD,aAAW,KAAK,QAAQ,SAAS;AAC/B,UAAM,OAAO,WAAW,IAAI,EAAE,QAAQ,KAAK,CAAC;AAC5C,SAAK,KAAK,CAAC;AACX,eAAW,IAAI,EAAE,UAAU,IAAI;AAAA,EACjC;AAEA,aAAW,CAAC,UAAU,OAAO,KAAK,YAAY;AAC5C,UAAM,SAAS,QAAQ,OAAO,CAAC,MAAM,EAAE,WAAW,QAAQ,EAAE;AAC5D,UAAM,UAAU,QAAQ,OAAO,CAAC,MAAM,EAAE,WAAW,SAAS,EAAE;AAC9D,UAAM,YAAY,QAAQ,OAAO,CAAC,KAAK,MAAM,MAAM,EAAE,YAAY,CAA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
|
|
6
8
|
loadFlowFile,
|
|
7
9
|
loadStepFiles,
|
|
8
10
|
loadTestSource
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DP7MGXHN.js";
|
|
10
12
|
import "./chunk-DGUM43GV.js";
|
|
11
13
|
export {
|
|
12
14
|
applyShard,
|
|
13
15
|
discoverFlows,
|
|
14
16
|
discoverStepFiles,
|
|
15
17
|
filterFlows,
|
|
18
|
+
focusFlows,
|
|
19
|
+
getFlowSkip,
|
|
16
20
|
loadFlowFile,
|
|
17
21
|
loadStepFiles,
|
|
18
22
|
loadTestSource
|
|
19
23
|
};
|
|
20
|
-
//# sourceMappingURL=runner-
|
|
24
|
+
//# sourceMappingURL=runner-JID2YWRE.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
discoverFlows,
|
|
3
|
-
discoverStepFiles,
|
|
4
|
-
filterFlows,
|
|
5
|
-
loadStepFiles,
|
|
6
|
-
loadTestSource
|
|
7
|
-
} from "./chunk-PLE7RFQE.js";
|
|
8
1
|
import {
|
|
9
2
|
connect
|
|
10
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6GBAPW6K.js";
|
|
11
4
|
import {
|
|
12
5
|
discoverDevices
|
|
13
6
|
} from "./chunk-SF7UYW4I.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-B35G77DN.js";
|
|
8
|
+
import "./chunk-B473XZOM.js";
|
|
9
|
+
import "./chunk-WV3ALL3H.js";
|
|
16
10
|
import "./chunk-VP6V4XEJ.js";
|
|
17
11
|
import "./chunk-Z6K4QQAR.js";
|
|
18
|
-
import "./chunk-WV3ALL3H.js";
|
|
19
12
|
import "./chunk-JPZCZHL4.js";
|
|
13
|
+
import {
|
|
14
|
+
discoverFlows,
|
|
15
|
+
discoverStepFiles,
|
|
16
|
+
filterFlows,
|
|
17
|
+
loadStepFiles,
|
|
18
|
+
loadTestSource
|
|
19
|
+
} from "./chunk-DP7MGXHN.js";
|
|
20
20
|
import "./chunk-2AFWVHQK.js";
|
|
21
21
|
import {
|
|
22
22
|
__require
|
|
@@ -849,4 +849,4 @@ async function startStudio(options) {
|
|
|
849
849
|
export {
|
|
850
850
|
startStudio
|
|
851
851
|
};
|
|
852
|
-
//# sourceMappingURL=server-
|
|
852
|
+
//# sourceMappingURL=server-6KQSTQIG.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
SpanaMcpServer,
|
|
4
4
|
buildFlowFileFromLines,
|
|
5
5
|
formatSelectorCode
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y6KMJJ2T.js";
|
|
7
7
|
import "./chunk-DGUM43GV.js";
|
|
8
8
|
export {
|
|
9
9
|
SPANA_MCP_TOOLS,
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
buildFlowFileFromLines,
|
|
12
12
|
formatSelectorCode
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=server-
|
|
14
|
+
//# sourceMappingURL=server-UIRGHUYM.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Session,
|
|
3
3
|
connect
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6GBAPW6K.js";
|
|
5
5
|
import "./chunk-SF7UYW4I.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-B35G77DN.js";
|
|
7
|
+
import "./chunk-B473XZOM.js";
|
|
8
|
+
import "./chunk-WV3ALL3H.js";
|
|
8
9
|
import "./chunk-VP6V4XEJ.js";
|
|
9
10
|
import "./chunk-Z6K4QQAR.js";
|
|
10
|
-
import "./chunk-WV3ALL3H.js";
|
|
11
11
|
import "./chunk-JPZCZHL4.js";
|
|
12
12
|
import "./chunk-2AFWVHQK.js";
|
|
13
13
|
import "./chunk-DGUM43GV.js";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
Session,
|
|
16
16
|
connect
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=session-
|
|
18
|
+
//# sourceMappingURL=session-BE6U34DA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Platform, p as BrowserName,
|
|
1
|
+
import { P as Platform, p as BrowserName, ae as StorybookConfig, R as RawDriverService, S as Selector, E as ExtendedSelector, ac as ScrollUntilVisibleOptions, x as BackUntilVisibleOptions, O as DismissKeyboardOptions, $ as LaunchOptions, af as StorybookOpenOptions, B as BrowserRouteMatcher, j as BrowserMockResponse, G as BrowserNetworkConditions, n as BrowserConsoleLog, o as BrowserJSError, v as PromiseApp, F as BrowserHAR } from './app-xIYd2jde.js';
|
|
2
2
|
import { Schema } from 'effect';
|
|
3
3
|
|
|
4
4
|
declare const Bounds: Schema.Struct<{
|
|
@@ -2,7 +2,7 @@ import "./chunk-DGUM43GV.js";
|
|
|
2
2
|
|
|
3
3
|
// src/cli/studio-command.ts
|
|
4
4
|
async function runStudioCommand(options) {
|
|
5
|
-
const { startStudio } = await import("./server-
|
|
5
|
+
const { startStudio } = await import("./server-6KQSTQIG.js");
|
|
6
6
|
const { existsSync } = await import("fs");
|
|
7
7
|
const { resolve, dirname } = await import("path");
|
|
8
8
|
const { fileURLToPath } = await import("url");
|
|
@@ -21,4 +21,4 @@ async function runStudioCommand(options) {
|
|
|
21
21
|
export {
|
|
22
22
|
runStudioCommand
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=studio-command-
|
|
24
|
+
//# sourceMappingURL=studio-command-TXQTIWRS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IXON7DMB.js";
|
|
4
4
|
import {
|
|
5
5
|
collectDiagnosticSections
|
|
6
6
|
} from "./chunk-KJPHH2TW.js";
|
|
@@ -21,36 +21,39 @@ import {
|
|
|
21
21
|
speculativelyPrelaunchWebBrowser,
|
|
22
22
|
startSharedFlowQueueServer,
|
|
23
23
|
writeWorkerProcessReport
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-66D3C7NB.js";
|
|
25
|
+
import "./chunk-7QFJ7MDH.js";
|
|
26
26
|
import {
|
|
27
27
|
createCloudProviderHelper,
|
|
28
28
|
detectProvider
|
|
29
29
|
} from "./chunk-X2TJP7LB.js";
|
|
30
|
-
import {
|
|
31
|
-
applyShard,
|
|
32
|
-
discoverFlows,
|
|
33
|
-
discoverStepFiles,
|
|
34
|
-
filterFlows,
|
|
35
|
-
loadStepFiles,
|
|
36
|
-
loadTestSource
|
|
37
|
-
} from "./chunk-PLE7RFQE.js";
|
|
38
30
|
import {
|
|
39
31
|
buildIOSLaunchConfiguration,
|
|
32
|
+
deviceEffect,
|
|
40
33
|
deviceStateToAppiumCapabilities,
|
|
41
34
|
hasLaunchDeviceState,
|
|
42
35
|
parseAndroidHierarchy,
|
|
43
36
|
parseIOSHierarchy,
|
|
44
37
|
resolveNetworkConditions,
|
|
45
38
|
splitGraphemes
|
|
46
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-B35G77DN.js";
|
|
47
40
|
import {
|
|
48
41
|
DriverError
|
|
49
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-B473XZOM.js";
|
|
43
|
+
import "./chunk-WV3ALL3H.js";
|
|
50
44
|
import "./chunk-VP6V4XEJ.js";
|
|
51
45
|
import "./chunk-Z6K4QQAR.js";
|
|
52
|
-
import "./chunk-WV3ALL3H.js";
|
|
53
46
|
import "./chunk-JPZCZHL4.js";
|
|
47
|
+
import {
|
|
48
|
+
applyShard,
|
|
49
|
+
discoverFlows,
|
|
50
|
+
discoverStepFiles,
|
|
51
|
+
filterFlows,
|
|
52
|
+
focusFlows,
|
|
53
|
+
getFlowSkip,
|
|
54
|
+
loadStepFiles,
|
|
55
|
+
loadTestSource
|
|
56
|
+
} from "./chunk-DP7MGXHN.js";
|
|
54
57
|
import "./chunk-2AFWVHQK.js";
|
|
55
58
|
import "./chunk-DGUM43GV.js";
|
|
56
59
|
|
|
@@ -64,7 +67,6 @@ async function sleep(ms) {
|
|
|
64
67
|
}
|
|
65
68
|
async function runPlatform(flows, platformConfig, options, shouldBail, noteFailure) {
|
|
66
69
|
const { platform, driver, engineConfig } = platformConfig;
|
|
67
|
-
const retries = options?.retries ?? 0;
|
|
68
70
|
const retryDelay = options?.retryDelay ?? 0;
|
|
69
71
|
const results = [];
|
|
70
72
|
const platformFlows = flows.filter((f) => {
|
|
@@ -73,7 +75,14 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
73
75
|
});
|
|
74
76
|
if (shouldBail()) {
|
|
75
77
|
for (const flow of platformFlows) {
|
|
76
|
-
results.push(
|
|
78
|
+
results.push(
|
|
79
|
+
getFlowSkip(flow, platform) ?? {
|
|
80
|
+
name: flow.name,
|
|
81
|
+
platform,
|
|
82
|
+
status: "skipped",
|
|
83
|
+
durationMs: 0
|
|
84
|
+
}
|
|
85
|
+
);
|
|
77
86
|
}
|
|
78
87
|
return { results };
|
|
79
88
|
}
|
|
@@ -83,15 +92,17 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
83
92
|
await hooks.beforeAll({ app: void 0, platform });
|
|
84
93
|
} catch (error) {
|
|
85
94
|
for (const flow of platformFlows) {
|
|
86
|
-
|
|
95
|
+
const result = getFlowSkip(flow, platform) ?? {
|
|
87
96
|
name: flow.name,
|
|
88
97
|
platform,
|
|
89
98
|
status: "failed",
|
|
90
99
|
durationMs: 0,
|
|
91
100
|
error: classifyError(error instanceof Error ? error : new Error(String(error)))
|
|
92
|
-
}
|
|
101
|
+
};
|
|
102
|
+
results.push(result);
|
|
103
|
+
options?.onResult?.(result);
|
|
93
104
|
}
|
|
94
|
-
noteFailure(
|
|
105
|
+
noteFailure(results.filter((result) => result.status === "failed").length);
|
|
95
106
|
return { results };
|
|
96
107
|
}
|
|
97
108
|
}
|
|
@@ -138,6 +149,13 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
138
149
|
return { results: parallelResult.results, workerStats: parallelResult.workerStats };
|
|
139
150
|
}
|
|
140
151
|
const runSingleFlow = async (flow) => {
|
|
152
|
+
const skip = getFlowSkip(flow, platform);
|
|
153
|
+
if (skip) {
|
|
154
|
+
results.push(skip);
|
|
155
|
+
options?.onResult?.(skip);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const retries = flow.config.retries ?? options?.retries ?? 0;
|
|
141
159
|
options?.onFlowStart?.(flow.name, platform);
|
|
142
160
|
let result = await executeFlow(flow, driver, engineConfig);
|
|
143
161
|
let attempts = 1;
|
|
@@ -176,7 +194,14 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
176
194
|
const flow = platformFlows[index];
|
|
177
195
|
if (shouldBail()) {
|
|
178
196
|
for (const skippedFlow of platformFlows.slice(index)) {
|
|
179
|
-
results.push(
|
|
197
|
+
results.push(
|
|
198
|
+
getFlowSkip(skippedFlow, platform) ?? {
|
|
199
|
+
name: skippedFlow.name,
|
|
200
|
+
platform,
|
|
201
|
+
status: "skipped",
|
|
202
|
+
durationMs: 0
|
|
203
|
+
}
|
|
204
|
+
);
|
|
180
205
|
}
|
|
181
206
|
break;
|
|
182
207
|
}
|
|
@@ -196,6 +221,7 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
196
221
|
}
|
|
197
222
|
async function orchestrate(flows, platforms, options) {
|
|
198
223
|
const start = Date.now();
|
|
224
|
+
flows = focusFlows(flows);
|
|
199
225
|
const bail = options?.bail;
|
|
200
226
|
let failureCount = 0;
|
|
201
227
|
let bailedOut = false;
|
|
@@ -416,7 +442,33 @@ async function getAppiumWindowSize(client) {
|
|
|
416
442
|
|
|
417
443
|
// src/drivers/appium/android.ts
|
|
418
444
|
function createAppiumAndroidDriver(client, defaultBundleId) {
|
|
445
|
+
const mobile = async (command, params) => {
|
|
446
|
+
await client.request("POST", client.sessionPath("/execute/sync"), {
|
|
447
|
+
script: `mobile: ${command}`,
|
|
448
|
+
args: [params]
|
|
449
|
+
});
|
|
450
|
+
};
|
|
419
451
|
const service = {
|
|
452
|
+
setGeolocation: (point) => deviceEffect("setGeolocation", () => mobile("setGeolocation", { ...point })),
|
|
453
|
+
setPermission: (appPackage, permission, state) => deviceEffect(
|
|
454
|
+
"setPermission",
|
|
455
|
+
() => mobile("changePermissions", {
|
|
456
|
+
appPackage,
|
|
457
|
+
permissions: [permission],
|
|
458
|
+
action: state === "grant" ? "grant" : "revoke",
|
|
459
|
+
target: "pm"
|
|
460
|
+
})
|
|
461
|
+
),
|
|
462
|
+
simulateBiometric: (options) => deviceEffect("simulateBiometric", () => {
|
|
463
|
+
if (options.type !== "fingerprint")
|
|
464
|
+
throw new Error("Only fingerprint simulation is supported on Android");
|
|
465
|
+
return mobile("fingerprint", { fingerprintId: options.fingerId });
|
|
466
|
+
}),
|
|
467
|
+
setOrientation: (orientation) => deviceEffect("setOrientation", async () => {
|
|
468
|
+
await client.request("POST", client.sessionPath("/orientation"), {
|
|
469
|
+
orientation: orientation.toUpperCase()
|
|
470
|
+
});
|
|
471
|
+
}),
|
|
420
472
|
// -----------------------------------------------------------------------
|
|
421
473
|
// Hierarchy
|
|
422
474
|
// -----------------------------------------------------------------------
|
|
@@ -691,7 +743,32 @@ function createAppiumAndroidDriver(client, defaultBundleId) {
|
|
|
691
743
|
// src/drivers/appium/ios.ts
|
|
692
744
|
import { Effect as Effect2 } from "effect";
|
|
693
745
|
function createAppiumIOSDriver(client) {
|
|
746
|
+
const mobile = async (command, params) => {
|
|
747
|
+
await client.request("POST", client.sessionPath("/execute/sync"), {
|
|
748
|
+
script: `mobile: ${command}`,
|
|
749
|
+
args: [params]
|
|
750
|
+
});
|
|
751
|
+
};
|
|
694
752
|
const service = {
|
|
753
|
+
setOrientation: (orientation) => deviceEffect("setOrientation", async () => {
|
|
754
|
+
await client.request("POST", client.sessionPath("/orientation"), {
|
|
755
|
+
orientation: orientation.toUpperCase()
|
|
756
|
+
});
|
|
757
|
+
}),
|
|
758
|
+
setGeolocation: ({ latitude, longitude }) => deviceEffect("setGeolocation", () => mobile("setSimulatedLocation", { latitude, longitude })),
|
|
759
|
+
setPermission: (bundleId, permission, state) => deviceEffect(
|
|
760
|
+
"setPermission",
|
|
761
|
+
() => mobile("setPermission", {
|
|
762
|
+
bundleId,
|
|
763
|
+
access: { [permission]: state === "grant" ? "yes" : "no" }
|
|
764
|
+
})
|
|
765
|
+
),
|
|
766
|
+
setBiometricEnrollment: (isEnabled) => deviceEffect("setBiometricEnrollment", () => mobile("enrollBiometric", { isEnabled })),
|
|
767
|
+
simulateBiometric: (options) => deviceEffect("simulateBiometric", () => {
|
|
768
|
+
if (options.type === "fingerprint") throw new Error("Use touchId or faceId on iOS");
|
|
769
|
+
return mobile("sendBiometricMatch", { type: options.type, match: options.match ?? true });
|
|
770
|
+
}),
|
|
771
|
+
sendPushNotification: (bundleId, payload) => deviceEffect("sendPushNotification", () => mobile("pushNotification", { bundleId, payload })),
|
|
695
772
|
// -----------------------------------------------------------------------
|
|
696
773
|
// Hierarchy
|
|
697
774
|
// -----------------------------------------------------------------------
|
|
@@ -1581,11 +1658,11 @@ async function setupReporters(reporterNames, config, resolveFromConfig, appiumUr
|
|
|
1581
1658
|
const { createRedactor, registerUrlSecrets } = await import("./redact-U72BUBBR.js");
|
|
1582
1659
|
const redactor = createRedactor();
|
|
1583
1660
|
if (appiumUrl) registerUrlSecrets(redactor, appiumUrl);
|
|
1584
|
-
const { createConsoleReporter } = await import("./console-
|
|
1661
|
+
const { createConsoleReporter } = await import("./console-DIYEJSSP.js");
|
|
1585
1662
|
const { createJsonReporter } = await import("./json-JMRPUVY2.js");
|
|
1586
|
-
const { createJUnitReporter } = await import("./junit-
|
|
1587
|
-
const { createHtmlReporter } = await import("./html-
|
|
1588
|
-
const { createAllureReporter } = await import("./allure-
|
|
1663
|
+
const { createJUnitReporter } = await import("./junit-CGB3LKHD.js");
|
|
1664
|
+
const { createHtmlReporter } = await import("./html-FLMWPFQD.js");
|
|
1665
|
+
const { createAllureReporter } = await import("./allure-FGVR5LND.js");
|
|
1589
1666
|
const { createGitHubPrReporter } = await import("./github-pr-YMWIPCCZ.js");
|
|
1590
1667
|
const resolvedOutputDir = config.artifacts?.outputDir ?? resolveFromConfig("./spana-output");
|
|
1591
1668
|
const reporters = [];
|
|
@@ -1652,6 +1729,7 @@ async function resolveExecutionContext(opts) {
|
|
|
1652
1729
|
} else if (config.artifacts?.outputDir) {
|
|
1653
1730
|
config.artifacts.outputDir = resolveFromConfig(config.artifacts.outputDir);
|
|
1654
1731
|
}
|
|
1732
|
+
if (opts.jsCoverage) config.artifacts = { ...config.artifacts, jsCoverage: true };
|
|
1655
1733
|
if (opts.browser || process.env.SPANA_WARM_SCOPE) {
|
|
1656
1734
|
config.execution = {
|
|
1657
1735
|
...config.execution,
|
|
@@ -1772,7 +1850,7 @@ async function discoverAndFilterFlows(input) {
|
|
|
1772
1850
|
loadedFlows.map((l) => l.flow),
|
|
1773
1851
|
{ tags: input.tags, grep: input.grep, platforms: input.platforms }
|
|
1774
1852
|
);
|
|
1775
|
-
const allowedFlows = new Set(filteredFlows);
|
|
1853
|
+
const allowedFlows = new Set(focusFlows(filteredFlows));
|
|
1776
1854
|
let filteredLoadedFlows = loadedFlows.filter((l) => allowedFlows.has(l.flow));
|
|
1777
1855
|
let filterSummaries = [];
|
|
1778
1856
|
if (input.changedSince && !input.filters?.length) {
|
|
@@ -2010,6 +2088,7 @@ async function runTestCommandOnce(opts) {
|
|
|
2010
2088
|
...opts.grep ? ["--grep", opts.grep] : [],
|
|
2011
2089
|
...opts.changedSince ? ["--changed-since", opts.changedSince] : [],
|
|
2012
2090
|
...opts.retries !== void 0 ? ["--retries", String(opts.retries)] : [],
|
|
2091
|
+
...opts.jsCoverage ? ["--js-coverage"] : [],
|
|
2013
2092
|
...opts.bail !== void 0 ? ["--bail", String(opts.bail)] : []
|
|
2014
2093
|
];
|
|
2015
2094
|
return {
|
|
@@ -2197,7 +2276,7 @@ async function runTestCommandOnce(opts) {
|
|
|
2197
2276
|
}
|
|
2198
2277
|
}
|
|
2199
2278
|
const redactResult = (r) => {
|
|
2200
|
-
if (!r.error) return r;
|
|
2279
|
+
if (!r.error) return r.skipReason ? { ...r, skipReason: redactor.redact(r.skipReason) } : r;
|
|
2201
2280
|
return {
|
|
2202
2281
|
...r,
|
|
2203
2282
|
error: {
|
|
@@ -2329,4 +2408,4 @@ export {
|
|
|
2329
2408
|
loadCustomReporter,
|
|
2330
2409
|
runTestCommand
|
|
2331
2410
|
};
|
|
2332
|
-
//# sourceMappingURL=test-command-
|
|
2411
|
+
//# sourceMappingURL=test-command-CCSQPKWU.js.map
|