qa360 2.0.11 → 2.0.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.
Files changed (42) hide show
  1. package/dist/commands/ai.js +26 -14
  2. package/dist/commands/ask.d.ts +75 -23
  3. package/dist/commands/ask.js +413 -265
  4. package/dist/commands/crawl.d.ts +24 -0
  5. package/dist/commands/crawl.js +121 -0
  6. package/dist/commands/history.js +38 -3
  7. package/dist/commands/init.d.ts +89 -95
  8. package/dist/commands/init.js +282 -200
  9. package/dist/commands/run.d.ts +1 -0
  10. package/dist/core/adapters/playwright-ui.d.ts +45 -7
  11. package/dist/core/adapters/playwright-ui.js +365 -59
  12. package/dist/core/assertions/engine.d.ts +51 -0
  13. package/dist/core/assertions/engine.js +530 -0
  14. package/dist/core/assertions/index.d.ts +11 -0
  15. package/dist/core/assertions/index.js +11 -0
  16. package/dist/core/assertions/types.d.ts +121 -0
  17. package/dist/core/assertions/types.js +37 -0
  18. package/dist/core/crawler/index.d.ts +57 -0
  19. package/dist/core/crawler/index.js +281 -0
  20. package/dist/core/crawler/journey-generator.d.ts +49 -0
  21. package/dist/core/crawler/journey-generator.js +412 -0
  22. package/dist/core/crawler/page-analyzer.d.ts +88 -0
  23. package/dist/core/crawler/page-analyzer.js +709 -0
  24. package/dist/core/crawler/selector-generator.d.ts +34 -0
  25. package/dist/core/crawler/selector-generator.js +240 -0
  26. package/dist/core/crawler/types.d.ts +353 -0
  27. package/dist/core/crawler/types.js +6 -0
  28. package/dist/core/generation/crawler-pack-generator.d.ts +44 -0
  29. package/dist/core/generation/crawler-pack-generator.js +231 -0
  30. package/dist/core/generation/index.d.ts +2 -0
  31. package/dist/core/generation/index.js +2 -0
  32. package/dist/core/index.d.ts +3 -0
  33. package/dist/core/index.js +4 -0
  34. package/dist/core/types/pack-v1.d.ts +90 -0
  35. package/dist/index.js +6 -2
  36. package/examples/accessibility.yml +39 -16
  37. package/examples/api-basic.yml +19 -14
  38. package/examples/complete.yml +134 -42
  39. package/examples/fullstack.yml +66 -31
  40. package/examples/security.yml +47 -15
  41. package/examples/ui-basic.yml +16 -12
  42. package/package.json +3 -2
@@ -1,54 +1,146 @@
1
1
  # QA360 Example: Complete Test Suite
2
2
  # All quality gates enabled - comprehensive quality assurance
3
3
 
4
- version: 1
4
+ version: 2
5
5
  name: complete-qa-suite
6
+ description: Comprehensive QA suite with all quality gates
6
7
 
7
8
  gates:
8
- - api_smoke # API health checks
9
- - ui # Browser E2E tests
10
- - a11y # Accessibility (WCAG)
11
- - perf # Performance testing
12
- - sast # Static security analysis
13
- - dast # Dynamic security testing
14
-
15
- targets:
16
- api:
17
- baseUrl: "https://api.example.com"
18
- smoke:
19
- - "GET /health -> 200"
20
- - "GET /status -> 200"
21
- - "POST /login -> 200"
22
-
23
- web:
24
- baseUrl: "https://example.com"
25
- pages:
26
- - "https://example.com"
27
- - "https://example.com/dashboard"
28
-
29
- # Quality budgets
30
- budgets:
31
- perf_p95_ms: 2000 # P95 latency budget
32
- a11y_min: 90 # Minimum accessibility score
33
-
34
- # Security thresholds
35
- security:
36
- sast_max_high: 3 # Maximum high-severity SAST findings
37
- secrets_leak: 0 # Must be zero
38
-
39
- # Docker Compose integration (optional - remove if not using Docker)
9
+ api-health:
10
+ adapter: playwright-api
11
+ enabled: true
12
+ config:
13
+ baseUrl: "https://api.example.com"
14
+ smoke:
15
+ - "GET /health -> 200"
16
+ - "GET /status -> 200"
17
+ - "POST /login -> 200"
18
+
19
+ api-crud:
20
+ adapter: playwright-api
21
+ enabled: true
22
+ config:
23
+ baseUrl: "https://api.example.com"
24
+ smoke:
25
+ - "GET /api/v1/users -> 200"
26
+ - "POST /api/v1/users -> 201"
27
+ - "PUT /api/v1/users/1 -> 200"
28
+ - "DELETE /api/v1/users/1 -> 204"
29
+ budgets:
30
+ p95_ms: 1000
31
+
32
+ ui-smoke:
33
+ adapter: playwright-ui
34
+ enabled: true
35
+ config:
36
+ baseUrl: "https://example.com"
37
+ pages:
38
+ - url: "/"
39
+ expectedElements: ["body", "main"]
40
+ - url: "/dashboard"
41
+ expectedElements: ["body", ".dashboard"]
42
+
43
+ a11y:
44
+ adapter: playwright-ui
45
+ enabled: true
46
+ config:
47
+ baseUrl: "https://example.com"
48
+ pages:
49
+ - url: "/"
50
+ a11yRules:
51
+ - wcag2a
52
+ - wcag2aa
53
+ budgets:
54
+ violations: 10
55
+ a11y_score: 90
56
+
57
+ perf:
58
+ adapter: k6-perf
59
+ enabled: true
60
+ config:
61
+ script: |
62
+ import http from 'k6/http';
63
+ import { check } from 'k6';
64
+
65
+ export const options = {
66
+ stages: [
67
+ { duration: '10s', target: 10 },
68
+ { duration: '20s', target: 50 },
69
+ { duration: '10s', target: 0 },
70
+ ],
71
+ };
72
+
73
+ export default function () {
74
+ const res = http.get('https://api.example.com/health');
75
+ check(res, {
76
+ 'status is 200': (r) => r.status === 200,
77
+ 'response time < 500ms': (r) => r.timings.duration < 500,
78
+ });
79
+ }
80
+ budgets:
81
+ p95_ms: 2000
82
+ p99_ms: 5000
83
+
84
+ sast:
85
+ adapter: semgrep-sast
86
+ enabled: true
87
+ config:
88
+ rules:
89
+ - security
90
+ - owasp-top-10
91
+ paths:
92
+ - src/
93
+ - lib/
94
+ budgets:
95
+ high_findings: 3
96
+ medium_findings: 10
97
+
98
+ dast:
99
+ adapter: zap-dast
100
+ enabled: true
101
+ config:
102
+ target: api
103
+ profile: baseline
104
+ url: "https://api.example.com"
105
+ scanType: baseline
106
+ budgets:
107
+ high_findings: 5
108
+ medium_findings: 20
109
+
110
+ secrets:
111
+ adapter: gitleaks-secrets
112
+ enabled: true
113
+ config:
114
+ paths:
115
+ - .
116
+ - src/
117
+ - config/
118
+ budgets:
119
+ critical_findings: 0
120
+
121
+ execution:
122
+ default_timeout: 120000
123
+ default_retries: 2
124
+ on_failure: continue
125
+ parallel: true
126
+ max_concurrency: 3
127
+
128
+ # Optional: Docker Compose integration (uncomment if using Docker)
40
129
  # hooks:
41
130
  # beforeAll:
42
- # - run: "docker compose up -d"
43
- # timeout: 30000
44
- # - run: "npx wait-on http://localhost:3000"
131
+ # - type: docker
132
+ # compose:
133
+ # file: docker-compose.yml
134
+ # command: up -d
45
135
  # timeout: 30000
136
+ # - type: wait_on
137
+ # wait_for:
138
+ # resource: http://localhost:3000
139
+ # timeout: 30000
46
140
  #
47
141
  # afterAll:
48
- # - run: "docker compose down"
142
+ # - type: docker
143
+ # compose:
144
+ # file: docker-compose.yml
145
+ # command: down
49
146
  # timeout: 30000
50
-
51
- # Execution settings
52
- execution:
53
- timeout: 120000 # 2 minutes
54
- max_retries: 2
@@ -1,43 +1,78 @@
1
1
  # QA360 Example: Full Stack
2
2
  # Complete testing suite with API, UI, and Performance
3
3
 
4
- version: 1
4
+ version: 2
5
5
  name: fullstack-tests
6
+ description: Full stack testing with API, UI and performance gates
6
7
 
7
8
  gates:
8
- - api_smoke
9
- - ui
10
- - perf
11
-
12
- targets:
13
- api:
14
- baseUrl: "https://httpbin.org"
15
- smoke:
16
- - "GET /status/200 -> 200"
17
- - "GET /json -> 200"
18
- - "POST /post -> 200"
19
-
20
- web:
21
- baseUrl: "https://example.com"
22
- pages:
23
- - "https://example.com"
24
-
25
- # Performance budgets
26
- budgets:
27
- perf_p95_ms: 2000 # P95 latency must be < 2000ms
28
-
29
- # Hooks for local development (optional - remove if not using Docker)
9
+ api-health:
10
+ adapter: playwright-api
11
+ enabled: true
12
+ config:
13
+ baseUrl: "https://httpbin.org"
14
+ smoke:
15
+ - "GET /status/200 -> 200"
16
+ - "GET /json -> 200"
17
+ - "POST /post -> 200"
18
+
19
+ ui-smoke:
20
+ adapter: playwright-ui
21
+ enabled: true
22
+ config:
23
+ baseUrl: "https://example.com"
24
+ pages:
25
+ - url: "/"
26
+ expectedElements: ["body", "main"]
27
+
28
+ perf:
29
+ adapter: k6-perf
30
+ enabled: true
31
+ config:
32
+ script: |
33
+ import http from 'k6/http';
34
+ import { check } from 'k6';
35
+
36
+ export const options = {
37
+ stages: [
38
+ { duration: '10s', target: 10 },
39
+ { duration: '20s', target: 50 },
40
+ { duration: '10s', target: 0 },
41
+ ],
42
+ };
43
+
44
+ export default function () {
45
+ const res = http.get('https://httpbin.org/status/200');
46
+ check(res, {
47
+ 'status is 200': (r) => r.status === 200,
48
+ 'response time < 500ms': (r) => r.timings.duration < 500,
49
+ });
50
+ }
51
+ budgets:
52
+ p95_ms: 2000
53
+
54
+ execution:
55
+ default_timeout: 60000
56
+ default_retries: 2
57
+ on_failure: continue
58
+ parallel: true
59
+
60
+ # Optional: Docker Compose integration (uncomment if using Docker)
30
61
  # hooks:
31
62
  # beforeAll:
32
- # - run: "docker compose up -d"
33
- # timeout: 30000
34
- # - run: "npx wait-on http://localhost:3000"
63
+ # - type: docker
64
+ # compose:
65
+ # file: docker-compose.yml
66
+ # command: up -d
35
67
  # timeout: 30000
68
+ # - type: wait_on
69
+ # wait_for:
70
+ # resource: http://localhost:3000
71
+ # timeout: 30000
36
72
  #
37
73
  # afterAll:
38
- # - run: "docker compose down"
74
+ # - type: docker
75
+ # compose:
76
+ # file: docker-compose.yml
77
+ # command: down
39
78
  # timeout: 30000
40
-
41
- execution:
42
- timeout: 60000
43
- max_retries: 2
@@ -1,26 +1,58 @@
1
1
  # QA360 Example: Security Suite
2
2
  # Comprehensive security testing (SAST, DAST)
3
3
 
4
- version: 1
4
+ version: 2
5
5
  name: security-test-suite
6
+ description: Security testing with SAST and DAST scans
6
7
 
7
8
  gates:
8
- - sast # Static Application Security Testing
9
- - dast # Dynamic Application Security Testing
9
+ api-health:
10
+ adapter: playwright-api
11
+ enabled: true
12
+ config:
13
+ baseUrl: "https://api.example.com"
14
+ smoke:
15
+ - "GET /health -> 200"
10
16
 
11
- targets:
12
- api:
13
- baseUrl: "https://api.example.com"
17
+ sast:
18
+ adapter: semgrep-sast
19
+ enabled: true
20
+ config:
21
+ rules:
22
+ - security
23
+ - owasp-top-10
24
+ paths:
25
+ - src/
26
+ - lib/
27
+ budgets:
28
+ high_findings: 3
29
+ medium_findings: 10
14
30
 
15
- web:
16
- baseUrl: "https://example.com"
31
+ dast:
32
+ adapter: zap-dast
33
+ enabled: true
34
+ config:
35
+ target: api
36
+ profile: baseline
37
+ url: "https://api.example.com"
38
+ scanType: baseline
39
+ budgets:
40
+ high_findings: 5
41
+ medium_findings: 20
17
42
 
18
- # Security thresholds
19
- security:
20
- sast_max_high: 3 # Maximum high-severity SAST findings
21
- secrets_leak: 0 # Must be zero
43
+ secrets:
44
+ adapter: gitleaks-secrets
45
+ enabled: true
46
+ config:
47
+ paths:
48
+ - .
49
+ - src/
50
+ - config/
51
+ budgets:
52
+ critical_findings: 0
22
53
 
23
- # Execution settings
24
54
  execution:
25
- timeout: 120000 # Security scans can take longer
26
- max_retries: 1
55
+ default_timeout: 120000
56
+ default_retries: 1
57
+ on_failure: continue
58
+ parallel: false
@@ -1,20 +1,24 @@
1
1
  # QA360 Example: UI Basic
2
2
  # Basic UI/E2E browser tests
3
3
 
4
- version: 1
4
+ version: 2
5
5
  name: ui-browser-tests
6
+ description: Basic UI smoke tests for web applications
6
7
 
7
8
  gates:
8
- - ui
9
+ ui-smoke:
10
+ adapter: playwright-ui
11
+ enabled: true
12
+ config:
13
+ baseUrl: "https://example.com"
14
+ pages:
15
+ - url: "/"
16
+ expectedElements: ["body", "main"]
17
+ - url: "/about"
18
+ expectedElements: ["body"]
9
19
 
10
- targets:
11
- web:
12
- baseUrl: "https://example.com"
13
- pages:
14
- - "https://example.com"
15
- - "https://example.com/about"
16
-
17
- # Optional: Browser configuration
18
20
  execution:
19
- timeout: 60000
20
- max_retries: 1
21
+ default_timeout: 60000
22
+ default_retries: 1
23
+ on_failure: continue
24
+ parallel: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qa360",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "QA360 Proof CLI - Quality as Cryptographic Proof",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,6 +45,7 @@
45
45
  "ollama": "^0.5.1",
46
46
  "ora": "^5.4.1",
47
47
  "playwright": "^1.57.0",
48
+
48
49
  "sqlite3": "^5.1.6",
49
50
  "tweetnacl": "^1.0.3"
50
51
  },
@@ -72,4 +73,4 @@
72
73
  "bugs": {
73
74
  "url": "https://github.com/xyqotech/qa360/issues"
74
75
  }
75
- }
76
+ }