Instrucciones para Playwright Test y JavaScript
Configurando sus pruebas con Playwright Test y JavaScript
Not for use with personal data
-
En el nivel raíz de su carpeta de pruebas, instale el paquete @axe-core/watcher y todas sus dependencias usando npm o su administrador de paquetes preferido (por ejemplo, Yarn o pnpm).
npm install --save-dev @axe-core/watcher
-
Cree un archivo fixtures.js junto con sus pruebas de Playwright Test existentes. En este archivo, importe la función Playwright Test desde @axe-core/watcher:
const { playwrightTest } = require('@axe-core/watcher') const API_KEY = process.env.API_KEY module.exports = playwrightTest({ axe: { apiKey: API_KEY }, headless: false, // Any other Playwright configuration you’d pass to chromium.launchPersistentContext() here })
-
En sus archivos de prueba, reemplace las importaciones de test y expect de Playwright Test con su archivo fixtures.js :
const { test, expect } = require('@playwright/test') // Becomes: const { test, expect } = require('./fixtures')
-
Ya está todo listo.