@arcadialdev/arcality 2.2.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 (97) hide show
  1. package/.agents/skills/e2e-testing-expert/SKILL.md +28 -0
  2. package/.agents/skills/frontend-design/LICENSE.txt +177 -0
  3. package/.agents/skills/frontend-design/SKILL.md +42 -0
  4. package/.agents/skills/nodejs-backend-patterns/SKILL.md +639 -0
  5. package/.agents/skills/nodejs-backend-patterns/references/advanced-patterns.md +430 -0
  6. package/.agents/skills/playwright-best-practices/LICENSE.md +7 -0
  7. package/.agents/skills/playwright-best-practices/README.md +147 -0
  8. package/.agents/skills/playwright-best-practices/SKILL.md +303 -0
  9. package/.agents/skills/playwright-best-practices/advanced/authentication-flows.md +360 -0
  10. package/.agents/skills/playwright-best-practices/advanced/authentication.md +871 -0
  11. package/.agents/skills/playwright-best-practices/advanced/clock-mocking.md +364 -0
  12. package/.agents/skills/playwright-best-practices/advanced/mobile-testing.md +409 -0
  13. package/.agents/skills/playwright-best-practices/advanced/multi-context.md +288 -0
  14. package/.agents/skills/playwright-best-practices/advanced/multi-user.md +393 -0
  15. package/.agents/skills/playwright-best-practices/advanced/network-advanced.md +452 -0
  16. package/.agents/skills/playwright-best-practices/advanced/third-party.md +464 -0
  17. package/.agents/skills/playwright-best-practices/architecture/pom-vs-fixtures.md +363 -0
  18. package/.agents/skills/playwright-best-practices/architecture/test-architecture.md +369 -0
  19. package/.agents/skills/playwright-best-practices/architecture/when-to-mock.md +383 -0
  20. package/.agents/skills/playwright-best-practices/browser-apis/browser-apis.md +391 -0
  21. package/.agents/skills/playwright-best-practices/browser-apis/iframes.md +403 -0
  22. package/.agents/skills/playwright-best-practices/browser-apis/service-workers.md +504 -0
  23. package/.agents/skills/playwright-best-practices/browser-apis/websockets.md +403 -0
  24. package/.agents/skills/playwright-best-practices/core/annotations.md +424 -0
  25. package/.agents/skills/playwright-best-practices/core/assertions-waiting.md +361 -0
  26. package/.agents/skills/playwright-best-practices/core/configuration.md +452 -0
  27. package/.agents/skills/playwright-best-practices/core/fixtures-hooks.md +417 -0
  28. package/.agents/skills/playwright-best-practices/core/global-setup.md +434 -0
  29. package/.agents/skills/playwright-best-practices/core/locators.md +242 -0
  30. package/.agents/skills/playwright-best-practices/core/page-object-model.md +315 -0
  31. package/.agents/skills/playwright-best-practices/core/projects-dependencies.md +453 -0
  32. package/.agents/skills/playwright-best-practices/core/test-data.md +492 -0
  33. package/.agents/skills/playwright-best-practices/core/test-suite-structure.md +361 -0
  34. package/.agents/skills/playwright-best-practices/core/test-tags.md +298 -0
  35. package/.agents/skills/playwright-best-practices/debugging/console-errors.md +420 -0
  36. package/.agents/skills/playwright-best-practices/debugging/debugging.md +504 -0
  37. package/.agents/skills/playwright-best-practices/debugging/error-testing.md +360 -0
  38. package/.agents/skills/playwright-best-practices/debugging/flaky-tests.md +496 -0
  39. package/.agents/skills/playwright-best-practices/frameworks/angular.md +530 -0
  40. package/.agents/skills/playwright-best-practices/frameworks/nextjs.md +469 -0
  41. package/.agents/skills/playwright-best-practices/frameworks/react.md +531 -0
  42. package/.agents/skills/playwright-best-practices/frameworks/vue.md +574 -0
  43. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/ci-cd.md +468 -0
  44. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/docker.md +283 -0
  45. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/github-actions.md +546 -0
  46. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/gitlab.md +397 -0
  47. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/other-providers.md +521 -0
  48. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/parallel-sharding.md +371 -0
  49. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/performance.md +453 -0
  50. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/reporting.md +424 -0
  51. package/.agents/skills/playwright-best-practices/infrastructure-ci-cd/test-coverage.md +497 -0
  52. package/.agents/skills/playwright-best-practices/testing-patterns/accessibility.md +359 -0
  53. package/.agents/skills/playwright-best-practices/testing-patterns/api-testing.md +719 -0
  54. package/.agents/skills/playwright-best-practices/testing-patterns/browser-extensions.md +506 -0
  55. package/.agents/skills/playwright-best-practices/testing-patterns/canvas-webgl.md +493 -0
  56. package/.agents/skills/playwright-best-practices/testing-patterns/component-testing.md +500 -0
  57. package/.agents/skills/playwright-best-practices/testing-patterns/drag-drop.md +576 -0
  58. package/.agents/skills/playwright-best-practices/testing-patterns/electron.md +509 -0
  59. package/.agents/skills/playwright-best-practices/testing-patterns/file-operations.md +377 -0
  60. package/.agents/skills/playwright-best-practices/testing-patterns/file-upload-download.md +562 -0
  61. package/.agents/skills/playwright-best-practices/testing-patterns/forms-validation.md +561 -0
  62. package/.agents/skills/playwright-best-practices/testing-patterns/graphql-testing.md +331 -0
  63. package/.agents/skills/playwright-best-practices/testing-patterns/i18n.md +508 -0
  64. package/.agents/skills/playwright-best-practices/testing-patterns/performance-testing.md +476 -0
  65. package/.agents/skills/playwright-best-practices/testing-patterns/security-testing.md +430 -0
  66. package/.agents/skills/playwright-best-practices/testing-patterns/visual-regression.md +634 -0
  67. package/.env.example +21 -0
  68. package/README.md +30 -0
  69. package/bin/arcality.mjs +86 -0
  70. package/package.json +66 -0
  71. package/playwright.config.ts +12 -0
  72. package/scripts/cleanup-qmsdev.mjs +63 -0
  73. package/scripts/discover-view.mjs +52 -0
  74. package/scripts/extract-view.mjs +64 -0
  75. package/scripts/gen-and-run.mjs +838 -0
  76. package/scripts/init.mjs +290 -0
  77. package/scripts/migrate-to-central-out.mjs +157 -0
  78. package/scripts/postinstall.mjs +63 -0
  79. package/scripts/rebrand-report.mjs +241 -0
  80. package/scripts/setup.mjs +166 -0
  81. package/src/KnowledgeService.ts +239 -0
  82. package/src/arcalityClient.mjs +266 -0
  83. package/src/configLoader.mjs +179 -0
  84. package/src/configManager.mjs +172 -0
  85. package/src/consoleBanner.ts +32 -0
  86. package/src/envSetup.ts +205 -0
  87. package/src/index.ts +25 -0
  88. package/src/projectInspector.ts +42 -0
  89. package/src/services/collectiveMemoryService.ts +178 -0
  90. package/src/testRunner.ts +201 -0
  91. package/tests/_helpers/ArcalityReporter.ts +490 -0
  92. package/tests/_helpers/agentic-runner.spec.ts +741 -0
  93. package/tests/_helpers/ai-agent-helper.ts +1573 -0
  94. package/tests/_helpers/discover-view.spec.ts +238 -0
  95. package/tests/_helpers/extract-view.spec.ts +118 -0
  96. package/tests/_helpers/qa-tools.ts +333 -0
  97. package/tests/_helpers/smart-action.spec.ts +1458 -0
@@ -0,0 +1,283 @@
1
+ # Container-Based Testing
2
+
3
+ ## Table of Contents
4
+
5
+ 1. [Patterns](#patterns)
6
+ 2. [Decision Guide](#decision-guide)
7
+ 3. [Anti-Patterns](#anti-patterns)
8
+ 4. [Troubleshooting](#troubleshooting)
9
+
10
+ > **When to use**: Running tests in containers for reproducible environments, CI pipelines, or consistent browser versions across team machines.
11
+
12
+ ## Patterns
13
+
14
+ ### Official Image Usage
15
+
16
+ Run tests without building a custom image:
17
+
18
+ ```bash
19
+ docker run --rm \
20
+ -v $(pwd):/app \
21
+ -w /app \
22
+ -e CI=true \
23
+ -e BASE_URL=http://host.docker.internal:3000 \
24
+ mcr.microsoft.com/playwright:v1.48.0-noble \
25
+ bash -c "npm ci && npx playwright test"
26
+ ```
27
+
28
+ Extract reports with bind mounts:
29
+
30
+ ```bash
31
+ docker run --rm \
32
+ -v $(pwd):/app \
33
+ -v $(pwd)/playwright-report:/app/playwright-report \
34
+ -v $(pwd)/test-results:/app/test-results \
35
+ -w /app \
36
+ mcr.microsoft.com/playwright:v1.48.0-noble \
37
+ bash -c "npm ci && npx playwright test"
38
+ ```
39
+
40
+ ### Custom Dockerfile
41
+
42
+ Build a custom image when you need additional dependencies or pre-installed packages:
43
+
44
+ ```dockerfile
45
+ FROM mcr.microsoft.com/playwright:v1.48.0-noble
46
+
47
+ WORKDIR /app
48
+
49
+ COPY package.json package-lock.json ./
50
+ RUN npm ci
51
+
52
+ COPY . .
53
+
54
+ CMD ["npx", "playwright", "test"]
55
+ ```
56
+
57
+ Chromium-only slim image:
58
+
59
+ ```dockerfile
60
+ FROM node:latest-slim
61
+
62
+ RUN npx playwright install --with-deps chromium
63
+
64
+ WORKDIR /app
65
+ COPY package.json package-lock.json ./
66
+ RUN npm ci
67
+ COPY . .
68
+
69
+ CMD ["npx", "playwright", "test", "--project=chromium"]
70
+ ```
71
+
72
+ ### Docker Compose Stack
73
+
74
+ Full application stack with database, cache, and test runner:
75
+
76
+ ```yaml
77
+ services:
78
+ app:
79
+ build: .
80
+ ports:
81
+ - "3000:3000"
82
+ environment:
83
+ - NODE_ENV=test
84
+ - DATABASE_URL=postgresql://postgres:postgres@db:5432/test
85
+ depends_on:
86
+ db:
87
+ condition: service_healthy
88
+
89
+ db:
90
+ image: postgres:latest-alpine
91
+ environment:
92
+ POSTGRES_USER: postgres
93
+ POSTGRES_PASSWORD: postgres
94
+ POSTGRES_DB: test
95
+ healthcheck:
96
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
97
+ interval: 5s
98
+ timeout: 5s
99
+ retries: 5
100
+ tmpfs:
101
+ - /var/lib/postgresql/data
102
+
103
+ e2e:
104
+ image: mcr.microsoft.com/playwright:v1.48.0-noble
105
+ working_dir: /app
106
+ volumes:
107
+ - .:/app
108
+ - /app/node_modules
109
+ environment:
110
+ - CI=true
111
+ - BASE_URL=http://app:3000
112
+ depends_on:
113
+ - app
114
+ command: bash -c "npm ci && npx playwright test"
115
+ profiles:
116
+ - test
117
+ ```
118
+
119
+ Run commands:
120
+
121
+ ```bash
122
+ docker compose --profile test up --abort-on-container-exit --exit-code-from e2e
123
+
124
+ docker compose --profile test down -v
125
+ ```
126
+
127
+ ### CI Container Jobs
128
+
129
+ **GitHub Actions:**
130
+
131
+ ```yaml
132
+ jobs:
133
+ test:
134
+ runs-on: ubuntu-latest
135
+ container:
136
+ image: mcr.microsoft.com/playwright:v1.48.0-noble
137
+ steps:
138
+ - uses: actions/checkout@v4
139
+ - run: npm ci
140
+ - run: npx playwright test
141
+ env:
142
+ HOME: /root
143
+ ```
144
+
145
+ **GitLab CI:**
146
+
147
+ ```yaml
148
+ test:
149
+ image: mcr.microsoft.com/playwright:v1.48.0-noble
150
+ script:
151
+ - npm ci
152
+ - npx playwright test
153
+ ```
154
+
155
+ **Jenkins:**
156
+
157
+ ```groovy
158
+ pipeline {
159
+ agent {
160
+ docker {
161
+ image 'mcr.microsoft.com/playwright:v1.48.0-noble'
162
+ args '-u root'
163
+ }
164
+ }
165
+ stages {
166
+ stage('Test') {
167
+ steps {
168
+ sh 'npm ci'
169
+ sh 'npx playwright test'
170
+ }
171
+ }
172
+ }
173
+ }
174
+ ```
175
+
176
+ ### Dev Container Setup
177
+
178
+ VS Code Dev Container or GitHub Codespaces configuration:
179
+
180
+ ```json
181
+ {
182
+ "name": "Playwright Dev",
183
+ "image": "mcr.microsoft.com/playwright:v1.48.0-noble",
184
+ "features": {
185
+ "ghcr.io/devcontainers/features/node:latest": {
186
+ "version": "20"
187
+ }
188
+ },
189
+ "postCreateCommand": "npm ci",
190
+ "customizations": {
191
+ "vscode": {
192
+ "extensions": ["ms-playwright.playwright"]
193
+ }
194
+ },
195
+ "forwardPorts": [3000, 9323],
196
+ "remoteUser": "root"
197
+ }
198
+ ```
199
+
200
+ ## Decision Guide
201
+
202
+ | Scenario | Approach |
203
+ |---|---|
204
+ | Simple CI pipeline | Official image as CI container |
205
+ | Tests need database + cache | Docker Compose with app, db, e2e services |
206
+ | Team needs identical environments | Dev Container or custom Dockerfile |
207
+ | Only testing Chromium | Slim image with `install --with-deps chromium` |
208
+ | Cross-browser testing | Official image (all browsers pre-installed) |
209
+ | Local development | Run directly on host for faster iteration |
210
+
211
+ ## Anti-Patterns
212
+
213
+ | Anti-Pattern | Problem | Solution |
214
+ |---|---|---|
215
+ | Installing browsers at runtime | Wastes 60-90 seconds per run | Use official image or bake browsers into custom image |
216
+ | Running as non-root without sandbox config | Chromium sandbox permission errors | Run as root or disable sandbox |
217
+ | Bind-mounting `node_modules` from host | Platform-specific binary crashes | Use anonymous volume: `-v /app/node_modules` |
218
+ | No health checks on dependent services | Tests start before database ready | Add `healthcheck` with `depends_on: condition: service_healthy` |
219
+ | Building application inside Playwright container | Large image, slow builds | Separate app and e2e containers |
220
+
221
+ ## Troubleshooting
222
+
223
+ ### "browserType.launch: Executable doesn't exist"
224
+
225
+ Playwright version mismatch with Docker image. Ensure `@playwright/test` version matches image tag:
226
+
227
+ ```bash
228
+ npm ls @playwright/test
229
+ docker pull mcr.microsoft.com/playwright:v<matching-version>-noble
230
+ ```
231
+
232
+ ### "net::ERR_CONNECTION_REFUSED" in docker-compose
233
+
234
+ Tests trying to reach `localhost` instead of service name. Configure `baseURL`:
235
+
236
+ ```typescript
237
+ import { defineConfig } from '@playwright/test';
238
+
239
+ export default defineConfig({
240
+ use: {
241
+ baseURL: process.env.BASE_URL || 'http://localhost:3000',
242
+ },
243
+ });
244
+ ```
245
+
246
+ ```yaml
247
+ e2e:
248
+ environment:
249
+ - BASE_URL=http://app:3000
250
+ ```
251
+
252
+ ### Permission denied on mounted volumes
253
+
254
+ Match user IDs or run as root:
255
+
256
+ ```bash
257
+ docker run --rm -u $(id -u):$(id -g) \
258
+ -v $(pwd):/app -w /app \
259
+ mcr.microsoft.com/playwright:v1.48.0-noble \
260
+ npx playwright test
261
+ ```
262
+
263
+ ### Slow container tests on macOS/Windows
264
+
265
+ Docker Desktop I/O overhead. Copy files instead of mounting:
266
+
267
+ ```dockerfile
268
+ FROM mcr.microsoft.com/playwright:v1.48.0-noble
269
+ WORKDIR /app
270
+ COPY . .
271
+ RUN npm ci
272
+ CMD ["npx", "playwright", "test"]
273
+ ```
274
+
275
+ Or use delegated mount:
276
+
277
+ ```bash
278
+ docker run --rm \
279
+ -v $(pwd):/app:delegated \
280
+ -w /app \
281
+ mcr.microsoft.com/playwright:v1.48.0-noble \
282
+ bash -c "npm ci && npx playwright test"
283
+ ```