utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | 178a8a01c6e95d3fe6bf2fa3e23ca75c7c691536bfbc6efe0fe44ee70ae605f9 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 15:12 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 15:12 +02:00 |
| Parents | 144b741f2d62 |
5 files changed
modified tests/edit-bateria.mjs +3 −1
| @@ -113,7 +113,9 @@ | ||
| 113 | 113 | |
| 114 | 114 | const b = await chromium.launch({ channel: 'chrome', headless: true }); |
| 115 | 115 | const p = await (await b.newContext()).newPage(); |
| 116 | -await p.goto('https://code.elffuss.com/', { waitUntil: 'domcontentloaded' }); | |
| 116 | +// Por defecto contra producción, como siempre; BASE=… la corre contra otro | |
| 117 | +// servidor (un árbol local), que es lo que hace falta antes de desplegar. | |
| 118 | +await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' }); | |
| 117 | 119 | await p.waitForTimeout(1200); |
| 118 | 120 | |
| 119 | 121 | const res = await p.evaluate(async (CASOS) => { |
modified tests/goalfail.mjs +3 −1
| @@ -4,7 +4,9 @@ | ||
| 4 | 4 | const b = await chromium.launch({ channel: 'chrome', headless: true }); |
| 5 | 5 | const p = await (await b.newContext()).newPage(); |
| 6 | 6 | const errs = []; p.on('pageerror', e => errs.push(e.message.slice(0, 80))); |
| 7 | -await p.goto('https://code.elffuss.com/', { waitUntil: 'domcontentloaded' }); | |
| 7 | +// Por defecto contra producción, como siempre; BASE=… la corre contra otro | |
| 8 | +// servidor (un árbol local), que es lo que hace falta antes de desplegar. | |
| 9 | +await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' }); | |
| 8 | 10 | await p.waitForTimeout(1500); |
| 9 | 11 | |
| 10 | 12 | const r = await p.evaluate(async () => { |
modified tests/reanuda.mjs +12 −11
| @@ -14,10 +14,12 @@ | ||
| 14 | 14 | // Se usa un fichero pequeño servido en local, no el modelo de 7 GB: lo que se |
| 15 | 15 | // prueba es la lógica de reanudación, y para eso da igual el tamaño. |
| 16 | 16 | import { createServer } from 'node:http'; |
| 17 | -import { existsSync, readFileSync, writeFileSync, mkdtempSync } from 'node:fs'; | |
| 18 | -import { join } from 'node:path'; | |
| 19 | -import { homedir, tmpdir } from 'node:os'; | |
| 17 | +import { existsSync, readFileSync, mkdtempSync } from 'node:fs'; | |
| 18 | +import { join, dirname } from 'node:path'; | |
| 19 | +import { tmpdir } from 'node:os'; | |
| 20 | +import { fileURLToPath } from 'node:url'; | |
| 20 | 21 | import { createHash } from 'node:crypto'; |
| 22 | +import { chromium } from 'playwright'; | |
| 21 | 23 | |
| 22 | 24 | let fails = 0; |
| 23 | 25 | const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; }; |
| @@ -69,8 +71,10 @@ | ||
| 69 | 71 | const BASE = `http://127.0.0.1:${PUERTO}`; |
| 70 | 72 | |
| 71 | 73 | // La página tiene que servirse por HTTP para tener OPFS: se sirve desde el |
| 72 | -// mismo servidor una página mínima que importa el almacén de verdad. | |
| 73 | -const RAIZ = join(homedir(), 'work2026/elffuss-code/web'); | |
| 74 | +// mismo servidor una página mínima que importa el almacén de verdad — el de | |
| 75 | +// ESTE árbol. Antes se servía una ruta fija a otra copia del repo, así que la | |
| 76 | +// prueba no probaba el model-store.js que tenía al lado. | |
| 77 | +const RAIZ = join(dirname(fileURLToPath(import.meta.url)), '..', 'web'); | |
| 74 | 78 | const srv2 = createServer((req, res) => { |
| 75 | 79 | const ruta = req.url.split('?')[0]; |
| 76 | 80 | if (ruta === '/') { |
| @@ -85,13 +89,10 @@ | ||
| 85 | 89 | await new Promise(r => srv2.listen(0, '127.0.0.1', r)); |
| 86 | 90 | const APP = `http://127.0.0.1:${srv2.address().port}`; |
| 87 | 91 | |
| 88 | -const rutas = [join(homedir(), 'work2026/elffuss-claw/tests/node_modules/playwright-core/index.mjs'), | |
| 89 | - join(homedir(), '.claude/skills/browser-post/node_modules/playwright-core/index.mjs')]; | |
| 90 | -const { chromium } = await import(rutas.find(existsSync)); | |
| 92 | +// Playwright y su navegador, los de estas pruebas (antes se buscaban en otros | |
| 93 | +// proyectos y se lanzaba el Chrome instalado). | |
| 91 | 94 | const perfil = mkdtempSync(join(tmpdir(), 'reanuda-')); |
| 92 | -const ctx = await chromium.launchPersistentContext(perfil, { | |
| 93 | - channel: 'chrome', ignoreDefaultArgs: ['--use-mock-keychain'], | |
| 94 | -}); | |
| 95 | +const ctx = await chromium.launchPersistentContext(perfil, {}); | |
| 95 | 96 | const p = await ctx.newPage(); |
| 96 | 97 | p.on('pageerror', e => console.log('· PAGEERROR: ' + e.message.slice(0, 120))); |
| 97 | 98 |
modified tests/retry-test.mjs +3 −1
| @@ -4,7 +4,9 @@ | ||
| 4 | 4 | import { chromium } from 'playwright'; |
| 5 | 5 | const b = await chromium.launch({ channel: 'chrome', headless: true }); |
| 6 | 6 | const p = await (await b.newContext()).newPage(); |
| 7 | -await p.goto('https://code.elffuss.com/', { waitUntil: 'domcontentloaded' }); | |
| 7 | +// Por defecto contra producción, como siempre; BASE=… la corre contra otro | |
| 8 | +// servidor (un árbol local), que es lo que hace falta antes de desplegar. | |
| 9 | +await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' }); | |
| 8 | 10 | await p.waitForTimeout(1200); |
| 9 | 11 | const r = await p.evaluate(async () => { |
| 10 | 12 | const { Agent } = await import('/js/agent.js?v=' + Date.now()); |
modified tests/run-bateria.mjs +3 −1
| @@ -56,7 +56,9 @@ | ||
| 56 | 56 | |
| 57 | 57 | const b = await chromium.launch({ channel: 'chrome', headless: true }); |
| 58 | 58 | const p = await (await b.newContext()).newPage(); |
| 59 | -await p.goto('https://code.elffuss.com/', { waitUntil: 'domcontentloaded' }); | |
| 59 | +// Por defecto contra producción, como siempre; BASE=… la corre contra otro | |
| 60 | +// servidor (un árbol local), que es lo que hace falta antes de desplegar. | |
| 61 | +await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' }); | |
| 60 | 62 | await p.waitForTimeout(1200); |
| 61 | 63 | |
| 62 | 64 | const res = await p.evaluate(async (CASOS) => { |