@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,333 @@
1
+ /**
2
+ * QA Advanced Tools - Fase 1 (Críticas)
3
+ *
4
+ * Este archivo contiene las definiciones de tools avanzadas para el agente QA.
5
+ * Estas tools permiten validaciones, extracción de datos, y detección de errores.
6
+ *
7
+ * @created 2026-02-13
8
+ */
9
+
10
+ // ============================================================================
11
+ // TOOL 1: validate_element_state
12
+ // ============================================================================
13
+ export const validateElementStateTool = {
14
+ name: "validate_element_state",
15
+ description: "QA Skill: Validate that an element meets expected conditions (exists, visible, enabled, disabled, contains text, has value). Use this for assertions during test execution WITHOUT executing actions. This is the KEY tool for verifying application state.",
16
+ input_schema: {
17
+ type: "object",
18
+ properties: {
19
+ idx: {
20
+ type: "number",
21
+ description: "The IDX of the element to validate"
22
+ },
23
+ validations: {
24
+ type: "array",
25
+ description: "List of validations to perform on this element",
26
+ items: {
27
+ type: "object",
28
+ properties: {
29
+ type: {
30
+ enum: ["exists", "visible", "enabled", "disabled", "contains_text", "has_value", "is_empty", "has_class"],
31
+ description: "Type of validation to perform"
32
+ },
33
+ expected_value: {
34
+ type: "string",
35
+ description: "Expected value (required for: contains_text, has_value, has_class)"
36
+ }
37
+ },
38
+ required: ["type"]
39
+ }
40
+ }
41
+ },
42
+ required: ["idx", "validations"]
43
+ }
44
+ };
45
+
46
+ // ============================================================================
47
+ // TOOL 2: extract_table_data
48
+ // ============================================================================
49
+ export const extractTableDataTool = {
50
+ name: "extract_table_data",
51
+ description: "QA Skill: Extract structured data from tables or lists on the page. Use this to validate datasets, counts, or specific values. Returns an array of objects representing rows with their data.",
52
+ input_schema: {
53
+ type: "object",
54
+ properties: {
55
+ table_identifier: {
56
+ type: "string",
57
+ description: "Text content near the table, aria-label, or distinctive text that identifies the table (e.g., 'Timesheet - Hoy', 'Listado de pendientes')"
58
+ },
59
+ max_rows: {
60
+ type: "number",
61
+ description: "Maximum number of rows to extract (default: 50)",
62
+ default: 50
63
+ },
64
+ filter_column: {
65
+ type: "string",
66
+ description: "Optional: Column name to filter by"
67
+ },
68
+ filter_value: {
69
+ type: "string",
70
+ description: "Optional: Value to match in the filter column"
71
+ }
72
+ },
73
+ required: ["table_identifier"]
74
+ }
75
+ };
76
+
77
+ // ============================================================================
78
+ // TOOL 3: capture_console_errors
79
+ // ============================================================================
80
+ export const captureConsoleErrorsTool = {
81
+ name: "capture_console_errors",
82
+ description: "QA Skill: Capture JavaScript console errors, warnings, and network failures that occurred during the test. Use this to detect client-side bugs that are not visible in the UI. This is CRITICAL for detecting hidden issues.",
83
+ input_schema: {
84
+ type: "object",
85
+ properties: {
86
+ severity_filter: {
87
+ enum: ["all", "error", "warning"],
88
+ description: "Filter by severity level (default: error)",
89
+ default: "error"
90
+ },
91
+ include_network_errors: {
92
+ type: "boolean",
93
+ description: "Include failed network requests (HTTP errors)",
94
+ default: true
95
+ }
96
+ }
97
+ }
98
+ };
99
+
100
+ // ============================================================================
101
+ // TOOL 4: assert_url_pattern
102
+ // ============================================================================
103
+ export const assertUrlPatternTool = {
104
+ name: "assert_url_pattern",
105
+ description: "QA Skill: Validate that the current URL matches (or doesn't match) an expected pattern. Use this to ensure navigation worked correctly or to verify you're on the expected page.",
106
+ input_schema: {
107
+ type: "object",
108
+ properties: {
109
+ pattern: {
110
+ type: "string",
111
+ description: "URL pattern to match (can be a substring like '/welcome' or a full URL)"
112
+ },
113
+ should_match: {
114
+ type: "boolean",
115
+ description: "True if URL should contain the pattern, false if it should NOT",
116
+ default: true
117
+ }
118
+ },
119
+ required: ["pattern"]
120
+ }
121
+ };
122
+
123
+ // ============================================================================
124
+ // TOOL 5: measure_page_performance
125
+ // ============================================================================
126
+ export const measurePagePerformanceTool = {
127
+ name: "measure_page_performance",
128
+ description: "QA Skill: Measure page load time, network requests, and performance metrics (FCP, DOM loaded, total load). Use this to validate performance requirements or SLAs. Returns measured values and PASS/FAIL against optional thresholds.",
129
+ input_schema: {
130
+ type: "object",
131
+ properties: {
132
+ metrics_to_capture: {
133
+ type: "array",
134
+ items: {
135
+ enum: ["load_time", "dom_content_loaded", "first_contentful_paint", "network_requests", "resource_size"]
136
+ },
137
+ description: "Metrics to measure (default: all available)"
138
+ },
139
+ thresholds: {
140
+ type: "object",
141
+ description: "Optional thresholds for PASS/FAIL evaluation (e.g., {load_time_ms: 3000, dom_content_loaded_ms: 2000})",
142
+ properties: {
143
+ load_time_ms: { type: "number", description: "Maximum acceptable page load time in ms" },
144
+ dom_content_loaded_ms: { type: "number", description: "Maximum acceptable DOM content loaded time in ms" },
145
+ first_contentful_paint_ms: { type: "number", description: "Maximum acceptable FCP in ms" },
146
+ max_network_requests: { type: "number", description: "Maximum number of network requests allowed" },
147
+ max_resource_size_kb: { type: "number", description: "Maximum total resource size in KB" }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ };
153
+
154
+ // ============================================================================
155
+ // TOOL 6: save_navigation_checkpoint
156
+ // ============================================================================
157
+ export const saveNavigationCheckpointTool = {
158
+ name: "save_navigation_checkpoint",
159
+ description: "QA Skill: Save the current page state (URL, cookies, localStorage, sessionStorage) as a named checkpoint. Use this before testing multiple paths from the same starting point, so you can restore later without repeating setup steps.",
160
+ input_schema: {
161
+ type: "object",
162
+ properties: {
163
+ checkpoint_name: {
164
+ type: "string",
165
+ description: "Unique name for this checkpoint (e.g., 'form_filled', 'logged_in', 'before_submit')"
166
+ },
167
+ include_storage: {
168
+ type: "boolean",
169
+ description: "Save localStorage and sessionStorage (default: true)",
170
+ default: true
171
+ }
172
+ },
173
+ required: ["checkpoint_name"]
174
+ }
175
+ };
176
+
177
+ // ============================================================================
178
+ // TOOL 7: restore_navigation_checkpoint
179
+ // ============================================================================
180
+ export const restoreNavigationCheckpointTool = {
181
+ name: "restore_navigation_checkpoint",
182
+ description: "QA Skill: Restore a previously saved checkpoint to return to that page state. This navigates back to the saved URL and restores cookies/storage. Use this to test alternative paths from the same starting point without re-running the entire flow.",
183
+ input_schema: {
184
+ type: "object",
185
+ properties: {
186
+ checkpoint_name: {
187
+ type: "string",
188
+ description: "Name of the checkpoint to restore (must have been saved previously)"
189
+ }
190
+ },
191
+ required: ["checkpoint_name"]
192
+ }
193
+ };
194
+
195
+ // ============================================================================
196
+ // TOOL 8: create_test_evidence
197
+ // ============================================================================
198
+ export const createTestEvidenceTool = {
199
+ name: "create_test_evidence",
200
+ description: "QA Skill: Create visual test evidence (screenshots or annotated screenshots) and save them to disk. Use 'screenshot' for a plain capture, 'annotated_screenshot' to highlight specific elements with colored borders and labels, or 'full_page_screenshot' for a full-page capture. Evidence files are saved for bug reports and test documentation.",
201
+ input_schema: {
202
+ type: "object",
203
+ properties: {
204
+ evidence_type: {
205
+ enum: ["screenshot", "annotated_screenshot", "full_page_screenshot"],
206
+ description: "Type of evidence to create"
207
+ },
208
+ annotations: {
209
+ type: "array",
210
+ description: "Elements to highlight with labels (only for 'annotated_screenshot')",
211
+ items: {
212
+ type: "object",
213
+ properties: {
214
+ idx: { type: "number", description: "IDX of the element to highlight" },
215
+ label: { type: "string", description: "Annotation text to display near the element" },
216
+ color: { type: "string", description: "Highlight color (default: red)", default: "red" }
217
+ },
218
+ required: ["idx", "label"]
219
+ }
220
+ },
221
+ save_as: {
222
+ type: "string",
223
+ description: "Filename for the evidence (without extension, .png will be added). Example: 'bug_save_button_disabled'"
224
+ },
225
+ description: {
226
+ type: "string",
227
+ description: "Description of what this evidence proves or highlights"
228
+ },
229
+ finish_run: {
230
+ type: "boolean",
231
+ description: "If true, immediately ends the mission after saving evidence (saves tokens). Use this for final success evidence."
232
+ }
233
+ },
234
+ required: ["evidence_type", "save_as"]
235
+ }
236
+ };
237
+
238
+ // ============================================================================
239
+ // TOOL 9: send_keyboard_event
240
+ // ============================================================================
241
+ export const sendKeyboardEventTool = {
242
+ name: "send_keyboard_event",
243
+ description: "QA Skill: Send a keyboard event to the page or a specific element. Use this for: pressing Escape to close modals/popups, pressing Tab to navigate between form fields, pressing Enter to submit or confirm, pressing Arrow keys to navigate within date/time pickers, dropdowns, sliders, or any custom component that responds to keyboard input. This is CRITICAL for native browser controls (time pickers, date pickers, color pickers) that do not respond well to 'fill'.",
244
+ input_schema: {
245
+ type: "object",
246
+ properties: {
247
+ key: {
248
+ type: "string",
249
+ description: "The key to press. Supported values: 'Escape', 'Enter', 'Tab', 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown', 'Space', or any single character like 'a', '1', etc. For key combinations use '+' separator: 'Control+a', 'Shift+Tab'."
250
+ },
251
+ idx: {
252
+ type: "number",
253
+ description: "Optional: IDX of the element to focus before sending the key. If not provided, the key is sent to whatever element currently has focus."
254
+ },
255
+ repeat: {
256
+ type: "number",
257
+ description: "Number of times to press the key (default: 1). Useful for ArrowUp/ArrowDown in time pickers.",
258
+ default: 1
259
+ }
260
+ },
261
+ required: ["key"]
262
+ }
263
+ };
264
+
265
+ // ============================================================================
266
+ // TOOL 10: interact_native_control
267
+ // ============================================================================
268
+ export const interactNativeControlTool = {
269
+ name: "interact_native_control",
270
+ description: "QA Skill: Interact with native HTML controls that standard click/fill may not handle correctly. This includes: <input type='time'>, <input type='date'>, <input type='datetime-local'>, <input type='color'>, <input type='range'>, <select> with optgroup, and contenteditable elements. This tool uses Playwright's specialized methods (selectOption, fill with format coercion, press sequences) to reliably set values. ALWAYS prefer this tool over manual fill for time/date inputs.",
271
+ input_schema: {
272
+ type: "object",
273
+ properties: {
274
+ idx: {
275
+ type: "number",
276
+ description: "The IDX of the native control element"
277
+ },
278
+ control_type: {
279
+ enum: ["time", "date", "datetime", "color", "range", "select", "contenteditable"],
280
+ description: "The type of native control"
281
+ },
282
+ value: {
283
+ type: "string",
284
+ description: "The value to set. Formats: time='HH:mm' or 'HH:mm:ss', date='YYYY-MM-DD', datetime='YYYY-MM-DDTHH:mm', color='#rrggbb', range='number', select='option text or value', contenteditable='text to type'."
285
+ }
286
+ },
287
+ required: ["idx", "control_type", "value"]
288
+ }
289
+ };
290
+
291
+ // ============================================================================
292
+ // TOOL 11: scroll_page
293
+ // ============================================================================
294
+ export const scrollPageTool = {
295
+ name: "scroll_page",
296
+ description: "QA Skill: Scroll the page or a specific container to reveal elements that are outside the current viewport. Use this when: you cannot find an expected element in CURRENT COMPONENTS (it might be below the fold), a form has many fields and you need to see more, or you need to scroll to a specific element. After scrolling, the page state will be refreshed in the next turn.",
297
+ input_schema: {
298
+ type: "object",
299
+ properties: {
300
+ direction: {
301
+ enum: ["up", "down", "left", "right", "top", "bottom"],
302
+ description: "Direction to scroll. 'top' and 'bottom' scroll all the way to the start/end."
303
+ },
304
+ amount: {
305
+ type: "number",
306
+ description: "Pixels to scroll (default: 500). Ignored for 'top' and 'bottom' directions.",
307
+ default: 500
308
+ },
309
+ idx: {
310
+ type: "number",
311
+ description: "Optional: IDX of a scrollable container. If omitted, scrolls the main page."
312
+ }
313
+ },
314
+ required: ["direction"]
315
+ }
316
+ };
317
+
318
+ // ============================================================================
319
+ // EXPORT ALL TOOLS
320
+ // ============================================================================
321
+ export const qaAdvancedTools = [
322
+ validateElementStateTool,
323
+ extractTableDataTool,
324
+ captureConsoleErrorsTool,
325
+ assertUrlPatternTool,
326
+ measurePagePerformanceTool,
327
+ saveNavigationCheckpointTool,
328
+ restoreNavigationCheckpointTool,
329
+ createTestEvidenceTool,
330
+ sendKeyboardEventTool,
331
+ interactNativeControlTool,
332
+ scrollPageTool
333
+ ];