intellitester 0.2.11 → 0.2.13

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.
@@ -15,14 +15,14 @@ import { createServer } from 'http';
15
15
 
16
16
  var nonEmptyString = z.string().trim().min(1, "Value cannot be empty");
17
17
  var LocatorSchema = z.object({
18
- description: z.string().trim().optional(),
19
- testId: z.string().trim().optional(),
20
- text: z.string().trim().optional(),
21
- css: z.string().trim().optional(),
22
- xpath: z.string().trim().optional(),
23
- role: z.string().trim().optional(),
24
- name: z.string().trim().optional()
25
- }).refine(
18
+ description: z.string().trim().optional().describe("AI-friendly description of the element to find"),
19
+ testId: z.string().trim().optional().describe("data-testid attribute value"),
20
+ text: z.string().trim().optional().describe("Visible text content"),
21
+ css: z.string().trim().optional().describe("CSS selector"),
22
+ xpath: z.string().trim().optional().describe("XPath selector"),
23
+ role: z.string().trim().optional().describe("ARIA role"),
24
+ name: z.string().trim().optional().describe("Accessible name")
25
+ }).describe("Defines how to locate an element on the page. At least one selector must be provided.").refine(
26
26
  (locator) => Boolean(
27
27
  locator.description || locator.testId || locator.text || locator.css || locator.xpath || locator.role || locator.name
28
28
  ),
@@ -30,73 +30,73 @@ var LocatorSchema = z.object({
30
30
  );
31
31
  var navigateActionSchema = z.object({
32
32
  type: z.literal("navigate"),
33
- value: nonEmptyString
34
- });
33
+ value: nonEmptyString.describe("URL or path to navigate to")
34
+ }).describe("Navigate to a URL");
35
35
  var tapActionSchema = z.object({
36
36
  type: z.literal("tap"),
37
37
  target: LocatorSchema
38
- });
38
+ }).describe("Click or tap on an element");
39
39
  var inputActionSchema = z.object({
40
40
  type: z.literal("input"),
41
41
  target: LocatorSchema,
42
- value: z.string()
43
- });
42
+ value: z.string().describe("Text to input (can reference variables with ${VAR_NAME})")
43
+ }).describe("Input text into a field");
44
44
  var assertActionSchema = z.object({
45
45
  type: z.literal("assert"),
46
46
  target: LocatorSchema,
47
- value: z.string().optional()
48
- });
47
+ value: z.string().optional().describe("Expected text content")
48
+ }).describe("Assert that an element exists or contains expected text");
49
49
  var waitActionSchema = z.object({
50
50
  type: z.literal("wait"),
51
- target: LocatorSchema.optional(),
52
- timeout: z.number().int().positive().optional()
53
- }).refine((action) => action.target || action.timeout, {
51
+ target: LocatorSchema.optional().describe("Element to wait for"),
52
+ timeout: z.number().int().positive().optional().describe("Time to wait in milliseconds")
53
+ }).describe("Wait for an element or timeout").refine((action) => action.target || action.timeout, {
54
54
  message: "wait requires a target or timeout"
55
55
  });
56
56
  var scrollActionSchema = z.object({
57
57
  type: z.literal("scroll"),
58
- target: LocatorSchema.optional(),
59
- direction: z.enum(["up", "down"]).optional(),
60
- amount: z.number().int().positive().optional()
61
- });
58
+ target: LocatorSchema.optional().describe("Element to scroll"),
59
+ direction: z.enum(["up", "down"]).optional().describe("Direction to scroll"),
60
+ amount: z.number().int().positive().optional().describe("Amount to scroll in pixels")
61
+ }).describe("Scroll the page or an element");
62
62
  var screenshotActionSchema = z.object({
63
63
  type: z.literal("screenshot"),
64
- name: z.string().optional()
65
- });
64
+ name: z.string().optional().describe("Name for the screenshot file")
65
+ }).describe("Take a screenshot");
66
66
  var setVarActionSchema = z.object({
67
67
  type: z.literal("setVar"),
68
- name: nonEmptyString,
69
- value: z.string().optional(),
70
- from: z.enum(["response", "element", "email"]).optional(),
71
- path: z.string().optional(),
72
- pattern: z.string().optional()
73
- });
68
+ name: nonEmptyString.describe("Variable name to set"),
69
+ value: z.string().optional().describe("Static value to set"),
70
+ from: z.enum(["response", "element", "email"]).optional().describe("Extract value from a source"),
71
+ path: z.string().optional().describe("JSON path or selector for extraction"),
72
+ pattern: z.string().optional().describe("Regular expression pattern for extraction")
73
+ }).describe("Set a variable for use in later steps");
74
74
  var emailWaitForActionSchema = z.object({
75
75
  type: z.literal("email.waitFor"),
76
- mailbox: nonEmptyString,
77
- timeout: z.number().int().positive().optional(),
78
- subjectContains: z.string().optional()
79
- });
76
+ mailbox: nonEmptyString.describe("Email address or mailbox to check"),
77
+ timeout: z.number().int().positive().optional().describe("How long to wait for email in milliseconds"),
78
+ subjectContains: z.string().optional().describe("Filter by email subject")
79
+ }).describe("Wait for an email to arrive");
80
80
  var emailExtractCodeActionSchema = z.object({
81
81
  type: z.literal("email.extractCode"),
82
- saveTo: nonEmptyString,
83
- pattern: z.string().optional()
84
- });
82
+ saveTo: nonEmptyString.describe("Variable name to save the extracted code"),
83
+ pattern: z.string().optional().describe("Regular expression to extract code")
84
+ }).describe("Extract a verification code from email");
85
85
  var emailExtractLinkActionSchema = z.object({
86
86
  type: z.literal("email.extractLink"),
87
- saveTo: nonEmptyString,
88
- pattern: z.string().optional()
89
- });
87
+ saveTo: nonEmptyString.describe("Variable name to save the extracted link"),
88
+ pattern: z.string().optional().describe("Regular expression to match specific links")
89
+ }).describe("Extract a link from email");
90
90
  var emailClearActionSchema = z.object({
91
91
  type: z.literal("email.clear"),
92
- mailbox: nonEmptyString
93
- });
92
+ mailbox: nonEmptyString.describe("Email address or mailbox to clear")
93
+ }).describe("Clear emails from a mailbox");
94
94
  var appwriteVerifyEmailActionSchema = z.object({
95
95
  type: z.literal("appwrite.verifyEmail")
96
- });
96
+ }).describe("Verify email using Appwrite");
97
97
  var debugActionSchema = z.object({
98
98
  type: z.literal("debug")
99
- });
99
+ }).describe("Pause execution and open Playwright Inspector for debugging");
100
100
  var ActionSchema = z.discriminatedUnion("type", [
101
101
  navigateActionSchema,
102
102
  tapActionSchema,
@@ -114,96 +114,92 @@ var ActionSchema = z.discriminatedUnion("type", [
114
114
  debugActionSchema
115
115
  ]);
116
116
  var defaultsSchema = z.object({
117
- timeout: z.number().int().positive().optional(),
118
- screenshots: z.enum(["on-failure", "always", "never"]).optional()
119
- });
117
+ timeout: z.number().int().positive().optional().describe("Default timeout in milliseconds for all actions"),
118
+ screenshots: z.enum(["on-failure", "always", "never"]).optional().describe("When to capture screenshots during test execution")
119
+ }).describe("Default settings that apply to all tests unless overridden");
120
120
  var webConfigSchema = z.object({
121
- baseUrl: nonEmptyString.url().optional(),
122
- browser: z.string().trim().optional(),
123
- headless: z.boolean().optional(),
124
- timeout: z.number().int().positive().optional()
125
- });
121
+ baseUrl: nonEmptyString.url().optional().describe("Base URL for the web application"),
122
+ browser: z.string().trim().optional().describe("Browser to use for testing"),
123
+ headless: z.boolean().optional().describe("Run browser in headless mode"),
124
+ timeout: z.number().int().positive().optional().describe("Timeout in milliseconds for web actions")
125
+ }).describe("Web platform configuration");
126
126
  var androidConfigSchema = z.object({
127
- appId: z.string().trim().optional(),
128
- device: z.string().trim().optional()
129
- });
127
+ appId: z.string().trim().optional().describe("Android application ID"),
128
+ device: z.string().trim().optional().describe("Device name or ID to run tests on")
129
+ }).describe("Android platform configuration");
130
130
  var iosConfigSchema = z.object({
131
- bundleId: z.string().trim().optional(),
132
- simulator: z.string().trim().optional()
133
- });
131
+ bundleId: z.string().trim().optional().describe("iOS bundle identifier"),
132
+ simulator: z.string().trim().optional().describe("Simulator name to run tests on")
133
+ }).describe("iOS platform configuration");
134
134
  var emailConfigSchema = z.object({
135
- provider: z.literal("inbucket"),
136
- endpoint: nonEmptyString.url().optional()
137
- });
135
+ provider: z.literal("inbucket").describe("Email testing provider"),
136
+ endpoint: nonEmptyString.url().optional().describe("Email service endpoint URL")
137
+ }).describe("Email testing configuration");
138
138
  var appwriteConfigSchema = z.object({
139
- endpoint: nonEmptyString.url(),
140
- projectId: nonEmptyString,
141
- apiKey: nonEmptyString,
142
- cleanup: z.boolean().optional(),
143
- cleanupOnFailure: z.boolean().optional()
144
- });
139
+ endpoint: nonEmptyString.url().describe("Appwrite API endpoint"),
140
+ projectId: nonEmptyString.describe("Appwrite project ID"),
141
+ apiKey: nonEmptyString.describe("Appwrite API key with appropriate permissions"),
142
+ cleanup: z.boolean().optional().describe("Enable automatic cleanup of created resources"),
143
+ cleanupOnFailure: z.boolean().optional().describe("Clean up resources even when test fails")
144
+ }).describe("Appwrite backend configuration");
145
145
  var healingSchema = z.object({
146
- enabled: z.boolean().optional(),
147
- strategies: z.array(z.string().trim()).optional()
148
- });
146
+ enabled: z.boolean().optional().describe("Enable self-healing capabilities"),
147
+ strategies: z.array(z.string().trim()).optional().describe("Healing strategies to use")
148
+ }).describe("Self-healing test configuration");
149
149
  var webServerSchema = z.object({
150
- // Option 1: Explicit command
151
- command: nonEmptyString.optional(),
152
- // Option 2: Auto-detect
153
- auto: z.boolean().optional(),
154
- // Option 3: Static directory
155
- static: z.string().optional(),
156
- // Required
157
- url: nonEmptyString.url(),
158
- port: z.number().int().positive().optional(),
159
- reuseExistingServer: z.boolean().default(true),
160
- timeout: z.number().int().positive().default(3e4),
161
- cwd: z.string().optional()
162
- }).refine((config) => config.command || config.auto || config.static, {
150
+ command: nonEmptyString.optional().describe("Command to start the web server"),
151
+ auto: z.boolean().optional().describe("Automatically detect and run the dev server from package.json"),
152
+ static: z.string().optional().describe("Serve a static directory instead of running a command"),
153
+ url: nonEmptyString.url().describe("URL to wait for before starting tests"),
154
+ port: z.number().int().positive().optional().describe("Port number for the web server"),
155
+ reuseExistingServer: z.boolean().default(true).describe("Use existing server if already running at the specified URL"),
156
+ timeout: z.number().int().positive().default(3e4).describe("Timeout in milliseconds to wait for server to become available"),
157
+ cwd: z.string().optional().describe("Working directory for the server command")
158
+ }).describe("Configuration for starting a web server before running tests").refine((config) => config.command || config.auto || config.static, {
163
159
  message: "WebServerConfig requires command, auto: true, or static directory"
164
160
  });
165
161
  var aiSourceSchema = z.object({
166
- pagesDir: z.string().optional(),
167
- componentsDir: z.string().optional(),
168
- extensions: z.array(z.string()).default([".vue", ".astro", ".tsx", ".jsx", ".svelte"])
169
- }).optional();
162
+ pagesDir: z.string().optional().describe("Directory containing page components"),
163
+ componentsDir: z.string().optional().describe("Directory containing reusable components"),
164
+ extensions: z.array(z.string()).default([".vue", ".astro", ".tsx", ".jsx", ".svelte"]).describe("File extensions to include in source code analysis")
165
+ }).optional().describe("Source code directories for AI to analyze when generating tests");
170
166
  var aiConfigSchema = z.object({
171
- provider: z.enum(["anthropic", "openai", "ollama"]),
172
- model: nonEmptyString,
173
- apiKey: z.string().trim().optional(),
174
- baseUrl: z.string().trim().url().optional(),
175
- temperature: z.number().min(0).max(2).default(0.2),
176
- maxTokens: z.number().int().positive().default(4096),
167
+ provider: z.enum(["anthropic", "openai", "ollama"]).describe("AI provider to use for test generation"),
168
+ model: nonEmptyString.describe("Model name to use"),
169
+ apiKey: z.string().trim().optional().describe("API key for the AI provider"),
170
+ baseUrl: z.string().trim().url().optional().describe("Base URL for the AI API (required for Ollama)"),
171
+ temperature: z.number().min(0).max(2).default(0.2).describe("Temperature for AI generation (0 = deterministic, 2 = very creative)"),
172
+ maxTokens: z.number().int().positive().default(4096).describe("Maximum tokens for AI responses"),
177
173
  source: aiSourceSchema
178
- });
174
+ }).describe("AI configuration for test generation and healing");
179
175
  var cleanupDiscoverSchema = z.object({
180
- enabled: z.boolean().default(true),
181
- paths: z.array(z.string()).default(["./tests/cleanup"]),
182
- pattern: z.string().default("**/*.ts")
183
- }).optional();
176
+ enabled: z.boolean().default(true).describe("Enable auto-discovery of cleanup handlers in specified paths"),
177
+ paths: z.array(z.string()).default(["./tests/cleanup"]).describe("Directories to search for cleanup handler files"),
178
+ pattern: z.string().default("**/*.ts").describe("Glob pattern to match handler files")
179
+ }).optional().describe("Auto-discovery configuration for cleanup handlers");
184
180
  var cleanupConfigSchema = z.object({
185
- provider: z.string().optional(),
186
- parallel: z.boolean().default(false),
187
- retries: z.number().min(1).max(10).default(3),
188
- types: z.record(z.string(), z.string()).optional(),
189
- handlers: z.array(z.string()).optional(),
181
+ provider: z.string().optional().describe("Primary cleanup provider to use"),
182
+ parallel: z.boolean().default(false).describe("Execute cleanup operations in parallel"),
183
+ retries: z.number().min(1).max(10).default(3).describe("Number of retry attempts for failed cleanup operations"),
184
+ types: z.record(z.string(), z.string()).optional().describe("Map resource types to cleanup handler methods"),
185
+ handlers: z.array(z.string()).optional().describe("Explicit paths to custom cleanup handler files"),
190
186
  discover: cleanupDiscoverSchema
191
- }).passthrough();
187
+ }).passthrough().describe("Comprehensive resource cleanup configuration");
192
188
  var platformsSchema = z.object({
193
189
  web: webConfigSchema.optional(),
194
190
  android: androidConfigSchema.optional(),
195
191
  ios: iosConfigSchema.optional()
196
- });
192
+ }).describe("Platform-specific configurations");
197
193
  var previewConfigSchema = z.object({
198
194
  build: z.object({
199
- command: z.string().optional()
200
- }).optional(),
195
+ command: z.string().optional().describe("Command to build the project")
196
+ }).optional().describe("Build configuration"),
201
197
  preview: z.object({
202
- command: z.string().optional()
203
- }).optional(),
204
- url: z.string().url().optional(),
205
- timeout: z.number().int().positive().optional()
206
- });
198
+ command: z.string().optional().describe("Command to start the preview server after build")
199
+ }).optional().describe("Preview server configuration"),
200
+ url: z.string().url().optional().describe("URL to wait for before starting tests"),
201
+ timeout: z.number().int().positive().optional().describe("Timeout in milliseconds to wait for preview server")
202
+ }).describe("Configuration for the --preview flag (build and serve production build)");
207
203
  var TestConfigSchema = z.object({
208
204
  defaults: defaultsSchema.optional(),
209
205
  web: webConfigSchema.optional(),
@@ -211,14 +207,14 @@ var TestConfigSchema = z.object({
211
207
  ios: iosConfigSchema.optional(),
212
208
  email: emailConfigSchema.optional(),
213
209
  appwrite: appwriteConfigSchema.optional()
214
- });
210
+ }).describe("Test-specific configuration that overrides global settings");
215
211
  var TestDefinitionSchema = z.object({
216
- name: nonEmptyString,
217
- platform: z.enum(["web", "android", "ios"]),
218
- variables: z.record(z.string(), z.string()).optional(),
212
+ name: nonEmptyString.describe("The name of the test"),
213
+ platform: z.enum(["web", "android", "ios"]).describe("The platform to run the test on"),
214
+ variables: z.record(z.string(), z.string()).optional().describe("Variables that can be referenced in test steps using ${VARIABLE_NAME} syntax"),
219
215
  config: TestConfigSchema.optional(),
220
- steps: z.array(ActionSchema).min(1)
221
- });
216
+ steps: z.array(ActionSchema).min(1).describe("The sequence of actions to execute in this test")
217
+ }).describe("Schema for IntelliTester test definition files");
222
218
  var IntellitesterConfigSchema = z.object({
223
219
  defaults: defaultsSchema.optional(),
224
220
  ai: aiConfigSchema.optional(),
@@ -229,119 +225,114 @@ var IntellitesterConfigSchema = z.object({
229
225
  cleanup: cleanupConfigSchema.optional(),
230
226
  webServer: webServerSchema.optional(),
231
227
  preview: previewConfigSchema.optional(),
232
- secrets: z.record(z.string(), z.string().trim()).optional()
233
- });
228
+ secrets: z.record(z.string(), z.string().trim()).optional().describe("Secret values that can be referenced in tests")
229
+ }).describe("Global configuration file for IntelliTester");
234
230
  var nonEmptyString2 = z.string().trim().min(1, "Value cannot be empty");
235
231
  var testReferenceSchema = z.object({
236
- file: nonEmptyString2,
237
- id: nonEmptyString2.optional(),
238
- // Optional ID for referencing in variables
239
- variables: z.record(z.string(), z.string()).optional()
240
- // Override/inject variables
241
- });
232
+ file: nonEmptyString2.describe("Path to the test file relative to the workflow file"),
233
+ id: nonEmptyString2.optional().describe("Optional ID for referencing this test in variables or dependencies"),
234
+ variables: z.record(z.string(), z.string()).optional().describe("Variables to inject or override for this specific test")
235
+ }).describe("Reference to a test file");
242
236
  var workflowWebConfigSchema = z.object({
243
- baseUrl: nonEmptyString2.url().optional(),
244
- browser: z.enum(["chromium", "firefox", "webkit"]).optional(),
245
- headless: z.boolean().optional()
246
- });
237
+ baseUrl: nonEmptyString2.url().optional().describe("Base URL for all tests in this workflow"),
238
+ browser: z.enum(["chromium", "firefox", "webkit"]).optional().describe("Browser to use for all web tests"),
239
+ headless: z.boolean().optional().describe("Run browser in headless mode")
240
+ }).describe("Web platform configuration for the workflow");
247
241
  var workflowAppwriteConfigSchema = z.object({
248
- endpoint: nonEmptyString2.url(),
249
- projectId: nonEmptyString2,
250
- apiKey: nonEmptyString2,
251
- cleanup: z.boolean().default(true),
252
- // Backwards compatibility
253
- cleanupOnFailure: z.boolean().default(true)
254
- // Backwards compatibility
255
- });
242
+ endpoint: nonEmptyString2.url().describe("Appwrite API endpoint"),
243
+ projectId: nonEmptyString2.describe("Appwrite project ID"),
244
+ apiKey: nonEmptyString2.describe("Appwrite API key"),
245
+ cleanup: z.boolean().default(true).describe("Enable automatic cleanup of created resources"),
246
+ cleanupOnFailure: z.boolean().default(true).describe("Clean up resources even when tests fail")
247
+ }).describe("Appwrite backend configuration for the workflow");
256
248
  var workflowCleanupDiscoverSchema = z.object({
257
- enabled: z.boolean().default(true),
258
- paths: z.array(z.string()).default(["./tests/cleanup"]),
259
- pattern: z.string().default("**/*.ts")
260
- }).optional();
249
+ enabled: z.boolean().default(true).describe("Enable auto-discovery of cleanup handlers"),
250
+ paths: z.array(z.string()).default(["./tests/cleanup"]).describe("Directories to search for cleanup handlers"),
251
+ pattern: z.string().default("**/*.ts").describe("Glob pattern for handler files")
252
+ }).optional().describe("Auto-discovery configuration for cleanup handlers");
261
253
  var workflowCleanupConfigSchema = z.object({
262
- provider: z.string().optional(),
263
- parallel: z.boolean().default(false),
264
- retries: z.number().min(1).max(10).default(3),
265
- types: z.record(z.string(), z.string()).optional(),
266
- handlers: z.array(z.string()).optional(),
254
+ provider: z.string().optional().describe("Cleanup provider to use"),
255
+ parallel: z.boolean().default(false).describe("Run cleanup tasks in parallel"),
256
+ retries: z.number().min(1).max(10).default(3).describe("Number of retry attempts for failed cleanup operations"),
257
+ types: z.record(z.string(), z.string()).optional().describe("Map resource types to cleanup handler methods"),
258
+ handlers: z.array(z.string()).optional().describe("Explicit paths to custom cleanup handler files"),
267
259
  discover: workflowCleanupDiscoverSchema
268
- }).passthrough();
260
+ }).passthrough().describe("Resource cleanup configuration");
269
261
  var workflowWebServerSchema = z.object({
270
- command: nonEmptyString2.optional(),
271
- auto: z.boolean().optional(),
272
- url: nonEmptyString2.url(),
273
- reuseExistingServer: z.boolean().default(true),
274
- timeout: z.number().int().positive().default(3e4)
275
- });
262
+ command: nonEmptyString2.optional().describe("Command to start the web server"),
263
+ auto: z.boolean().optional().describe("Auto-detect server start command from package.json"),
264
+ url: nonEmptyString2.url().describe("URL to wait for before starting tests"),
265
+ reuseExistingServer: z.boolean().default(true).describe("Use existing server if already running at the URL"),
266
+ timeout: z.number().int().positive().default(3e4).describe("Timeout in milliseconds to wait for server to start")
267
+ }).describe("Configuration for starting a web server before tests");
276
268
  var workflowConfigSchema = z.object({
277
269
  web: workflowWebConfigSchema.optional(),
278
270
  appwrite: workflowAppwriteConfigSchema.optional(),
279
271
  cleanup: workflowCleanupConfigSchema.optional(),
280
272
  webServer: workflowWebServerSchema.optional()
281
- });
273
+ }).describe("Workflow-level configuration that applies to all tests");
282
274
  var WorkflowDefinitionSchema = z.object({
283
- name: nonEmptyString2,
284
- platform: z.enum(["web", "android", "ios"]).default("web"),
275
+ name: nonEmptyString2.describe("The name of the workflow"),
276
+ platform: z.enum(["web", "android", "ios"]).default("web").describe("The platform to run the workflow on"),
285
277
  config: workflowConfigSchema.optional(),
286
- continueOnFailure: z.boolean().default(false),
287
- tests: z.array(testReferenceSchema).min(1, "Workflow must contain at least one test")
288
- });
278
+ continueOnFailure: z.boolean().default(false).describe("Continue running subsequent tests even if a test fails"),
279
+ tests: z.array(testReferenceSchema).min(1, "Workflow must contain at least one test").describe("List of test files to execute in this workflow")
280
+ }).describe("Schema for IntelliTester workflow files that orchestrate multiple tests");
289
281
  var nonEmptyString3 = z.string().trim().min(1, "Value cannot be empty");
290
282
  var workflowReferenceSchema = z.object({
291
- file: nonEmptyString3,
292
- id: nonEmptyString3.optional(),
293
- depends_on: z.array(nonEmptyString3).optional(),
294
- on_failure: z.enum(["skip", "fail", "ignore"]).optional(),
295
- variables: z.record(z.string(), z.string()).optional()
296
- });
283
+ file: nonEmptyString3.describe("Path to the workflow file"),
284
+ id: nonEmptyString3.optional().describe("Optional ID for referencing this workflow in dependencies"),
285
+ depends_on: z.array(nonEmptyString3).optional().describe("IDs of workflows that must complete before this one"),
286
+ on_failure: z.enum(["skip", "fail", "ignore"]).optional().describe("How to handle failure of this workflow"),
287
+ variables: z.record(z.string(), z.string()).optional().describe("Variables to inject or override for this workflow")
288
+ }).describe("Reference to a workflow file");
297
289
  var pipelineWebConfigSchema = z.object({
298
- baseUrl: nonEmptyString3.url().optional(),
299
- browser: z.enum(["chromium", "firefox", "webkit"]).optional(),
300
- headless: z.boolean().optional()
301
- });
290
+ baseUrl: nonEmptyString3.url().optional().describe("Base URL for all workflows in this pipeline"),
291
+ browser: z.enum(["chromium", "firefox", "webkit"]).optional().describe("Browser to use for all web tests"),
292
+ headless: z.boolean().optional().describe("Run browser in headless mode")
293
+ }).describe("Web platform configuration for the pipeline");
302
294
  var pipelineAppwriteConfigSchema = z.object({
303
- endpoint: nonEmptyString3.url(),
304
- projectId: nonEmptyString3,
305
- apiKey: nonEmptyString3,
306
- cleanup: z.boolean().default(true),
307
- cleanupOnFailure: z.boolean().default(true)
308
- });
295
+ endpoint: nonEmptyString3.url().describe("Appwrite API endpoint"),
296
+ projectId: nonEmptyString3.describe("Appwrite project ID"),
297
+ apiKey: nonEmptyString3.describe("Appwrite API key"),
298
+ cleanup: z.boolean().default(true).describe("Enable automatic cleanup of created resources"),
299
+ cleanupOnFailure: z.boolean().default(true).describe("Clean up resources even when workflows fail")
300
+ }).describe("Appwrite backend configuration for the pipeline");
309
301
  var pipelineCleanupDiscoverSchema = z.object({
310
- enabled: z.boolean().default(true),
311
- paths: z.array(z.string()).default(["./tests/cleanup"]),
312
- pattern: z.string().default("**/*.ts")
313
- }).optional();
302
+ enabled: z.boolean().default(true).describe("Enable auto-discovery of cleanup handlers"),
303
+ paths: z.array(z.string()).default(["./tests/cleanup"]).describe("Directories to search for cleanup handlers"),
304
+ pattern: z.string().default("**/*.ts").describe("Glob pattern for handler files")
305
+ }).optional().describe("Auto-discovery configuration for cleanup handlers");
314
306
  var pipelineCleanupConfigSchema = z.object({
315
- provider: z.string().optional(),
316
- parallel: z.boolean().default(false),
317
- retries: z.number().min(1).max(10).default(3),
318
- types: z.record(z.string(), z.string()).optional(),
319
- handlers: z.array(z.string()).optional(),
307
+ provider: z.string().optional().describe("Cleanup provider to use"),
308
+ parallel: z.boolean().default(false).describe("Run cleanup tasks in parallel"),
309
+ retries: z.number().min(1).max(10).default(3).describe("Number of retry attempts for failed cleanup operations"),
310
+ types: z.record(z.string(), z.string()).optional().describe("Map resource types to cleanup handler methods"),
311
+ handlers: z.array(z.string()).optional().describe("Explicit paths to custom cleanup handler files"),
320
312
  discover: pipelineCleanupDiscoverSchema,
321
- on_failure: z.boolean().default(true)
322
- // Run cleanup even if pipeline fails
323
- }).passthrough();
313
+ on_failure: z.boolean().default(true).describe("Run cleanup even if pipeline fails")
314
+ }).passthrough().describe("Resource cleanup configuration");
324
315
  var pipelineWebServerSchema = z.object({
325
- command: nonEmptyString3.optional(),
326
- auto: z.boolean().optional(),
327
- url: nonEmptyString3.url(),
328
- reuseExistingServer: z.boolean().default(true),
329
- timeout: z.number().int().positive().default(3e4)
330
- });
316
+ command: nonEmptyString3.optional().describe("Command to start the web server"),
317
+ auto: z.boolean().optional().describe("Auto-detect server start command from package.json"),
318
+ url: nonEmptyString3.url().describe("URL to wait for before starting workflows"),
319
+ reuseExistingServer: z.boolean().default(true).describe("Use existing server if already running at the URL"),
320
+ timeout: z.number().int().positive().default(3e4).describe("Timeout in milliseconds to wait for server to start")
321
+ }).describe("Configuration for starting a web server before workflows");
331
322
  var pipelineConfigSchema = z.object({
332
323
  web: pipelineWebConfigSchema.optional(),
333
324
  appwrite: pipelineAppwriteConfigSchema.optional(),
334
325
  cleanup: pipelineCleanupConfigSchema.optional(),
335
326
  webServer: pipelineWebServerSchema.optional()
336
- });
327
+ }).describe("Pipeline-level configuration that applies to all workflows");
337
328
  var PipelineDefinitionSchema = z.object({
338
- name: nonEmptyString3,
339
- platform: z.enum(["web", "android", "ios"]).default("web"),
329
+ name: nonEmptyString3.describe("The name of the pipeline"),
330
+ platform: z.enum(["web", "android", "ios"]).default("web").describe("The platform to run the pipeline on"),
340
331
  config: pipelineConfigSchema.optional(),
341
- on_failure: z.enum(["skip", "fail", "ignore"]).default("skip"),
342
- cleanup_on_failure: z.boolean().default(true),
343
- workflows: z.array(workflowReferenceSchema).min(1, "Pipeline must contain at least one workflow")
344
- });
332
+ on_failure: z.enum(["skip", "fail", "ignore"]).default("skip").describe("Default failure handling for workflows"),
333
+ cleanup_on_failure: z.boolean().default(true).describe("Run cleanup even when pipeline fails"),
334
+ workflows: z.array(workflowReferenceSchema).min(1, "Pipeline must contain at least one workflow").describe("List of workflow files to execute in this pipeline")
335
+ }).describe("Schema for IntelliTester pipeline files that orchestrate multiple workflows");
345
336
 
346
337
  // src/core/loader.ts
347
338
  var formatIssues = (issues) => issues.map((issue) => {
@@ -1798,7 +1789,7 @@ function interpolateWorkflowVariables(value, currentVariables, testResults) {
1798
1789
  return currentVariables.get(path3) ?? match;
1799
1790
  });
1800
1791
  }
1801
- async function runTestInWorkflow(test, page, context, options, _workflowDir) {
1792
+ async function runTestInWorkflow(test, page, context, options, _workflowDir, workflowBaseUrl) {
1802
1793
  const results = [];
1803
1794
  const debugMode = options.debug ?? false;
1804
1795
  const screenshotDir = defaultScreenshotDir2;
@@ -1841,7 +1832,8 @@ async function runTestInWorkflow(test, page, context, options, _workflowDir) {
1841
1832
  switch (action.type) {
1842
1833
  case "navigate": {
1843
1834
  const interpolated = interpolateVariables2(action.value);
1844
- const target = resolveUrl2(interpolated, test.config?.web?.baseUrl);
1835
+ const baseUrl = test.config?.web?.baseUrl ?? workflowBaseUrl;
1836
+ const target = resolveUrl2(interpolated, baseUrl);
1845
1837
  if (debugMode) console.log(` [DEBUG] Navigating to: ${target}`);
1846
1838
  await page.goto(target);
1847
1839
  break;
@@ -2238,7 +2230,7 @@ Starting workflow: ${workflow.name}`);
2238
2230
  executionContext.variables.set(key, interpolated);
2239
2231
  }
2240
2232
  }
2241
- const result = await runTestInWorkflow(test, page, executionContext, options, workflowDir);
2233
+ const result = await runTestInWorkflow(test, page, executionContext, options, workflowDir, workflow.config?.web?.baseUrl);
2242
2234
  const testResult = {
2243
2235
  id: testRef.id,
2244
2236
  file: testRef.file,
@@ -2540,5 +2532,5 @@ Collected ${serverResources.length} server-tracked resources`);
2540
2532
  }
2541
2533
 
2542
2534
  export { ActionSchema, IntellitesterConfigSchema, LocatorSchema, TestConfigSchema, TestDefinitionSchema, cleanupConfigSchema, cleanupDiscoverSchema, collectMissingEnvVars, createAIProvider, createTestContext, isPipelineContent, isPipelineFile, isWorkflowContent, isWorkflowFile, killServer, loadIntellitesterConfig, loadPipelineDefinition, loadTestDefinition, loadWorkflowDefinition, parseIntellitesterConfig, parsePipelineDefinition, parseTestDefinition, parseWorkflowDefinition, previewConfigSchema, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
2543
- //# sourceMappingURL=chunk-VOGZ7IFW.js.map
2544
- //# sourceMappingURL=chunk-VOGZ7IFW.js.map
2535
+ //# sourceMappingURL=chunk-BYSKHSJB.js.map
2536
+ //# sourceMappingURL=chunk-BYSKHSJB.js.map