@arcadialdev/arcality 2.6.7 → 3.0.1

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.
package/bin/arcality.mjs CHANGED
@@ -15,6 +15,7 @@ let isRun = false;
15
15
  let isInit = false;
16
16
  let isSetup = false;
17
17
  let isLogs = false;
18
+ let isRunAll = false; // CI/CD mode: runs all missions from API headlessly
18
19
 
19
20
  // Buscamos los comandos en cualquier posición para evitar filtros de NPM en Windows
20
21
  rawArgs.forEach(arg => {
@@ -22,6 +23,7 @@ rawArgs.forEach(arg => {
22
23
  if (arg === 'init') isInit = true;
23
24
  if (arg === 'setup') isSetup = true;
24
25
  if (arg === '--logs') isLogs = true;
26
+ if (arg === '--run-all') isRunAll = true;
25
27
  });
26
28
 
27
29
  if (isLogs) {
@@ -38,6 +40,15 @@ if (isLogs) {
38
40
  cwd: process.cwd(),
39
41
  env: { ...process.env, ARCALITY_ROOT: PACKAGE_ROOT }
40
42
  }).on('exit', code => process.exit(code || 0));
43
+ } else if (isRunAll) {
44
+ // CI/CD HEADLESS MODE: Descarga y ejecuta todas las misiones del proyecto desde la API
45
+ // Uso: arcality --run-all [--workers=4] [--tags=smoke,regression] [--project-id=xxx]
46
+ const mainScript = path.join(PACKAGE_ROOT, 'scripts', 'gen-and-run.mjs');
47
+ spawn('node', [mainScript, '--run-all', ...rawArgs.filter(a => a !== '--run-all')], {
48
+ stdio: 'inherit',
49
+ cwd: process.cwd(),
50
+ env: { ...process.env, ARCALITY_ROOT: PACKAGE_ROOT, CI: process.env.CI || 'true' }
51
+ }).on('exit', code => process.exit(code ?? 1));
41
52
  } else if (isRun) {
42
53
  // FORZAMOS EL MODO AGENTE: Esto saltará el menú interactivo en gen-and-run.mjs
43
54
  const mainScript = path.join(PACKAGE_ROOT, 'scripts', 'gen-and-run.mjs');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcadialdev/arcality",
3
- "version": "2.6.7",
3
+ "version": "3.0.1",
4
4
  "description": "El primer ingeniero QA Autónomo integrado al CI/CD. Creado por Arcadial.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,19 +3,37 @@
3
3
  const { defineConfig, devices } = require('@playwright/test');
4
4
  const path = require('path');
5
5
 
6
+ // ── Dynamic reporter: JUnit is added when running in CI (Azure DevOps, GitHub Actions) ──
7
+ // The JUnit XML file enables native test result publishing in your pipeline dashboard.
8
+ // In local/interactive mode, the JUnit reporter is skipped — only Arcality's HTML reporter runs.
9
+ const reportsDir = process.env.REPORTS_DIR || path.join(__dirname, 'tests-report');
10
+ const isCI = process.env.CI === 'true';
11
+
12
+ const reporters = [
13
+ ['line'],
14
+ [path.join(__dirname, 'tests', '_helpers', 'ArcalityReporter.js'), { outputDir: reportsDir }],
15
+ ];
16
+
17
+ if (isCI) {
18
+ reporters.push(['junit', { outputFile: path.join(reportsDir, 'results.xml') }]);
19
+ }
20
+
6
21
  module.exports = defineConfig({
7
22
  testDir: path.join(__dirname, 'tests', '_helpers'),
8
23
  testMatch: ['agentic-runner.bundle.spec.js'],
9
- reporter: [
10
- ['line'],
11
- [path.join(__dirname, 'tests', '_helpers', 'ArcalityReporter.js'),
12
- { outputDir: process.env.REPORTS_DIR || path.join(__dirname, 'tests-report') }]
13
- ],
24
+ reporter: reporters,
14
25
  use: {
26
+ // ── Dynamic BASE_URL ──
27
+ // Priority: CLI --base-url flag → arcality.config baseUrl → BASE_URL env → default
28
+ // This allows pipelines to inject the target environment dynamically:
29
+ // arcality --run-all --base-url=https://staging.myapp.com
30
+ baseURL: process.env.BASE_URL || 'http://localhost:3000',
15
31
  video: 'on',
16
32
  screenshot: 'on',
17
33
  trace: 'on',
18
34
  colorScheme: 'dark',
35
+ // In CI: headless is enforced by Playwright automatically when CI=true
36
+ headless: isCI ? true : undefined,
19
37
  contextOptions: {
20
38
  reducedMotion: 'reduce',
21
39
  },
@@ -32,3 +50,4 @@ module.exports = defineConfig({
32
50
  },
33
51
  ],
34
52
  });
53
+