spana-test 0.0.2 → 0.1.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.
Files changed (105) hide show
  1. package/.agents/skills/spana-testing/SKILL.md +301 -0
  2. package/README.md +33 -4
  3. package/dist/agent/index.d.ts +81 -0
  4. package/dist/agent/index.js +21 -0
  5. package/dist/allure-PTTVORQ6.js +124 -0
  6. package/dist/allure-PTTVORQ6.js.map +1 -0
  7. package/dist/android-PAPJJWVN.js +34 -0
  8. package/dist/android-PAPJJWVN.js.map +1 -0
  9. package/dist/chunk-3FSZNKEF.js +62 -0
  10. package/dist/chunk-3FSZNKEF.js.map +1 -0
  11. package/dist/chunk-53MUJUJY.js +113 -0
  12. package/dist/chunk-53MUJUJY.js.map +1 -0
  13. package/dist/chunk-5XO6S7AI.js +134 -0
  14. package/dist/chunk-5XO6S7AI.js.map +1 -0
  15. package/dist/chunk-BZRLA4Z3.js +82 -0
  16. package/dist/chunk-BZRLA4Z3.js.map +1 -0
  17. package/dist/{chunk-VZZH66U5.js → chunk-CKJQX73M.js} +896 -844
  18. package/dist/chunk-CKJQX73M.js.map +1 -0
  19. package/dist/chunk-DGUM43GV.js +11 -0
  20. package/dist/chunk-DGUM43GV.js.map +1 -0
  21. package/dist/{chunk-CYEDLQJ4.js → chunk-GZK22EIE.js} +76 -102
  22. package/dist/chunk-GZK22EIE.js.map +1 -0
  23. package/dist/chunk-PANFRTIU.js +310 -0
  24. package/dist/chunk-PANFRTIU.js.map +1 -0
  25. package/dist/chunk-PWEOJKUF.js +473 -0
  26. package/dist/chunk-PWEOJKUF.js.map +1 -0
  27. package/dist/chunk-RJ5VPHVX.js +127 -0
  28. package/dist/chunk-RJ5VPHVX.js.map +1 -0
  29. package/dist/chunk-RK4Z6C7M.js +248 -0
  30. package/dist/chunk-RK4Z6C7M.js.map +1 -0
  31. package/dist/chunk-U564GCO2.js +259 -0
  32. package/dist/chunk-U564GCO2.js.map +1 -0
  33. package/dist/chunk-V62HFH6E.js +269 -0
  34. package/dist/chunk-V62HFH6E.js.map +1 -0
  35. package/dist/chunk-VDWWIVM6.js +303 -0
  36. package/dist/chunk-VDWWIVM6.js.map +1 -0
  37. package/dist/{discover-XIRJTZ7Z.js → chunk-WIJYK22K.js} +12 -5
  38. package/dist/{discover-XIRJTZ7Z.js.map → chunk-WIJYK22K.js.map} +1 -1
  39. package/dist/cli.js +134 -16
  40. package/dist/cli.js.map +1 -1
  41. package/dist/compiler-G75RIIYS.js +312 -0
  42. package/dist/compiler-G75RIIYS.js.map +1 -0
  43. package/dist/config-Dg9O0rcQ.d.ts +219 -0
  44. package/dist/config-loader-JJ5RPP53.js +9 -0
  45. package/dist/config-loader-JJ5RPP53.js.map +1 -0
  46. package/dist/console-FV4RJPO4.js +132 -0
  47. package/dist/console-FV4RJPO4.js.map +1 -0
  48. package/dist/discover-RWBKI5IB.js +14 -0
  49. package/dist/discover-RWBKI5IB.js.map +1 -0
  50. package/dist/element-CGteXiXB.d.ts +23 -0
  51. package/dist/flow-D-_tlLpp.d.ts +99 -0
  52. package/dist/gherkin/steps.d.ts +32 -0
  53. package/dist/gherkin/steps.js +39 -0
  54. package/dist/gherkin/steps.js.map +1 -0
  55. package/dist/{html-GRB34S6X.js → html-JP2HBIJQ.js} +54 -20
  56. package/dist/html-JP2HBIJQ.js.map +1 -0
  57. package/dist/index.d.ts +4 -157
  58. package/dist/index.js +36 -165
  59. package/dist/index.js.map +1 -1
  60. package/dist/init-command-CELKL2CX.js +105 -0
  61. package/dist/init-command-CELKL2CX.js.map +1 -0
  62. package/dist/installer-R6NX7BYQ.js +20 -0
  63. package/dist/installer-R6NX7BYQ.js.map +1 -0
  64. package/dist/ios-ZZU6DHH7.js +48 -0
  65. package/dist/ios-ZZU6DHH7.js.map +1 -0
  66. package/dist/{json-FK2NSRGC.js → json-JMRPUVY2.js} +2 -2
  67. package/dist/{junit-NAGZJOGQ.js → junit-UDY5JG22.js} +14 -3
  68. package/dist/junit-UDY5JG22.js.map +1 -0
  69. package/dist/provider-CUWPULGC.js +10 -0
  70. package/dist/provider-CUWPULGC.js.map +1 -0
  71. package/dist/redact-IDA3C4UH.js +77 -0
  72. package/dist/redact-IDA3C4UH.js.map +1 -0
  73. package/dist/runner-QEF6PJOE.js +20 -0
  74. package/dist/runner-QEF6PJOE.js.map +1 -0
  75. package/dist/server-MMK7PZIH.js +505 -0
  76. package/dist/server-MMK7PZIH.js.map +1 -0
  77. package/dist/session-FBJABNXL.js +16 -0
  78. package/dist/session-FBJABNXL.js.map +1 -0
  79. package/dist/studio-command-CDVPREMG.js +24 -0
  80. package/dist/studio-command-CDVPREMG.js.map +1 -0
  81. package/dist/test-command-SB5KYPQI.js +1929 -0
  82. package/dist/test-command-SB5KYPQI.js.map +1 -0
  83. package/dist/validator-CFQ55NUQ.js +13 -0
  84. package/dist/validator-CFQ55NUQ.js.map +1 -0
  85. package/package.json +41 -4
  86. package/studio-dist/assets/index-CPdpC9i-.css +1 -0
  87. package/studio-dist/assets/index-L1Wd0vop.js +183 -0
  88. package/studio-dist/index.html +13 -0
  89. package/dist/chunk-CYEDLQJ4.js.map +0 -1
  90. package/dist/chunk-PVNNKPBW.js +0 -64
  91. package/dist/chunk-PVNNKPBW.js.map +0 -1
  92. package/dist/chunk-VZZH66U5.js.map +0 -1
  93. package/dist/console-GPV3M3PC.js +0 -71
  94. package/dist/console-GPV3M3PC.js.map +0 -1
  95. package/dist/html-GRB34S6X.js.map +0 -1
  96. package/dist/junit-NAGZJOGQ.js.map +0 -1
  97. package/dist/runner-LBQUCG3K.js +0 -12
  98. package/dist/session-U7VP5J2C.js +0 -122
  99. package/dist/session-U7VP5J2C.js.map +0 -1
  100. package/dist/test-command-WPYLJYIK.js +0 -636
  101. package/dist/test-command-WPYLJYIK.js.map +0 -1
  102. package/dist/validator-J4YSBB66.js +0 -33
  103. package/dist/validator-J4YSBB66.js.map +0 -1
  104. /package/dist/{runner-LBQUCG3K.js.map → agent/index.js.map} +0 -0
  105. /package/dist/{json-FK2NSRGC.js.map → json-JMRPUVY2.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/gherkin/compiler.ts","../src/gherkin/matcher.ts"],"sourcesContent":["import { Parser, AstBuilder, GherkinClassicTokenMatcher } from \"@cucumber/gherkin\";\nimport { IdGenerator } from \"@cucumber/messages\";\nimport type { FlowDefinition, FlowConfig } from \"../api/flow.js\";\nimport type { Platform } from \"../schemas/selector.js\";\nimport type { ScenarioStepResult, ScenarioStepKeyword } from \"../report/types.js\";\nimport { createStepMatcher, type MatchResult } from \"./matcher.js\";\nimport { globalRegistry, type StepContext } from \"./registry.js\";\nimport { getWorldFactory } from \"./world.js\";\n\nconst PLATFORM_TAGS: Record<string, Platform> = {\n \"@web\": \"web\",\n \"@android\": \"android\",\n \"@ios\": \"ios\",\n};\n\ninterface GherkinStep {\n keyword: string;\n text: string;\n dataTable?: { rows: readonly { cells: readonly { value: string }[] }[] };\n docString?: { content: string; mediaType?: string };\n}\n\ninterface GherkinScenario {\n name: string;\n tags: readonly { name: string }[];\n steps: readonly GherkinStep[];\n examples: readonly {\n tags: readonly { name: string }[];\n tableHeader?: { cells: readonly { value: string }[] };\n tableBody?: readonly { cells: readonly { value: string }[] }[];\n }[];\n}\n\nexport function compileFeature(source: string, filePath?: string): FlowDefinition[] {\n const parser = new Parser(new AstBuilder(IdGenerator.uuid()), new GherkinClassicTokenMatcher());\n\n const document = parser.parse(source);\n const feature = document.feature;\n if (!feature) return [];\n\n const featureTags = feature.tags.map((t: { name: string }) => t.name);\n const flows: FlowDefinition[] = [];\n\n // Find background steps if any\n let backgroundSteps: readonly GherkinStep[] = [];\n for (const child of feature.children) {\n if (child.background) {\n backgroundSteps = child.background.steps as readonly GherkinStep[];\n }\n }\n\n for (const child of feature.children) {\n if (!child.scenario) continue;\n const scenario = child.scenario as unknown as GherkinScenario;\n\n if (scenario.examples.length > 0) {\n // Scenario Outline — expand each example row\n for (const example of scenario.examples) {\n if (!example.tableHeader || !example.tableBody) continue;\n const headers = example.tableHeader.cells.map((c) => c.value);\n const exampleTags = example.tags.map((t) => t.name);\n\n for (const row of example.tableBody) {\n const values = row.cells.map((c) => c.value);\n const replacements: Record<string, string> = {};\n for (let i = 0; i < headers.length; i++) {\n replacements[headers[i]!] = values[i] ?? \"\";\n }\n\n const expandedName = replaceOutlinePlaceholders(scenario.name, replacements);\n const expandedSteps = scenario.steps.map((s) => ({\n ...s,\n text: replaceOutlinePlaceholders(s.text, replacements),\n }));\n\n const allTags = [...featureTags, ...scenario.tags.map((t) => t.name), ...exampleTags];\n flows.push(\n buildFlowDefinition(\n `${feature.name} — ${expandedName}`,\n allTags,\n backgroundSteps,\n expandedSteps,\n filePath,\n ),\n );\n }\n }\n } else {\n // Regular Scenario\n const allTags = [...featureTags, ...scenario.tags.map((t) => t.name)];\n flows.push(\n buildFlowDefinition(\n `${feature.name} — ${scenario.name}`,\n allTags,\n backgroundSteps,\n scenario.steps,\n filePath,\n ),\n );\n }\n }\n\n return flows;\n}\n\nfunction buildFlowDefinition(\n name: string,\n tags: string[],\n backgroundSteps: readonly GherkinStep[],\n scenarioSteps: readonly GherkinStep[],\n filePath?: string,\n): FlowDefinition {\n const { platforms, filteredTags } = extractPlatformTags(tags);\n\n const config: FlowConfig = {\n tags: filteredTags.length > 0 ? filteredTags : undefined,\n platforms: platforms.length > 0 ? platforms : undefined,\n autoLaunch: false, // Gherkin flows use Background/Given steps to navigate\n };\n\n const allSteps = [...backgroundSteps, ...scenarioSteps];\n\n return {\n name,\n config,\n fn: async (flowCtx) => {\n const matcher = createStepMatcher(globalRegistry.getSteps());\n const state = new Map<string, unknown>();\n const worldFactory = getWorldFactory();\n const world = worldFactory?.instantiate(flowCtx, state);\n\n const scenarioStepResults: ScenarioStepResult[] = [];\n const beforeHooks = globalRegistry.getHooks(\"Before\");\n const afterHooks = globalRegistry.getHooks(\"After\");\n\n const stepCtx: StepContext = {\n ...flowCtx,\n state,\n ...world,\n };\n\n // Run Before hooks\n for (const hook of beforeHooks) {\n if (hook.tagExpression && !tagsMatch(tags, hook.tagExpression)) continue;\n const hookStart = Date.now();\n try {\n await hook.fn(stepCtx);\n scenarioStepResults.push({\n keyword: \"Before\",\n text: hook.tagExpression ?? \"hook\",\n status: \"passed\",\n durationMs: Date.now() - hookStart,\n });\n } catch (error) {\n scenarioStepResults.push({\n keyword: \"Before\",\n text: hook.tagExpression ?? \"hook\",\n status: \"failed\",\n durationMs: Date.now() - hookStart,\n error: error instanceof Error ? error.message : String(error),\n });\n // Still run After hooks, then rethrow\n await runAfterHooks(afterHooks, stepCtx, tags, scenarioStepResults);\n attachScenarioSteps(flowCtx, scenarioStepResults);\n throw error;\n }\n }\n\n // Run steps — fail fast, skip remaining\n let failed = false;\n let failError: unknown;\n\n for (const step of allSteps) {\n const keyword = normalizeKeyword(step.keyword);\n const stepStart = Date.now();\n\n if (failed) {\n scenarioStepResults.push({\n keyword,\n text: step.text,\n status: \"skipped\",\n durationMs: 0,\n });\n continue;\n }\n\n const match = matcher.match(step.text);\n if (!match) {\n const error = `Undefined step: \"${step.keyword.trim()} ${step.text}\"${filePath ? ` in ${filePath}` : \"\"}`;\n scenarioStepResults.push({\n keyword,\n text: step.text,\n status: \"failed\",\n durationMs: Date.now() - stepStart,\n error,\n });\n failed = true;\n failError = new Error(error);\n continue;\n }\n\n try {\n const args = buildStepArgs(match, step);\n await match.handler.fn(stepCtx, ...args);\n scenarioStepResults.push({\n keyword,\n text: step.text,\n status: \"passed\",\n durationMs: Date.now() - stepStart,\n });\n } catch (error) {\n scenarioStepResults.push({\n keyword,\n text: step.text,\n status: \"failed\",\n durationMs: Date.now() - stepStart,\n error: error instanceof Error ? error.message : String(error),\n });\n failed = true;\n failError = error;\n }\n }\n\n // Always run After hooks\n await runAfterHooks(afterHooks, stepCtx, tags, scenarioStepResults);\n attachScenarioSteps(flowCtx, scenarioStepResults);\n\n if (failError) throw failError;\n },\n };\n}\n\nasync function runAfterHooks(\n hooks: readonly { tagExpression?: string; fn: (ctx: StepContext) => Promise<void> }[],\n stepCtx: StepContext,\n tags: string[],\n results: ScenarioStepResult[],\n): Promise<void> {\n for (const hook of hooks) {\n if (hook.tagExpression && !tagsMatch(tags, hook.tagExpression)) continue;\n const hookStart = Date.now();\n try {\n await hook.fn(stepCtx);\n results.push({\n keyword: \"After\",\n text: hook.tagExpression ?? \"hook\",\n status: \"passed\",\n durationMs: Date.now() - hookStart,\n });\n } catch (error) {\n results.push({\n keyword: \"After\",\n text: hook.tagExpression ?? \"hook\",\n status: \"failed\",\n durationMs: Date.now() - hookStart,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n}\n\nfunction attachScenarioSteps(flowCtx: any, scenarioSteps: ScenarioStepResult[]): void {\n // The engine collects steps from the step recorder on flowCtx.\n // We attach scenarioSteps to a well-known property so the engine can pick them up.\n flowCtx.__scenarioSteps = scenarioSteps;\n}\n\nfunction extractPlatformTags(tags: string[]): { platforms: Platform[]; filteredTags: string[] } {\n const platforms: Platform[] = [];\n const filteredTags: string[] = [];\n\n for (const tag of tags) {\n const platform = PLATFORM_TAGS[tag.toLowerCase()];\n if (platform) {\n platforms.push(platform);\n } else {\n filteredTags.push(tag);\n }\n }\n\n return { platforms, filteredTags };\n}\n\nfunction normalizeKeyword(keyword: string): ScenarioStepKeyword {\n const trimmed = keyword.trim();\n switch (trimmed) {\n case \"Given\":\n return \"Given\";\n case \"When\":\n return \"When\";\n case \"Then\":\n return \"Then\";\n case \"And\":\n return \"And\";\n case \"But\":\n return \"But\";\n case \"*\":\n return \"And\";\n default:\n return \"Given\";\n }\n}\n\nfunction replaceOutlinePlaceholders(text: string, replacements: Record<string, string>): string {\n return text.replace(/<([^>]+)>/g, (_, key) => replacements[key] ?? `<${key}>`);\n}\n\nfunction buildStepArgs(match: MatchResult, step: GherkinStep): unknown[] {\n const args = [...match.args];\n\n if (step.dataTable) {\n const rows = step.dataTable.rows.map((r) => r.cells.map((c) => c.value));\n args.push(rows);\n }\n\n if (step.docString) {\n args.push(step.docString.content);\n }\n\n return args;\n}\n\n/** Simple tag expression matching — supports single tags and \"and\"/\"not\" */\nfunction tagsMatch(scenarioTags: string[], expression: string): boolean {\n const parts = expression.split(/\\s+/);\n let result = true;\n let negate = false;\n\n for (const part of parts) {\n if (part === \"and\") continue;\n if (part === \"not\") {\n negate = true;\n continue;\n }\n if (part === \"or\") {\n // Simple OR: if we already matched, we're done\n if (result) return true;\n result = true;\n continue;\n }\n\n const hasTag = scenarioTags.includes(part);\n const matches = negate ? !hasTag : hasTag;\n result = result && matches;\n negate = false;\n }\n\n return result;\n}\n","import {\n CucumberExpression,\n RegularExpression,\n ParameterTypeRegistry,\n} from \"@cucumber/cucumber-expressions\";\nimport type { StepHandler } from \"./registry.js\";\n\nexport interface MatchResult {\n handler: StepHandler;\n args: unknown[];\n}\n\nexport function createStepMatcher(steps: readonly StepHandler[]) {\n const parameterTypeRegistry = new ParameterTypeRegistry();\n\n const compiled = steps.map((handler) => {\n const expression =\n handler.pattern instanceof RegExp\n ? new RegularExpression(handler.pattern, parameterTypeRegistry)\n : new CucumberExpression(handler.pattern, parameterTypeRegistry);\n return { handler, expression };\n });\n\n return {\n match(text: string): MatchResult | undefined {\n const matches: { handler: StepHandler; args: unknown[] }[] = [];\n\n for (const { handler, expression } of compiled) {\n const result = expression.match(text);\n if (result) {\n matches.push({\n handler,\n args: result.map((arg) => arg.getValue(null)),\n });\n }\n }\n\n if (matches.length === 0) return undefined;\n\n if (matches.length > 1) {\n const patterns = matches.map((m) => ` \"${m.handler.pattern}\"`).join(\"\\n\");\n throw new Error(`Ambiguous step definition for \"${text}\". Matches:\\n${patterns}`);\n }\n\n return matches[0];\n },\n };\n}\n"],"mappings":";;;;;;;AAAA,SAAS,QAAQ,YAAY,kCAAkC;AAC/D,SAAS,mBAAmB;;;ACD5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,wBAAwB,IAAI,sBAA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are const Selector: Schema.Union<[typeof Schema.String, Schema.Struct<{
5
+ testID: typeof Schema.String;
6
+ }>, Schema.Struct<{
7
+ text: typeof Schema.String;
8
+ }>, Schema.Struct<{
9
+ accessibilityLabel: typeof Schema.String;
10
+ }>, Schema.Struct<{
11
+ point: Schema.Struct<{
12
+ x: typeof Schema.Number;
13
+ y: typeof Schema.Number;
14
+ }>;
15
+ }>]>;
16
+ type Selector = typeof Selector.Type;
17
+ /** Relative selector — find element relative to an anchor element's position */
18
+ interface RelativeSelector {
19
+ selector: Selector;
20
+ below?: Selector;
21
+ above?: Selector;
22
+ leftOf?: Selector;
23
+ rightOf?: Selector;
24
+ childOf?: Selector;
25
+ }
26
+ /** Extended selector that supports both simple and relative selectors */
27
+ type ExtendedSelector = Selector | RelativeSelector;
28
+
29
+ declare const DriverError_base: Schema.TaggedErrorClass<DriverError, "DriverError", {
30
+ readonly _tag: Schema.tag<"DriverError">;
31
+ } & {
32
+ message: typeof Schema.String;
33
+ command: Schema.optional<typeof Schema.String>;
34
+ exitCode: Schema.optional<typeof Schema.Number>;
35
+ stdout: Schema.optional<typeof Schema.String>;
36
+ stderr: Schema.optional<typeof Schema.String>;
37
+ }>;
38
+ declare class DriverError extends DriverError_base {
39
+ }
40
+
41
+ declare const DeviceInfo: Schema.Struct<{
42
+ platform: Schema.Literal<["android", "ios", "web"]>;
43
+ deviceId: typeof Schema.String;
44
+ name: typeof Schema.String;
45
+ isEmulator: typeof Schema.Boolean;
46
+ screenWidth: typeof Schema.Number;
47
+ screenHeight: typeof Schema.Number;
48
+ driverType: Schema.Literal<["playwright", "uiautomator2", "wda", "appium"]>;
49
+ }>;
50
+ type DeviceInfo = typeof DeviceInfo.Type;
51
+
52
+ type RawHierarchy = string;
53
+ interface LaunchOptions {
54
+ clearState?: boolean;
55
+ clearKeychain?: boolean;
56
+ deepLink?: string;
57
+ launchArguments?: Record<string, unknown>;
58
+ }
59
+ type BrowserRouteMatcher = string | RegExp;
60
+ interface BrowserMockResponse {
61
+ status?: number;
62
+ body?: string;
63
+ json?: unknown;
64
+ headers?: Record<string, string>;
65
+ contentType?: string;
66
+ }
67
+ interface BrowserNetworkConditions {
68
+ offline?: boolean;
69
+ latencyMs?: number;
70
+ downloadThroughputKbps?: number;
71
+ uploadThroughputKbps?: number;
72
+ }
73
+ interface RawDriverService {
74
+ readonly dumpHierarchy: () => Effect.Effect<RawHierarchy, DriverError>;
75
+ readonly tapAtCoordinate: (x: number, y: number) => Effect.Effect<void, DriverError>;
76
+ readonly doubleTapAtCoordinate: (x: number, y: number) => Effect.Effect<void, DriverError>;
77
+ readonly longPressAtCoordinate: (x: number, y: number, duration: number) => Effect.Effect<void, DriverError>;
78
+ readonly swipe: (startX: number, startY: number, endX: number, endY: number, duration: number) => Effect.Effect<void, DriverError>;
79
+ readonly inputText: (text: string) => Effect.Effect<void, DriverError>;
80
+ readonly pressKey: (key: string) => Effect.Effect<void, DriverError>;
81
+ readonly hideKeyboard: () => Effect.Effect<void, DriverError>;
82
+ readonly takeScreenshot: () => Effect.Effect<Uint8Array, DriverError>;
83
+ readonly getDeviceInfo: () => Effect.Effect<DeviceInfo, DriverError>;
84
+ readonly launchApp: (bundleId: string, opts?: LaunchOptions) => Effect.Effect<void, DriverError>;
85
+ readonly stopApp: (bundleId: string) => Effect.Effect<void, DriverError>;
86
+ readonly killApp: (bundleId: string) => Effect.Effect<void, DriverError>;
87
+ readonly clearAppState: (bundleId: string) => Effect.Effect<void, DriverError>;
88
+ readonly openLink: (url: string) => Effect.Effect<void, DriverError>;
89
+ readonly back: () => Effect.Effect<void, DriverError>;
90
+ readonly evaluate: <T = unknown>(script: string | ((...args: unknown[]) => T), ...args: unknown[]) => Effect.Effect<T, DriverError>;
91
+ readonly getContexts?: () => Effect.Effect<string[], DriverError>;
92
+ readonly getCurrentContext?: () => Effect.Effect<string, DriverError>;
93
+ readonly setContext?: (contextId: string) => Effect.Effect<void, DriverError>;
94
+ readonly mockNetwork?: (matcher: BrowserRouteMatcher, response: BrowserMockResponse) => Effect.Effect<void, DriverError>;
95
+ readonly blockNetwork?: (matcher: BrowserRouteMatcher) => Effect.Effect<void, DriverError>;
96
+ readonly clearNetworkMocks?: () => Effect.Effect<void, DriverError>;
97
+ readonly setNetworkConditions?: (conditions: BrowserNetworkConditions) => Effect.Effect<void, DriverError>;
98
+ readonly saveCookies?: (path: string) => Effect.Effect<void, DriverError>;
99
+ readonly loadCookies?: (path: string) => Effect.Effect<void, DriverError>;
100
+ readonly saveAuthState?: (path: string) => Effect.Effect<void, DriverError>;
101
+ readonly loadAuthState?: (path: string) => Effect.Effect<void, DriverError>;
102
+ }
103
+
104
+ interface IOSSigningConfig {
105
+ /** Apple Development Team ID (from developer.apple.com or Xcode) */
106
+ teamId: string;
107
+ /** Code signing identity (default: "Apple Development") */
108
+ signingIdentity?: string;
109
+ }
110
+ interface AppConfig {
111
+ url?: string;
112
+ packageName?: string;
113
+ bundleId?: string;
114
+ /** Path to .app or .ipa for auto-install on device/simulator */
115
+ appPath?: string;
116
+ /** iOS code signing config for physical devices */
117
+ signing?: IOSSigningConfig;
118
+ }
119
+ type BrowserName = "chromium" | "firefox" | "webkit";
120
+ interface WebExecutionConfig {
121
+ browser?: BrowserName;
122
+ headless?: boolean;
123
+ /** Optional Playwright storage state JSON file to preload for web runs */
124
+ storageState?: string;
125
+ }
126
+ interface CloudAppReferenceConfig {
127
+ /** Existing remote app reference, e.g. bs://... or storage:... */
128
+ id?: string;
129
+ /** Local file path to upload when the provider supports managed upload */
130
+ path?: string;
131
+ /** Override the uploaded file name when the provider supports it */
132
+ name?: string;
133
+ }
134
+ interface BrowserStackAppConfig extends CloudAppReferenceConfig {
135
+ /** Stable BrowserStack app alias */
136
+ customId?: string;
137
+ }
138
+ interface BrowserStackLocalConfig {
139
+ enabled?: boolean;
140
+ binary?: string;
141
+ identifier?: string;
142
+ args?: string[];
143
+ }
144
+ interface BrowserStackHelperConfig {
145
+ app?: BrowserStackAppConfig;
146
+ local?: BrowserStackLocalConfig;
147
+ options?: Record<string, unknown>;
148
+ }
149
+ interface SauceConnectConfig {
150
+ enabled?: boolean;
151
+ binary?: string;
152
+ tunnelName?: string;
153
+ args?: string[];
154
+ }
155
+ interface SauceLabsHelperConfig {
156
+ app?: CloudAppReferenceConfig;
157
+ connect?: SauceConnectConfig;
158
+ options?: Record<string, unknown>;
159
+ }
160
+ interface AppiumExecutionConfig {
161
+ serverUrl?: string;
162
+ capabilities?: Record<string, unknown>;
163
+ capabilitiesFile?: string;
164
+ reportToProvider?: boolean;
165
+ browserstack?: BrowserStackHelperConfig;
166
+ saucelabs?: SauceLabsHelperConfig;
167
+ }
168
+ interface ExecutionConfig {
169
+ mode?: "local" | "appium";
170
+ web?: WebExecutionConfig;
171
+ appium?: AppiumExecutionConfig;
172
+ }
173
+ interface ArtifactConfig {
174
+ outputDir?: string;
175
+ captureOnFailure?: boolean;
176
+ captureOnSuccess?: boolean;
177
+ captureSteps?: boolean;
178
+ screenshot?: boolean;
179
+ uiHierarchy?: boolean;
180
+ }
181
+ interface HookContext {
182
+ app: unknown;
183
+ expect?: unknown;
184
+ platform?: Platform;
185
+ result?: unknown;
186
+ summary?: unknown;
187
+ }
188
+ interface ProvConfig {
189
+ apps?: {
190
+ web?: AppConfig;
191
+ android?: AppConfig;
192
+ ios?: AppConfig;
193
+ };
194
+ defaults?: {
195
+ waitTimeout?: number;
196
+ pollInterval?: number;
197
+ settleTimeout?: number;
198
+ retries?: number;
199
+ /** Pause after each action (tap, scroll) to let the UI settle. Default: 0 (disabled). */
200
+ waitForIdleTimeout?: number;
201
+ /** Delay between each character when typing. Default: 0 (instant). */
202
+ typingDelay?: number;
203
+ };
204
+ platforms?: Platform[];
205
+ flowDir?: string;
206
+ launchOptions?: LaunchOptions;
207
+ reporters?: string[];
208
+ hooks?: {
209
+ beforeAll?: (ctx: HookContext) => Promise<void>;
210
+ beforeEach?: (ctx: HookContext) => Promise<void>;
211
+ afterEach?: (ctx: HookContext) => Promise<void>;
212
+ afterAll?: (ctx: HookContext) => Promise<void>;
213
+ };
214
+ artifacts?: ArtifactConfig;
215
+ execution?: ExecutionConfig;
216
+ }
217
+ declare function defineConfig(config: ProvConfig): ProvConfig;
218
+
219
+ export { type AppConfig as A, type BrowserMockResponse as B, DeviceInfo as D, type ExtendedSelector as E, type LaunchOptions as L, type Platform as P, type RelativeSelector as R, Selector as S, type WebExecutionConfig as W, type ArtifactConfig as a, type BrowserName as b, type BrowserNetworkConditions as c, type BrowserRouteMatcher as d, type ProvConfig as e, defineConfig as f, type RawDriverService as g };
@@ -0,0 +1,9 @@
1
+ import {
2
+ loadConfig
3
+ } from "./chunk-53MUJUJY.js";
4
+ import "./chunk-RJ5VPHVX.js";
5
+ import "./chunk-DGUM43GV.js";
6
+ export {
7
+ loadConfig
8
+ };
9
+ //# sourceMappingURL=config-loader-JJ5RPP53.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,132 @@
1
+ import "./chunk-DGUM43GV.js";
2
+
3
+ // src/report/console.ts
4
+ function printResultAttachments(result) {
5
+ for (const attachment of result.attachments ?? []) {
6
+ console.log(` \u21B3 ${attachment.name}: ${attachment.path}`);
7
+ }
8
+ for (const [index, step] of (result.steps ?? []).entries()) {
9
+ for (const attachment of step.attachments ?? []) {
10
+ console.log(` \u21B3 step ${index + 1} ${step.command}: ${attachment.path}`);
11
+ }
12
+ }
13
+ }
14
+ function printScenarioSteps(steps) {
15
+ for (const step of steps) {
16
+ const icon = step.status === "passed" ? "\u2713" : step.status === "failed" ? "\u2717" : "\u25CB";
17
+ const duration = step.durationMs > 0 ? ` (${step.durationMs}ms)` : "";
18
+ console.log(` ${icon} ${step.keyword} ${step.text}${duration}`);
19
+ if (step.error) {
20
+ console.log(` ${step.error}`);
21
+ }
22
+ }
23
+ }
24
+ var driverNames = {
25
+ web: "Playwright",
26
+ android: "UiAutomator2",
27
+ ios: "WebDriverAgent"
28
+ };
29
+ function createConsoleReporter(options) {
30
+ const quiet = options?.quiet ?? false;
31
+ let completed = 0;
32
+ let total = 0;
33
+ let currentPlatform;
34
+ function progressPrefix() {
35
+ return total > 0 ? `[${completed}/${total}]` : "";
36
+ }
37
+ return {
38
+ onFlowStart(name, platform) {
39
+ if (quiet) return;
40
+ if (platform !== currentPlatform) {
41
+ currentPlatform = platform;
42
+ console.log(`
43
+ ${platform} (${driverNames[platform]})`);
44
+ }
45
+ if (process.stderr.isTTY) {
46
+ process.stderr.write(` \u25B8 ${progressPrefix()} ${name}...\r`);
47
+ }
48
+ },
49
+ onFlowPass(result) {
50
+ completed++;
51
+ if (quiet) return;
52
+ if (process.stderr.isTTY) {
53
+ process.stderr.write("\x1B[2K");
54
+ }
55
+ const duration = `(${result.durationMs}ms)`;
56
+ const flakyTag = result.flaky ? ` [flaky, passed on attempt ${result.attempts}]` : "";
57
+ console.log(` \u2713 ${progressPrefix()} ${result.name} ${duration}${flakyTag}`);
58
+ if (result.scenarioSteps) printScenarioSteps(result.scenarioSteps);
59
+ printResultAttachments(result);
60
+ },
61
+ onFlowFail(result) {
62
+ completed++;
63
+ if (process.stderr.isTTY) {
64
+ process.stderr.write("\x1B[2K");
65
+ }
66
+ const duration = `(${result.durationMs}ms)`;
67
+ console.log(` \u2717 ${progressPrefix()} [${result.platform}] ${result.name} ${duration}`);
68
+ if (result.scenarioSteps) printScenarioSteps(result.scenarioSteps);
69
+ printResultAttachments(result);
70
+ },
71
+ onRunComplete(summary) {
72
+ console.log("");
73
+ const byPlatform = /* @__PURE__ */ new Map();
74
+ for (const r of summary.results) {
75
+ const list = byPlatform.get(r.platform) ?? [];
76
+ list.push(r);
77
+ byPlatform.set(r.platform, list);
78
+ }
79
+ for (const [platform, results] of byPlatform) {
80
+ const passed = results.filter((r) => r.status === "passed").length;
81
+ const totalCount = results.length;
82
+ const symbols = results.map((r) => r.flaky ? "~" : r.status === "passed" ? "\u2713" : "\u2717").join("");
83
+ const label = `${platform} (${driverNames[platform]})`;
84
+ const duration = Math.max(...results.map((r) => r.durationMs));
85
+ console.log(
86
+ `${label.padEnd(25)} ${symbols} ${passed}/${totalCount} passed (${(duration / 1e3).toFixed(1)}s)`
87
+ );
88
+ }
89
+ const failures = summary.results.filter((r) => r.status === "failed");
90
+ if (failures.length > 0) {
91
+ console.log("\n--- Failures ---");
92
+ for (const f of failures) {
93
+ console.log(`\u2717 [${f.platform}] ${f.name}`);
94
+ if (f.error) {
95
+ console.log(` ${f.error.message}`);
96
+ if (f.error.suggestion) {
97
+ for (const line of f.error.suggestion.split("\n")) {
98
+ console.log(` \u{1F4A1} ${line}`);
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+ const flakyResults = summary.results.filter((r) => r.flaky);
105
+ if (flakyResults.length > 0) {
106
+ console.log("\n--- Flaky ---");
107
+ for (const f of flakyResults) {
108
+ console.log(`~ [${f.platform}] ${f.name} (passed on attempt ${f.attempts})`);
109
+ }
110
+ }
111
+ if (summary.bailedOut) {
112
+ console.log(
113
+ `
114
+ Bailed out after ${summary.failed} failure(s)${summary.bailLimit ? ` (limit: ${summary.bailLimit})` : ""}.`
115
+ );
116
+ }
117
+ const flakyStr = summary.flaky > 0 ? `, ${summary.flaky} flaky` : "";
118
+ console.log(
119
+ `
120
+ ${summary.passed}/${summary.total} passed, ${summary.failed} failed${flakyStr} (${(summary.durationMs / 1e3).toFixed(1)}s)`
121
+ );
122
+ },
123
+ // Allow callers to set total for progress tracking
124
+ set flowCount(n) {
125
+ total = n;
126
+ }
127
+ };
128
+ }
129
+ export {
130
+ createConsoleReporter
131
+ };
132
+ //# sourceMappingURL=console-FV4RJPO4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/report/console.ts"],"sourcesContent":["import type { Platform } from \"../schemas/selector.js\";\nimport type { FlowResult, Reporter, ScenarioStepResult } from \"./types.js\";\n\nexport interface ConsoleReporterOptions {\n /** Only show failures and the final summary. */\n quiet?: boolean;\n}\n\nfunction printResultAttachments(result: FlowResult): void {\n for (const attachment of result.attachments ?? []) {\n console.log(` ↳ ${attachment.name}: ${attachment.path}`);\n }\n\n for (const [index, step] of (result.steps ?? []).entries()) {\n for (const attachment of step.attachments ?? []) {\n console.log(` ↳ step ${index + 1} ${step.command}: ${attachment.path}`);\n }\n }\n}\n\nfunction printScenarioSteps(steps: ScenarioStepResult[]): void {\n for (const step of steps) {\n const icon = step.status === \"passed\" ? \"✓\" : step.status === \"failed\" ? \"✗\" : \"○\";\n const duration = step.durationMs > 0 ? ` (${step.durationMs}ms)` : \"\";\n console.log(` ${icon} ${step.keyword} ${step.text}${duration}`);\n if (step.error) {\n console.log(` ${step.error}`);\n }\n }\n}\n\nconst driverNames: Record<Platform, string> = {\n web: \"Playwright\",\n android: \"UiAutomator2\",\n ios: \"WebDriverAgent\",\n};\n\nexport function createConsoleReporter(options?: ConsoleReporterOptions): Reporter {\n const quiet = options?.quiet ?? false;\n let completed = 0;\n let total = 0;\n let currentPlatform: Platform | undefined;\n\n function progressPrefix(): string {\n return total > 0 ? `[${completed}/${total}]` : \"\";\n }\n\n return {\n onFlowStart(name, platform) {\n if (quiet) return;\n\n // Print platform header when switching to a new platform\n if (platform !== currentPlatform) {\n currentPlatform = platform;\n console.log(`\\n ${platform} (${driverNames[platform]})`);\n }\n\n if (process.stderr.isTTY) {\n process.stderr.write(` ▸ ${progressPrefix()} ${name}...\\r`);\n }\n },\n\n onFlowPass(result) {\n completed++;\n if (quiet) return;\n\n // Clear progress line\n if (process.stderr.isTTY) {\n process.stderr.write(\"\\x1b[2K\");\n }\n\n const duration = `(${result.durationMs}ms)`;\n const flakyTag = result.flaky ? ` [flaky, passed on attempt ${result.attempts}]` : \"\";\n console.log(` ✓ ${progressPrefix()} ${result.name} ${duration}${flakyTag}`);\n if (result.scenarioSteps) printScenarioSteps(result.scenarioSteps);\n printResultAttachments(result);\n },\n\n onFlowFail(result) {\n completed++;\n\n // Clear progress line\n if (process.stderr.isTTY) {\n process.stderr.write(\"\\x1b[2K\");\n }\n\n // Always show failures, even in quiet mode\n const duration = `(${result.durationMs}ms)`;\n console.log(` ✗ ${progressPrefix()} [${result.platform}] ${result.name} ${duration}`);\n if (result.scenarioSteps) printScenarioSteps(result.scenarioSteps);\n printResultAttachments(result);\n },\n\n onRunComplete(summary) {\n console.log(\"\");\n\n // Group results by platform\n const byPlatform = new Map<Platform, 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 passed = results.filter((r) => r.status === \"passed\").length;\n const totalCount = results.length;\n const symbols = results\n .map((r) => (r.flaky ? \"~\" : r.status === \"passed\" ? \"✓\" : \"✗\"))\n .join(\"\");\n const label = `${platform} (${driverNames[platform]})`;\n const duration = Math.max(...results.map((r) => r.durationMs));\n console.log(\n `${label.padEnd(25)} ${symbols} ${passed}/${totalCount} passed (${(duration / 1000).toFixed(1)}s)`,\n );\n }\n\n // Failures detail with suggestions\n const failures = summary.results.filter((r) => r.status === \"failed\");\n if (failures.length > 0) {\n console.log(\"\\n--- Failures ---\");\n for (const f of failures) {\n console.log(`✗ [${f.platform}] ${f.name}`);\n if (f.error) {\n console.log(` ${f.error.message}`);\n if (f.error.suggestion) {\n for (const line of f.error.suggestion.split(\"\\n\")) {\n console.log(` 💡 ${line}`);\n }\n }\n }\n }\n }\n\n // Flaky detail\n const flakyResults = summary.results.filter((r) => r.flaky);\n if (flakyResults.length > 0) {\n console.log(\"\\n--- Flaky ---\");\n for (const f of flakyResults) {\n console.log(`~ [${f.platform}] ${f.name} (passed on attempt ${f.attempts})`);\n }\n }\n\n if (summary.bailedOut) {\n console.log(\n `\\nBailed out after ${summary.failed} failure(s)${\n summary.bailLimit ? ` (limit: ${summary.bailLimit})` : \"\"\n }.`,\n );\n }\n\n // Final summary\n const flakyStr = summary.flaky > 0 ? `, ${summary.flaky} flaky` : \"\";\n console.log(\n `\\n${summary.passed}/${summary.total} passed, ${summary.failed} failed${flakyStr} (${(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A,mBAAsB,QAAQ,MAAM,cAClC,QAAQ,YAAY,YAAY,QAAQ,SAAS,MAAM,EACzD;AAAA,QACF;AAAA,MACF;AAGA,YAAM,WAAW,QAAQ,QAAQ,IAAI,KAAK,QAAQ,KAAK,WAAW;AAClE,cAAQ;AAAA,QACN;AAAA,EAAK,QAAQ,MAAM,IAAI,QAAQ,KAAK,YAAY,QAAQ,MAAM,UAAU,QAAQ,MAAM,QAAQ,aAAa,KAAM,QAAQ,CAAC,CAAC;AAAA,MAC7H;AAAA,IACF;AAAA;AAAA,IAGA,IAAI,UAAU,GAAW;AACvB,cAAQ;AAAA,IACV;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,14 @@
1
+ import {
2
+ discoverDevices,
3
+ findDeviceById,
4
+ firstDeviceForPlatform
5
+ } from "./chunk-WIJYK22K.js";
6
+ import "./chunk-GZK22EIE.js";
7
+ import "./chunk-V62HFH6E.js";
8
+ import "./chunk-DGUM43GV.js";
9
+ export {
10
+ discoverDevices,
11
+ findDeviceById,
12
+ firstDeviceForPlatform
13
+ };
14
+ //# sourceMappingURL=discover-RWBKI5IB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,23 @@
1
+ import { Schema } from 'effect';
2
+
3
+ declare const Element: Schema.Struct<{
4
+ id: Schema.optional<typeof Schema.String>;
5
+ text: Schema.optional<typeof Schema.String>;
6
+ accessibilityLabel: Schema.optional<typeof Schema.String>;
7
+ resourceId: Schema.optional<typeof Schema.String>;
8
+ elementType: Schema.optional<typeof Schema.String>;
9
+ bounds: Schema.Struct<{
10
+ x: typeof Schema.Number;
11
+ y: typeof Schema.Number;
12
+ width: typeof Schema.Number;
13
+ height: typeof Schema.Number;
14
+ }>;
15
+ enabled: Schema.optional<typeof Schema.Boolean>;
16
+ visible: Schema.optional<typeof Schema.Boolean>;
17
+ clickable: Schema.optional<typeof Schema.Boolean>;
18
+ focused: Schema.optional<typeof Schema.Boolean>;
19
+ children: Schema.optional<Schema.Array$<Schema.suspend<any, any, never>>>;
20
+ }>;
21
+ type Element = typeof Element.Type;
22
+
23
+ export { Element as E };
@@ -0,0 +1,99 @@
1
+ import { E as ExtendedSelector, L as LaunchOptions, d as BrowserRouteMatcher, B as BrowserMockResponse, c as BrowserNetworkConditions, P as Platform, a as ArtifactConfig, S as Selector } from './config-Dg9O0rcQ.js';
2
+
3
+ interface WaitOptions {
4
+ timeout?: number;
5
+ pollInterval?: number;
6
+ settleTimeout?: number;
7
+ }
8
+
9
+ type Direction = "up" | "down" | "left" | "right";
10
+
11
+ interface PromiseApp {
12
+ tap(selector: ExtendedSelector, opts?: WaitOptions): Promise<void>;
13
+ tapXY(x: number, y: number): Promise<void>;
14
+ doubleTap(selector: ExtendedSelector, opts?: WaitOptions): Promise<void>;
15
+ longPress(selector: ExtendedSelector, opts?: {
16
+ duration?: number;
17
+ } & WaitOptions): Promise<void>;
18
+ longPressXY(x: number, y: number, opts?: {
19
+ duration?: number;
20
+ }): Promise<void>;
21
+ inputText(text: string): Promise<void>;
22
+ pressKey(key: string): Promise<void>;
23
+ hideKeyboard(): Promise<void>;
24
+ swipe(direction: Direction, opts?: {
25
+ duration?: number;
26
+ }): Promise<void>;
27
+ scroll(direction: Direction): Promise<void>;
28
+ launch(opts?: LaunchOptions): Promise<void>;
29
+ stop(): Promise<void>;
30
+ kill(): Promise<void>;
31
+ clearState(): Promise<void>;
32
+ openLink(url: string): Promise<void>;
33
+ back(): Promise<void>;
34
+ takeScreenshot(name?: string): Promise<Uint8Array>;
35
+ evaluate<T = unknown>(fn: ((...args: any[]) => T) | string, ...args: any[]): Promise<T>;
36
+ mockNetwork(matcher: BrowserRouteMatcher, response: BrowserMockResponse): Promise<void>;
37
+ blockNetwork(matcher: BrowserRouteMatcher): Promise<void>;
38
+ clearNetworkMocks(): Promise<void>;
39
+ setNetworkConditions(conditions: BrowserNetworkConditions): Promise<void>;
40
+ saveCookies(path: string): Promise<void>;
41
+ loadCookies(path: string): Promise<void>;
42
+ saveAuthState(path: string): Promise<void>;
43
+ loadAuthState(path: string): Promise<void>;
44
+ /** List available contexts (e.g. ["NATIVE_APP", "WEBVIEW_com.example.app"]). */
45
+ getContexts(): Promise<string[]>;
46
+ /** Get the current context ID. */
47
+ getCurrentContext(): Promise<string>;
48
+ /** Switch to a specific context by ID. */
49
+ switchToContext(contextId: string): Promise<void>;
50
+ /** Switch to the first available WebView context. */
51
+ switchToWebView(): Promise<void>;
52
+ /** Switch back to the native app context. */
53
+ switchToNativeApp(): Promise<void>;
54
+ }
55
+
56
+ interface PromiseExpectation {
57
+ toBeVisible(opts?: WaitOptions): Promise<void>;
58
+ toBeHidden(opts?: WaitOptions): Promise<void>;
59
+ toHaveText(expected: string, opts?: WaitOptions): Promise<void>;
60
+ }
61
+
62
+ interface WhenCondition {
63
+ /** Only run on these platforms */
64
+ platform?: Platform | Platform[];
65
+ /** Only run when this environment variable is set */
66
+ env?: string;
67
+ }
68
+ interface FlowDefaults {
69
+ waitTimeout?: number;
70
+ pollInterval?: number;
71
+ settleTimeout?: number;
72
+ waitForIdleTimeout?: number;
73
+ typingDelay?: number;
74
+ }
75
+ interface FlowConfig {
76
+ tags?: string[];
77
+ platforms?: Platform[];
78
+ timeout?: number;
79
+ autoLaunch?: boolean;
80
+ artifacts?: ArtifactConfig;
81
+ when?: WhenCondition;
82
+ /** Per-flow overrides for timing defaults. Merged with global defaults. */
83
+ defaults?: FlowDefaults;
84
+ }
85
+ interface FlowContext {
86
+ app: PromiseApp;
87
+ expect: (selector: Selector) => PromiseExpectation;
88
+ platform: Platform;
89
+ }
90
+ type FlowFn = (ctx: FlowContext) => Promise<void>;
91
+ interface FlowDefinition {
92
+ name: string;
93
+ fn: FlowFn;
94
+ config: FlowConfig;
95
+ }
96
+ declare function flow(name: string, fn: FlowFn): FlowDefinition;
97
+ declare function flow(name: string, config: FlowConfig, fn: FlowFn): FlowDefinition;
98
+
99
+ export { type FlowConfig as F, type PromiseApp as P, type FlowContext as a, type FlowDefinition as b, type FlowFn as c, type PromiseExpectation as d, flow as f };
@@ -0,0 +1,32 @@
1
+ import { a as FlowContext } from '../flow-D-_tlLpp.js';
2
+ import '../config-Dg9O0rcQ.js';
3
+ import 'effect';
4
+
5
+ type StepContext<W = unknown> = FlowContext & {
6
+ state: Map<string, unknown>;
7
+ } & (W extends Record<string, unknown> ? W : {});
8
+ type StepFn<W = unknown> = (ctx: StepContext<W>, ...args: unknown[]) => Promise<void>;
9
+
10
+ interface WorldDefinition<S extends Record<string, unknown>, M extends Record<string, unknown>> {
11
+ create: () => S;
12
+ methods?: (ctx: FlowContext & {
13
+ state: Map<string, unknown>;
14
+ } & S) => M;
15
+ }
16
+ interface WorldFactory<S extends Record<string, unknown>, M extends Record<string, unknown>> {
17
+ /** Create a fresh world instance for a scenario run. */
18
+ instantiate(flowCtx: FlowContext, state: Map<string, unknown>): S & M;
19
+ }
20
+ declare function defineWorld<S extends Record<string, unknown>, M extends Record<string, unknown> = {}>(definition: WorldDefinition<S, M>): WorldFactory<S, M>;
21
+
22
+ declare function Given(pattern: string | RegExp, fn: StepFn): void;
23
+ declare function When(pattern: string | RegExp, fn: StepFn): void;
24
+ declare function Then(pattern: string | RegExp, fn: StepFn): void;
25
+ declare function And(pattern: string | RegExp, fn: StepFn): void;
26
+ declare function But(pattern: string | RegExp, fn: StepFn): void;
27
+ declare function Before(fn: StepFn): void;
28
+ declare function Before(tagExpression: string, fn: StepFn): void;
29
+ declare function After(fn: StepFn): void;
30
+ declare function After(tagExpression: string, fn: StepFn): void;
31
+
32
+ export { After, And, Before, But, Given, type StepContext, type StepFn, Then, When, defineWorld };
@@ -0,0 +1,39 @@
1
+ import {
2
+ defineWorld,
3
+ globalRegistry
4
+ } from "../chunk-3FSZNKEF.js";
5
+ import "../chunk-DGUM43GV.js";
6
+
7
+ // src/gherkin/steps.ts
8
+ function Given(pattern, fn) {
9
+ globalRegistry.registerStep("Given", pattern, fn);
10
+ }
11
+ function When(pattern, fn) {
12
+ globalRegistry.registerStep("When", pattern, fn);
13
+ }
14
+ function Then(pattern, fn) {
15
+ globalRegistry.registerStep("Then", pattern, fn);
16
+ }
17
+ function And(pattern, fn) {
18
+ globalRegistry.registerStep("And", pattern, fn);
19
+ }
20
+ function But(pattern, fn) {
21
+ globalRegistry.registerStep("But", pattern, fn);
22
+ }
23
+ function Before(fnOrTag, maybeFn) {
24
+ globalRegistry.registerHook("Before", fnOrTag, maybeFn);
25
+ }
26
+ function After(fnOrTag, maybeFn) {
27
+ globalRegistry.registerHook("After", fnOrTag, maybeFn);
28
+ }
29
+ export {
30
+ After,
31
+ And,
32
+ Before,
33
+ But,
34
+ Given,
35
+ Then,
36
+ When,
37
+ defineWorld
38
+ };
39
+ //# sourceMappingURL=steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/gherkin/steps.ts"],"sourcesContent":["import { globalRegistry, type StepFn } from \"./registry.js\";\nexport { defineWorld } from \"./world.js\";\nexport type { StepFn, StepContext } from \"./registry.js\";\n\nexport function Given(pattern: string | RegExp, fn: StepFn): void {\n globalRegistry.registerStep(\"Given\", pattern, fn);\n}\n\nexport function When(pattern: string | RegExp, fn: StepFn): void {\n globalRegistry.registerStep(\"When\", pattern, fn);\n}\n\nexport function Then(pattern: string | RegExp, fn: StepFn): void {\n globalRegistry.registerStep(\"Then\", pattern, fn);\n}\n\nexport function And(pattern: string | RegExp, fn: StepFn): void {\n globalRegistry.registerStep(\"And\", pattern, fn);\n}\n\nexport function But(pattern: string | RegExp, fn: StepFn): void {\n globalRegistry.registerStep(\"But\", pattern, fn);\n}\n\nexport function Before(fn: StepFn): void;\nexport function Before(tagExpression: string, fn: StepFn): void;\nexport function Before(fnOrTag: StepFn | string, maybeFn?: StepFn): void {\n globalRegistry.registerHook(\"Before\", fnOrTag, maybeFn);\n}\n\nexport function After(fn: StepFn): void;\nexport function After(tagExpression: string, fn: StepFn): void;\nexport function After(fnOrTag: StepFn | string, maybeFn?: StepFn): void {\n globalRegistry.registerHook(\"After\", fnOrTag, maybeFn);\n}\n"],"mappings":";;;;;;;AAIO,SAAS,MAAM,SAA0B,IAAkB;AAChE,iBAAe,aAAa,SAAS,SAAS,EAAE;AAClD;AAEO,SAAS,KAAK,SAA0B,IAAkB;AAC/D,iBAAe,aAAa,QAAQ,SAAS,EAAE;AACjD;AAEO,SAAS,KAAK,SAA0B,IAAkB;AAC/D,iBAAe,aAAa,QAAQ,SAAS,EAAE;AACjD;AAEO,SAAS,IAAI,SAA0B,IAAkB;AAC9D,iBAAe,aAAa,OAAO,SAAS,EAAE;AAChD;AAEO,SAAS,IAAI,SAA0B,IAAkB;AAC9D,iBAAe,aAAa,OAAO,SAAS,EAAE;AAChD;AAIO,SAAS,OAAO,SAA0B,SAAwB;AACvE,iBAAe,aAAa,UAAU,SAAS,OAAO;AACxD;AAIO,SAAS,MAAM,SAA0B,SAAwB;AACtE,iBAAe,aAAa,SAAS,SAAS,OAAO;AACvD;","names":[]}