@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,359 @@
1
+ # Accessibility Testing
2
+
3
+ ## Table of Contents
4
+
5
+ 1. [Axe-Core Integration](#axe-core-integration)
6
+ 2. [Keyboard Navigation](#keyboard-navigation)
7
+ 3. [ARIA Validation](#aria-validation)
8
+ 4. [Focus Management](#focus-management)
9
+ 5. [Color & Contrast](#color--contrast)
10
+
11
+ ## Axe-Core Integration
12
+
13
+ ### Setup
14
+
15
+ ```bash
16
+ npm install -D @axe-core/playwright
17
+ ```
18
+
19
+ ### Basic A11y Test
20
+
21
+ ```typescript
22
+ import { test, expect } from "@playwright/test";
23
+ import AxeBuilder from "@axe-core/playwright";
24
+
25
+ test("homepage should have no a11y violations", async ({ page }) => {
26
+ await page.goto("/");
27
+
28
+ const results = await new AxeBuilder({ page }).analyze();
29
+
30
+ expect(results.violations).toEqual([]);
31
+ });
32
+ ```
33
+
34
+ ### Scoped Analysis
35
+
36
+ ```typescript
37
+ test("form accessibility", async ({ page }) => {
38
+ await page.goto("/contact");
39
+
40
+ // Analyze only the form
41
+ const results = await new AxeBuilder({ page })
42
+ .include("#contact-form")
43
+ .analyze();
44
+
45
+ expect(results.violations).toEqual([]);
46
+ });
47
+
48
+ test("ignore known issues", async ({ page }) => {
49
+ await page.goto("/legacy-page");
50
+
51
+ const results = await new AxeBuilder({ page })
52
+ .exclude(".legacy-widget") // Skip legacy component
53
+ .disableRules(["color-contrast"]) // Disable specific rule
54
+ .analyze();
55
+
56
+ expect(results.violations).toEqual([]);
57
+ });
58
+ ```
59
+
60
+ ### A11y Fixture
61
+
62
+ ```typescript
63
+ // fixtures/a11y.fixture.ts
64
+ import { test as base } from "@playwright/test";
65
+ import AxeBuilder from "@axe-core/playwright";
66
+
67
+ type A11yFixtures = {
68
+ makeAxeBuilder: () => AxeBuilder;
69
+ };
70
+
71
+ export const test = base.extend<A11yFixtures>({
72
+ makeAxeBuilder: async ({ page }, use) => {
73
+ await use(() =>
74
+ new AxeBuilder({ page }).withTags([
75
+ "wcag2a",
76
+ "wcag2aa",
77
+ "wcag21a",
78
+ "wcag21aa",
79
+ ]),
80
+ );
81
+ },
82
+ });
83
+
84
+ // Usage
85
+ test("dashboard a11y", async ({ page, makeAxeBuilder }) => {
86
+ await page.goto("/dashboard");
87
+ const results = await makeAxeBuilder().analyze();
88
+ expect(results.violations).toEqual([]);
89
+ });
90
+ ```
91
+
92
+ ### Detailed Violation Reporting
93
+
94
+ ```typescript
95
+ test("report a11y issues", async ({ page }) => {
96
+ await page.goto("/");
97
+
98
+ const results = await new AxeBuilder({ page }).analyze();
99
+
100
+ // Custom failure message with details
101
+ const violations = results.violations.map((v) => ({
102
+ id: v.id,
103
+ impact: v.impact,
104
+ description: v.description,
105
+ nodes: v.nodes.map((n) => n.html),
106
+ }));
107
+
108
+ expect(violations, JSON.stringify(violations, null, 2)).toHaveLength(0);
109
+ });
110
+ ```
111
+
112
+ ## Keyboard Navigation
113
+
114
+ ### Tab Order Testing
115
+
116
+ ```typescript
117
+ test("correct tab order in form", async ({ page }) => {
118
+ await page.goto("/signup");
119
+
120
+ // Start from the beginning
121
+ await page.keyboard.press("Tab");
122
+ await expect(page.getByLabel("Email")).toBeFocused();
123
+
124
+ await page.keyboard.press("Tab");
125
+ await expect(page.getByLabel("Password")).toBeFocused();
126
+
127
+ await page.keyboard.press("Tab");
128
+ await expect(page.getByRole("button", { name: "Sign up" })).toBeFocused();
129
+ });
130
+ ```
131
+
132
+ ### Keyboard-Only Interaction
133
+
134
+ ```typescript
135
+ test("complete flow with keyboard only", async ({ page }) => {
136
+ await page.goto("/products");
137
+
138
+ // Navigate to product with keyboard
139
+ await page.keyboard.press("Tab"); // Skip to main content
140
+ await page.keyboard.press("Tab"); // First product
141
+ await page.keyboard.press("Enter"); // Open product
142
+
143
+ await expect(page).toHaveURL(/\/products\/\d+/);
144
+
145
+ // Add to cart with keyboard
146
+ await page.keyboard.press("Tab");
147
+ await page.keyboard.press("Tab"); // Navigate to "Add to Cart"
148
+ await page.keyboard.press("Enter");
149
+
150
+ await expect(page.getByRole("alert")).toContainText("Added to cart");
151
+ });
152
+ ```
153
+
154
+ ### Skip Links
155
+
156
+ ```typescript
157
+ test("skip link works", async ({ page }) => {
158
+ await page.goto("/");
159
+
160
+ await page.keyboard.press("Tab");
161
+ const skipLink = page.getByRole("link", { name: /skip to main/i });
162
+ await expect(skipLink).toBeFocused();
163
+
164
+ await page.keyboard.press("Enter");
165
+
166
+ // Focus should move to main content
167
+ await expect(page.getByRole("main")).toBeFocused();
168
+ });
169
+ ```
170
+
171
+ ### Escape Key Handling
172
+
173
+ ```typescript
174
+ test("escape closes modal", async ({ page }) => {
175
+ await page.goto("/dashboard");
176
+ await page.getByRole("button", { name: "Settings" }).click();
177
+
178
+ const modal = page.getByRole("dialog");
179
+ await expect(modal).toBeVisible();
180
+
181
+ await page.keyboard.press("Escape");
182
+
183
+ await expect(modal).toBeHidden();
184
+ // Focus should return to trigger
185
+ await expect(page.getByRole("button", { name: "Settings" })).toBeFocused();
186
+ });
187
+ ```
188
+
189
+ ## ARIA Validation
190
+
191
+ ### Role Verification
192
+
193
+ ```typescript
194
+ test("correct ARIA roles", async ({ page }) => {
195
+ await page.goto("/dashboard");
196
+
197
+ // Verify landmark roles
198
+ await expect(page.getByRole("navigation")).toBeVisible();
199
+ await expect(page.getByRole("main")).toBeVisible();
200
+ await expect(page.getByRole("contentinfo")).toBeVisible(); // footer
201
+
202
+ // Verify interactive roles
203
+ await expect(page.getByRole("button", { name: "Menu" })).toBeVisible();
204
+ await expect(page.getByRole("search")).toBeVisible();
205
+ });
206
+ ```
207
+
208
+ ### ARIA States
209
+
210
+ ```typescript
211
+ test("aria-expanded updates correctly", async ({ page }) => {
212
+ await page.goto("/faq");
213
+
214
+ const accordion = page.getByRole("button", { name: "Shipping" });
215
+
216
+ // Initially collapsed
217
+ await expect(accordion).toHaveAttribute("aria-expanded", "false");
218
+
219
+ await accordion.click();
220
+
221
+ // Now expanded
222
+ await expect(accordion).toHaveAttribute("aria-expanded", "true");
223
+
224
+ // Content is visible
225
+ const panel = page.getByRole("region", { name: "Shipping" });
226
+ await expect(panel).toBeVisible();
227
+ });
228
+ ```
229
+
230
+ ### Live Regions
231
+
232
+ ```typescript
233
+ test("live region announces updates", async ({ page }) => {
234
+ await page.goto("/checkout");
235
+
236
+ // Find live region
237
+ const liveRegion = page.locator('[aria-live="polite"]');
238
+
239
+ await page.getByLabel("Quantity").fill("3");
240
+
241
+ // Live region should update with new total
242
+ await expect(liveRegion).toContainText("Total: $29.97");
243
+ });
244
+ ```
245
+
246
+ ## Focus Management
247
+
248
+ ### Focus Trap in Modal
249
+
250
+ ```typescript
251
+ test("focus trapped in modal", async ({ page }) => {
252
+ await page.goto("/");
253
+ await page.getByRole("button", { name: "Open Modal" }).click();
254
+
255
+ const modal = page.getByRole("dialog");
256
+ await expect(modal).toBeVisible();
257
+
258
+ // Get all focusable elements in modal
259
+ const focusableElements = modal.locator(
260
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
261
+ );
262
+ const count = await focusableElements.count();
263
+
264
+ // Tab through all elements, should stay in modal
265
+ for (let i = 0; i < count + 1; i++) {
266
+ await page.keyboard.press("Tab");
267
+ const focused = page.locator(":focus");
268
+ await expect(modal).toContainText((await focused.textContent()) || "");
269
+ }
270
+ });
271
+ ```
272
+
273
+ ### Focus Restoration
274
+
275
+ ```typescript
276
+ test("focus returns after modal close", async ({ page }) => {
277
+ await page.goto("/");
278
+
279
+ const trigger = page.getByRole("button", { name: "Delete Item" });
280
+ await trigger.click();
281
+
282
+ await page.getByRole("button", { name: "Cancel" }).click();
283
+
284
+ // Focus should return to the trigger
285
+ await expect(trigger).toBeFocused();
286
+ });
287
+ ```
288
+
289
+ ## Color & Contrast
290
+
291
+ ### High Contrast Mode
292
+
293
+ ```typescript
294
+ test("works in high contrast mode", async ({ page }) => {
295
+ await page.emulateMedia({ forcedColors: "active" });
296
+ await page.goto("/");
297
+
298
+ // Verify key elements are visible
299
+ await expect(page.getByRole("navigation")).toBeVisible();
300
+ await expect(page.getByRole("button", { name: "Sign In" })).toBeVisible();
301
+
302
+ // Take screenshot for visual verification
303
+ await expect(page).toHaveScreenshot("high-contrast.png");
304
+ });
305
+ ```
306
+
307
+ ### Reduced Motion
308
+
309
+ ```typescript
310
+ test("respects reduced motion preference", async ({ page }) => {
311
+ await page.emulateMedia({ reducedMotion: "reduce" });
312
+ await page.goto("/");
313
+
314
+ // Animations should be disabled
315
+ const hero = page.getByTestId("hero-animation");
316
+ const animation = await hero.evaluate(
317
+ (el) => getComputedStyle(el).animationDuration,
318
+ );
319
+
320
+ expect(animation).toBe("0s");
321
+ });
322
+ ```
323
+
324
+ ## CI Integration
325
+
326
+ ### A11y as CI Gate
327
+
328
+ ```typescript
329
+ // playwright.config.ts
330
+ export default defineConfig({
331
+ projects: [
332
+ {
333
+ name: "a11y",
334
+ testMatch: /.*\.a11y\.spec\.ts/,
335
+ use: { ...devices["Desktop Chrome"] },
336
+ },
337
+ ],
338
+ });
339
+ ```
340
+
341
+ ```yaml
342
+ # .github/workflows/a11y.yml
343
+ - name: Run accessibility tests
344
+ run: npx playwright test --project=a11y
345
+ ```
346
+
347
+ ## Anti-Patterns to Avoid
348
+
349
+ | Anti-Pattern | Problem | Solution |
350
+ | ----------------------------- | ---------------------------- | ------------------------------------------ |
351
+ | Testing a11y only on homepage | Misses issues on other pages | Test all critical user flows |
352
+ | Ignoring all violations | No value from tests | Address or explicitly exclude known issues |
353
+ | Only automated testing | Misses many a11y issues | Combine with manual testing |
354
+ | Testing without screen reader | Misses interaction issues | Test with VoiceOver/NVDA periodically |
355
+
356
+ ## Related References
357
+
358
+ - **Locators**: See [locators.md](../core/locators.md) for role-based selectors
359
+ - **Visual testing**: See [test-suite-structure.md](../core/test-suite-structure.md) for screenshot comparison