Instrucciones para Playwright Test y JavaScript

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

Configurando sus pruebas con Playwright Test y JavaScript

Free Trial
Not for use with personal data
  1. 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
  2. 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
    })
  3. 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')
  4. Ya está todo listo.