-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
42 lines (41 loc) · 1.4 KB
/
Copy pathplaywright.config.ts
File metadata and controls
42 lines (41 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig, devices } from "@playwright/test";
/**
* Los tests end-to-end existen por una razón concreta: el modo offline no se
* puede comprobar con jsdom. Hace falta un service worker de verdad, IndexedDB
* de verdad y una red que se pueda cortar de verdad.
*
* Corren contra el build de producción, no contra `vite dev`, porque el service
* worker y los datos estáticos sólo se comportan como en producción ahí.
*/
export default defineConfig({
testDir: "./tests/e2e",
// Descargar el dataset entero dentro de un test es lento por naturaleza.
timeout: 180_000,
expect: { timeout: 30_000 },
fullyParallel: false,
workers: 1,
reporter: process.env.CI ? "list" : "line",
use: {
baseURL: "http://localhost:5000",
trace: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
launchOptions: {
// Permite apuntar a un Chromium ya instalado en la máquina y
// evitar la descarga de navegadores.
executablePath: process.env.CHROMIUM_PATH || undefined,
},
},
},
],
webServer: {
command: "bun run build && bun run preview",
url: "http://localhost:5000",
reuseExistingServer: !process.env.CI,
timeout: 180_000,
},
});