qualyx 0.3.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 (100) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +523 -0
  3. package/dist/cli/commands/init.d.ts +6 -0
  4. package/dist/cli/commands/init.d.ts.map +1 -0
  5. package/dist/cli/commands/init.js +124 -0
  6. package/dist/cli/commands/init.js.map +1 -0
  7. package/dist/cli/commands/list.d.ts +3 -0
  8. package/dist/cli/commands/list.d.ts.map +1 -0
  9. package/dist/cli/commands/list.js +122 -0
  10. package/dist/cli/commands/list.js.map +1 -0
  11. package/dist/cli/commands/run.d.ts +12 -0
  12. package/dist/cli/commands/run.d.ts.map +1 -0
  13. package/dist/cli/commands/run.js +160 -0
  14. package/dist/cli/commands/run.js.map +1 -0
  15. package/dist/cli/commands/schedule.d.ts +19 -0
  16. package/dist/cli/commands/schedule.d.ts.map +1 -0
  17. package/dist/cli/commands/schedule.js +240 -0
  18. package/dist/cli/commands/schedule.js.map +1 -0
  19. package/dist/cli/commands/validate.d.ts +3 -0
  20. package/dist/cli/commands/validate.d.ts.map +1 -0
  21. package/dist/cli/commands/validate.js +47 -0
  22. package/dist/cli/commands/validate.js.map +1 -0
  23. package/dist/cli/index.d.ts +3 -0
  24. package/dist/cli/index.d.ts.map +1 -0
  25. package/dist/cli/index.js +194 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/core/claude-runner.d.ts +23 -0
  28. package/dist/core/claude-runner.d.ts.map +1 -0
  29. package/dist/core/claude-runner.js +196 -0
  30. package/dist/core/claude-runner.js.map +1 -0
  31. package/dist/core/config-loader.d.ts +137 -0
  32. package/dist/core/config-loader.d.ts.map +1 -0
  33. package/dist/core/config-loader.js +239 -0
  34. package/dist/core/config-loader.js.map +1 -0
  35. package/dist/core/executor.d.ts +75 -0
  36. package/dist/core/executor.d.ts.map +1 -0
  37. package/dist/core/executor.js +337 -0
  38. package/dist/core/executor.js.map +1 -0
  39. package/dist/core/index.d.ts +6 -0
  40. package/dist/core/index.d.ts.map +1 -0
  41. package/dist/core/index.js +7 -0
  42. package/dist/core/index.js.map +1 -0
  43. package/dist/core/prompt-builder.d.ts +24 -0
  44. package/dist/core/prompt-builder.d.ts.map +1 -0
  45. package/dist/core/prompt-builder.js +145 -0
  46. package/dist/core/prompt-builder.js.map +1 -0
  47. package/dist/core/retry-handler.d.ts +42 -0
  48. package/dist/core/retry-handler.d.ts.map +1 -0
  49. package/dist/core/retry-handler.js +126 -0
  50. package/dist/core/retry-handler.js.map +1 -0
  51. package/dist/index.d.ts +3 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +16 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/integrations/email.d.ts +38 -0
  56. package/dist/integrations/email.d.ts.map +1 -0
  57. package/dist/integrations/email.js +216 -0
  58. package/dist/integrations/email.js.map +1 -0
  59. package/dist/integrations/index.d.ts +5 -0
  60. package/dist/integrations/index.d.ts.map +1 -0
  61. package/dist/integrations/index.js +5 -0
  62. package/dist/integrations/index.js.map +1 -0
  63. package/dist/integrations/jira.d.ts +68 -0
  64. package/dist/integrations/jira.d.ts.map +1 -0
  65. package/dist/integrations/jira.js +288 -0
  66. package/dist/integrations/jira.js.map +1 -0
  67. package/dist/integrations/slack.d.ts +66 -0
  68. package/dist/integrations/slack.d.ts.map +1 -0
  69. package/dist/integrations/slack.js +192 -0
  70. package/dist/integrations/slack.js.map +1 -0
  71. package/dist/integrations/teams.d.ts +72 -0
  72. package/dist/integrations/teams.d.ts.map +1 -0
  73. package/dist/integrations/teams.js +197 -0
  74. package/dist/integrations/teams.js.map +1 -0
  75. package/dist/reporters/console.d.ts +83 -0
  76. package/dist/reporters/console.d.ts.map +1 -0
  77. package/dist/reporters/console.js +299 -0
  78. package/dist/reporters/console.js.map +1 -0
  79. package/dist/reporters/html.d.ts +29 -0
  80. package/dist/reporters/html.d.ts.map +1 -0
  81. package/dist/reporters/html.js +105 -0
  82. package/dist/reporters/html.js.map +1 -0
  83. package/dist/storage/results.d.ts +61 -0
  84. package/dist/storage/results.d.ts.map +1 -0
  85. package/dist/storage/results.js +111 -0
  86. package/dist/storage/results.js.map +1 -0
  87. package/dist/storage/sqlite.d.ts +70 -0
  88. package/dist/storage/sqlite.d.ts.map +1 -0
  89. package/dist/storage/sqlite.js +240 -0
  90. package/dist/storage/sqlite.js.map +1 -0
  91. package/dist/types/index.d.ts +1239 -0
  92. package/dist/types/index.d.ts.map +1 -0
  93. package/dist/types/index.js +105 -0
  94. package/dist/types/index.js.map +1 -0
  95. package/package.json +75 -0
  96. package/templates/crontab.hbs +24 -0
  97. package/templates/github-schedule.yml.hbs +153 -0
  98. package/templates/prompt.md.hbs +147 -0
  99. package/templates/report.html.hbs +423 -0
  100. package/templates/slack-message.json.hbs +93 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Koray Uysal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,523 @@
1
+ # Qualyx
2
+
3
+ [![npm version](https://img.shields.io/npm/v/qualyx.svg)](https://www.npmjs.com/package/qualyx)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js Version](https://img.shields.io/node/v/qualyx.svg)](https://nodejs.org)
6
+
7
+ **AI-powered QA automation that understands your app like a human does.**
8
+
9
+ Write tests in plain English. No selectors, no fragile locators, no maintenance headaches. Qualyx uses Claude AI to intelligently navigate and test your web applications.
10
+
11
+ ```yaml
12
+ rules:
13
+ - id: checkout-flow
14
+ name: Complete purchase flow
15
+ steps:
16
+ - Add a product to the cart
17
+ - Go to checkout
18
+ - Fill in shipping details
19
+ - Complete the payment
20
+ validations:
21
+ - Order confirmation is displayed
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Overview
27
+
28
+ Qualyx allows you to define tests in natural language YAML, which are then executed by Claude Code CLI using Playwright for browser automation. This enables writing tests that are:
29
+
30
+ - **Human-readable** - Tests are written in plain English
31
+ - **Resilient** - AI adapts to UI changes without brittle selectors
32
+ - **Comprehensive** - Complex user flows are easy to describe
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ npm install -g qualyx
38
+ ```
39
+
40
+ **Requirements:**
41
+ - Node.js 18+
42
+ - Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
43
+
44
+ ## Quick Start
45
+
46
+ 1. **Initialize a configuration file:**
47
+
48
+ ```bash
49
+ qualyx init
50
+ ```
51
+
52
+ 2. **Edit `qualyx.yml`** to configure your apps and tests
53
+
54
+ 3. **Validate your configuration:**
55
+
56
+ ```bash
57
+ qualyx validate
58
+ ```
59
+
60
+ 4. **Run tests:**
61
+
62
+ ```bash
63
+ qualyx run
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ Tests are defined in `qualyx.yml`:
69
+
70
+ ```yaml
71
+ organization:
72
+ name: My Company
73
+ defaults:
74
+ timeout: 30000
75
+ retries: 2
76
+
77
+ apps:
78
+ - name: my-app
79
+ url: https://myapp.com
80
+ auth:
81
+ type: form-login
82
+ credentials:
83
+ email: ${TEST_USER_EMAIL}
84
+ password: ${TEST_USER_PASSWORD}
85
+
86
+ rules:
87
+ - id: user-login
88
+ name: User can login
89
+ severity: critical
90
+ steps:
91
+ - Navigate to login page
92
+ - Enter email and password
93
+ - Click login button
94
+ - Wait for dashboard to load
95
+ validations:
96
+ - User name is displayed in header
97
+ - Dashboard shows welcome message
98
+ ```
99
+
100
+ ### Configuration Options
101
+
102
+ #### Organization
103
+
104
+ | Field | Description | Default |
105
+ |-------|-------------|---------|
106
+ | `name` | Organization name | Required |
107
+ | `defaults.timeout` | Default timeout (ms) | 30000 |
108
+ | `defaults.retries` | Default retry count | 2 |
109
+
110
+ #### Apps
111
+
112
+ | Field | Description |
113
+ |-------|-------------|
114
+ | `name` | App identifier |
115
+ | `url` | Base URL |
116
+ | `environments` | Named URL mappings |
117
+ | `auth` | Authentication config |
118
+ | `screenshots` | Screenshot capture settings |
119
+ | `setup` | Setup steps run once before rules |
120
+ | `rules` | Test rules array |
121
+
122
+ #### Rules
123
+
124
+ | Field | Description |
125
+ |-------|-------------|
126
+ | `id` | Unique identifier |
127
+ | `name` | Human-readable name |
128
+ | `severity` | critical, high, medium, low |
129
+ | `timeout` | Override default timeout |
130
+ | `steps` | Test steps (strings or objects) |
131
+ | `validations` | Expected outcomes |
132
+ | `on_failure` | Actions on failure |
133
+ | `test_data` | Dynamic test data |
134
+ | `schedule` | Cron expression for scheduled runs |
135
+ | `skip_setup` | Skip app setup for this rule |
136
+
137
+ ### Step Syntax
138
+
139
+ Steps can be simple strings:
140
+
141
+ ```yaml
142
+ steps:
143
+ - Navigate to the homepage
144
+ - Click the login button
145
+ ```
146
+
147
+ Or objects with hints:
148
+
149
+ ```yaml
150
+ steps:
151
+ - action: Fill payment form
152
+ hint: Use test card 4242424242424242
153
+ caution: Do NOT click submit
154
+ ```
155
+
156
+ ### Setup Blocks
157
+
158
+ Setup steps run once per app before any rules execute:
159
+
160
+ ```yaml
161
+ apps:
162
+ - name: my-app
163
+ url: https://myapp.com
164
+ setup:
165
+ - Login to the application
166
+ - Navigate to dashboard
167
+ rules:
168
+ - id: test-1
169
+ name: Test dashboard features
170
+ skip_setup: false # Default: use setup
171
+ steps:
172
+ - Check dashboard widgets
173
+ ```
174
+
175
+ ### Screenshot Configuration
176
+
177
+ Configure screenshot capture:
178
+
179
+ ```yaml
180
+ apps:
181
+ - name: my-app
182
+ screenshots:
183
+ on_failure: true # Capture on failure (default)
184
+ on_success: false # Capture on success
185
+ each_step: false # Capture after each step
186
+ ```
187
+
188
+ ### Scheduling
189
+
190
+ Schedule tests with cron expressions:
191
+
192
+ ```yaml
193
+ rules:
194
+ - id: health-check
195
+ name: Health Check
196
+ schedule: "*/30 * * * *" # Every 30 minutes
197
+ steps:
198
+ - Verify homepage loads
199
+
200
+ - id: daily-smoke
201
+ name: Daily Smoke Test
202
+ schedule: "0 7 * * *" # Daily at 7 AM
203
+ ```
204
+
205
+ ### Environment Variables
206
+
207
+ Credentials use `${VAR_NAME}` syntax:
208
+
209
+ ```yaml
210
+ credentials:
211
+ email: ${TEST_USER_EMAIL}
212
+ password: ${TEST_USER_PASSWORD}
213
+ ```
214
+
215
+ Set these in your environment or CI/CD pipeline.
216
+
217
+ ## CLI Commands
218
+
219
+ ### `qualyx init`
220
+
221
+ Create a starter configuration file.
222
+
223
+ ```bash
224
+ qualyx init
225
+ qualyx init --force # Overwrite existing
226
+ ```
227
+
228
+ ### `qualyx validate`
229
+
230
+ Validate configuration syntax.
231
+
232
+ ```bash
233
+ qualyx validate
234
+ qualyx validate --config path/to/config.yml
235
+ qualyx validate --strict # Warnings as errors
236
+ ```
237
+
238
+ ### `qualyx list`
239
+
240
+ List configured apps and rules.
241
+
242
+ ```bash
243
+ qualyx list # Show all
244
+ qualyx list apps # Apps only
245
+ qualyx list rules # Rules only
246
+ qualyx list --format json
247
+ ```
248
+
249
+ ### `qualyx run`
250
+
251
+ Execute tests.
252
+
253
+ ```bash
254
+ qualyx run # Run all tests
255
+ qualyx run --app my-app # Filter by app
256
+ qualyx run --rule user-login # Filter by rule
257
+ qualyx run --environment staging # Use staging URLs
258
+ qualyx run --dry-run # Preview without execution
259
+ qualyx run --headed # Show browser
260
+ qualyx run --verbose # Detailed output
261
+ qualyx run --report # Generate HTML report
262
+ qualyx run --retries 3 # Override retry count
263
+ qualyx run --timeout 60000 # Override timeout
264
+ qualyx run --parallel # Run tests in parallel
265
+ qualyx run --max-parallel 5 # Limit concurrent tests
266
+ qualyx run --collect-metrics # Collect performance metrics
267
+ ```
268
+
269
+ ### `qualyx report`
270
+
271
+ View or regenerate test reports.
272
+
273
+ ```bash
274
+ qualyx report
275
+ qualyx report --run-id abc123
276
+ ```
277
+
278
+ ### `qualyx history`
279
+
280
+ View test run history.
281
+
282
+ ```bash
283
+ qualyx history
284
+ qualyx history --limit 20
285
+ qualyx history --failed
286
+ qualyx history --format json
287
+ ```
288
+
289
+ ### `qualyx schedule`
290
+
291
+ Manage scheduled test rules.
292
+
293
+ ```bash
294
+ qualyx schedule list # List all scheduled rules
295
+ qualyx schedule cron # Generate crontab entries
296
+ qualyx schedule cron --output crontab.txt
297
+ qualyx schedule github # Generate GitHub Actions workflow
298
+ qualyx schedule github --output .github/workflows/qualyx.yml
299
+ ```
300
+
301
+ ## Integrations
302
+
303
+ ### Slack Notifications
304
+
305
+ Send test results to Slack:
306
+
307
+ ```yaml
308
+ notifications:
309
+ slack:
310
+ webhook_url: ${SLACK_WEBHOOK_URL}
311
+ on_failure: true
312
+ on_success: false
313
+ mention_on_failure:
314
+ - U123456789 # Slack user IDs
315
+ ```
316
+
317
+ ### Email Notifications
318
+
319
+ Send test results via email:
320
+
321
+ ```yaml
322
+ notifications:
323
+ email:
324
+ smtp_host: smtp.gmail.com
325
+ smtp_port: 587
326
+ smtp_secure: false
327
+ smtp_user: ${SMTP_USER}
328
+ smtp_pass: ${SMTP_PASS}
329
+ from: qa@company.com
330
+ to:
331
+ - team@company.com
332
+ - alerts@company.com
333
+ on_failure: true
334
+ on_success: false
335
+ subject_prefix: "[Qualyx]"
336
+ ```
337
+
338
+ Features:
339
+ - HTML and plain text email formats
340
+ - Configurable triggers (on_failure, on_success)
341
+ - Customizable subject prefix
342
+ - Link to HTML report (if generated)
343
+
344
+ ### Microsoft Teams Notifications
345
+
346
+ Send test results to Microsoft Teams:
347
+
348
+ ```yaml
349
+ notifications:
350
+ teams:
351
+ webhook_url: ${TEAMS_WEBHOOK_URL}
352
+ on_failure: true
353
+ on_success: false
354
+ mention_on_failure:
355
+ - user@company.com
356
+ ```
357
+
358
+ Features:
359
+ - Rich Adaptive Card messages
360
+ - User mentions on failure
361
+ - Summary with pass/fail counts
362
+ - Link to HTML report
363
+
364
+ ### Jira Integration
365
+
366
+ Automatically create issues for failed tests:
367
+
368
+ ```yaml
369
+ integrations:
370
+ jira:
371
+ base_url: https://company.atlassian.net
372
+ email: ${JIRA_EMAIL}
373
+ api_token: ${JIRA_API_TOKEN}
374
+ project_key: QA
375
+ create_issues: true
376
+ issue_type: Bug
377
+ labels:
378
+ - qualyx
379
+ - automated-test
380
+ ```
381
+
382
+ Features:
383
+ - Creates issues on test failures
384
+ - Prevents duplicate issues (checks for existing open issues)
385
+ - Adds comments to existing issues on re-failure
386
+
387
+ ## Parallel Execution
388
+
389
+ Run tests in parallel to speed up test suites:
390
+
391
+ ```bash
392
+ qualyx run --parallel # Run tests in parallel (default: 3 concurrent)
393
+ qualyx run --parallel --max-parallel 5 # Limit to 5 concurrent tests
394
+ ```
395
+
396
+ Notes:
397
+ - Setup blocks run sequentially before parallel test execution
398
+ - Results are ordered in original test order
399
+ - Useful for independent tests that don't share state
400
+
401
+ ## Performance Metrics
402
+
403
+ Collect performance metrics during test execution:
404
+
405
+ ```bash
406
+ qualyx run --collect-metrics
407
+ ```
408
+
409
+ Metrics collected:
410
+ - **Page Load Time** - Time from navigation start to load event
411
+ - **DOM Content Loaded** - Time until DOM is fully parsed
412
+ - **First Contentful Paint (FCP)** - Time until first content renders
413
+ - **Largest Contentful Paint (LCP)** - Time until largest content element renders
414
+ - **Total Request Count** - Number of network requests
415
+ - **Total Transfer Size** - Total bytes transferred
416
+
417
+ ## Output
418
+
419
+ ### Console Output
420
+
421
+ ```
422
+ Qualyx Test Runner
423
+ Running 4 tests...
424
+
425
+ ✓ flight-booking / Search for flights CRITICAL (2.3s)
426
+ ✓ flight-booking / Filter by price HIGH (1.8s)
427
+ ✗ flight-booking / Complete booking CRITICAL (5.2s)
428
+ Error: Payment form did not appear
429
+ ✓ hotel-booking / Search for hotels CRITICAL (2.1s)
430
+
431
+ Summary
432
+ ────────────────────────────────────────
433
+ Total: 4
434
+ Passed: 3
435
+ Failed: 1
436
+ Duration: 11.4s
437
+ Pass Rate: 75.0%
438
+
439
+ ✗ 1 test failed
440
+ ```
441
+
442
+ ### HTML Reports
443
+
444
+ Generate visual reports with `--report`:
445
+
446
+ ```bash
447
+ qualyx run --report
448
+ ```
449
+
450
+ Reports are saved to `./qualyx-reports/`.
451
+
452
+ ## GitHub Actions Integration
453
+
454
+ ```yaml
455
+ name: QA Tests
456
+
457
+ on:
458
+ push:
459
+ branches: [main]
460
+ schedule:
461
+ - cron: '0 */6 * * *' # Every 6 hours
462
+
463
+ jobs:
464
+ test:
465
+ runs-on: ubuntu-latest
466
+ steps:
467
+ - uses: actions/checkout@v4
468
+
469
+ - uses: actions/setup-node@v4
470
+ with:
471
+ node-version: '20'
472
+
473
+ - name: Install dependencies
474
+ run: |
475
+ npm install -g qualyx @anthropic-ai/claude-code
476
+
477
+ - name: Run QA tests
478
+ env:
479
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
480
+ TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }}
481
+ TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
482
+ run: qualyx run --report
483
+
484
+ - name: Upload report
485
+ uses: actions/upload-artifact@v4
486
+ if: always()
487
+ with:
488
+ name: qa-report
489
+ path: qualyx-reports/
490
+ ```
491
+
492
+ ## Cost Considerations
493
+
494
+ Each test execution uses Claude API calls. To manage costs:
495
+
496
+ 1. Use `--dry-run` to preview tests
497
+ 2. Run critical tests more frequently
498
+ 3. Run full suite less frequently (e.g., nightly)
499
+ 4. Group related assertions in single rules
500
+
501
+ ## Development
502
+
503
+ ```bash
504
+ # Clone the repository
505
+ git clone https://github.com/korayuysal/qualyx.git
506
+ cd qualyx
507
+
508
+ # Install dependencies
509
+ npm install
510
+
511
+ # Run in development mode
512
+ npm run dev -- run --dry-run
513
+
514
+ # Build
515
+ npm run build
516
+
517
+ # Run tests
518
+ npm test
519
+ ```
520
+
521
+ ## License
522
+
523
+ MIT
@@ -0,0 +1,6 @@
1
+ export interface InitOptions {
2
+ force?: boolean;
3
+ path?: string;
4
+ }
5
+ export declare function runInit(options?: InitOptions): Promise<void>;
6
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAuGA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtE"}
@@ -0,0 +1,124 @@
1
+ import { writeFileSync, existsSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import chalk from 'chalk';
4
+ const STARTER_CONFIG = `# Qualyx Configuration
5
+ # Documentation: https://github.com/korayuysal/qualyx
6
+
7
+ organization:
8
+ name: My Organization
9
+ defaults:
10
+ timeout: 30000
11
+ retries: 2
12
+
13
+ apps:
14
+ - name: my-app
15
+ url: https://example.com
16
+ environments:
17
+ production: https://example.com
18
+ staging: https://staging.example.com
19
+
20
+ # Optional authentication configuration
21
+ # auth:
22
+ # type: form-login
23
+ # credentials:
24
+ # email: \${TEST_USER_EMAIL}
25
+ # password: \${TEST_USER_PASSWORD}
26
+
27
+ # Optional screenshot settings
28
+ # screenshots:
29
+ # on_failure: true
30
+ # on_success: false
31
+ # each_step: false
32
+
33
+ # Optional setup steps (run once per app before rules)
34
+ # setup:
35
+ # - Login to the application
36
+ # - Navigate to dashboard
37
+
38
+ rules:
39
+ - id: homepage-loads
40
+ name: Homepage loads successfully
41
+ severity: critical
42
+ steps:
43
+ - Navigate to the homepage
44
+ - Verify the page loads without errors
45
+ validations:
46
+ - Page title is visible
47
+ - No console errors appear
48
+
49
+ - id: navigation-works
50
+ name: Main navigation is functional
51
+ severity: high
52
+ # Optional: schedule this test to run automatically
53
+ # schedule: "0 7 * * *" # Daily at 7 AM (cron syntax)
54
+ steps:
55
+ - Navigate to the homepage
56
+ - Click on the main navigation menu
57
+ - Verify navigation links are visible
58
+ validations:
59
+ - Navigation menu is displayed
60
+ - Links are clickable
61
+
62
+ # Example of a more complex test with hints
63
+ # - id: user-login
64
+ # name: User can log in
65
+ # severity: critical
66
+ # schedule: "*/30 * * * *" # Every 30 minutes
67
+ # skip_setup: false # Set to true to skip app setup for this rule
68
+ # steps:
69
+ # - Navigate to the login page
70
+ # - action: Enter email address
71
+ # hint: Use the email field, typically an input with type="email"
72
+ # - action: Enter password
73
+ # hint: Use the password field
74
+ # - Click the login button
75
+ # - Wait for redirect to dashboard
76
+ # validations:
77
+ # - User is redirected to dashboard
78
+ # - User name is displayed in header
79
+
80
+ # Optional: Slack notifications
81
+ # notifications:
82
+ # slack:
83
+ # webhook_url: \${SLACK_WEBHOOK_URL}
84
+ # on_failure: true
85
+ # on_success: false
86
+ # mention_on_failure:
87
+ # - U123456789 # Slack user IDs to mention on failure
88
+
89
+ # Optional: Jira integration for automatic issue creation
90
+ # integrations:
91
+ # jira:
92
+ # base_url: https://company.atlassian.net
93
+ # email: \${JIRA_EMAIL}
94
+ # api_token: \${JIRA_API_TOKEN}
95
+ # project_key: QA
96
+ # create_issues: true
97
+ # issue_type: Bug
98
+ # labels:
99
+ # - qualyx
100
+ # - automated-test
101
+ `;
102
+ export async function runInit(options = {}) {
103
+ const configPath = resolve(options.path || 'qualyx.yml');
104
+ // Check if file already exists
105
+ if (existsSync(configPath) && !options.force) {
106
+ console.log();
107
+ console.log(chalk.yellow(` Configuration file already exists: ${configPath}`));
108
+ console.log(chalk.gray(' Use --force to overwrite'));
109
+ console.log();
110
+ process.exit(1);
111
+ }
112
+ // Write the starter configuration
113
+ writeFileSync(configPath, STARTER_CONFIG, 'utf-8');
114
+ console.log();
115
+ console.log(chalk.green(` ✓ Created configuration file: ${configPath}`));
116
+ console.log();
117
+ console.log(chalk.gray(' Next steps:'));
118
+ console.log(chalk.gray(' 1. Edit qualyx.yml to configure your apps and tests'));
119
+ console.log(chalk.gray(' 2. Set environment variables for credentials'));
120
+ console.log(chalk.gray(' 3. Run `qualyx validate` to check your configuration'));
121
+ console.log(chalk.gray(' 4. Run `qualyx run` to execute tests'));
122
+ console.log();
123
+ }
124
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGtB,CAAC;AAOF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,UAAuB,EAAE;IACrD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,YAAY,CAAC,CAAC;IAEzD,+BAA+B;IAC/B,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAC7C,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wCAAwC,UAAU,EAAE,CAAC,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,kCAAkC;IAClC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAEnD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,mCAAmC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ListOptions } from '../../types/index.js';
2
+ export declare function runList(resource: 'apps' | 'rules' | undefined, configPath?: string, options?: ListOptions): Promise<void>;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,EACtC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA8Ef"}