Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
¿Cómo ejecutar pruebas angulares e2e con Playwright?

Me gustaría ejecutar pruebas de navegador de extremo a extremo (e2e) para mi aplicación Angular usando Playwright . Sin embargo, a partir de noviembre de 2021, no he podido encontrar un esquema angular para Dramaturgo.

Por ejemplo, hay un esquema angular oficial para Cypress . Esto permite ejecutar pruebas de Cypress e2e usando el comando:

 ng e2e

¿Hay alguna manera de ejecutar pruebas Angular e2e con Playwright sin escribir un esquema angular? ¿O hay un esquema angular para dramaturgo que me perdí?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Para iniciar un servidor durante las pruebas, use la opción webServer en el archivo de configuración.

 // playwright.config.ts import { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'npx ng serve', port: 4200, timeout: 120 * 1000, }, }; export default config;

Luego, el puerto se pasa a Playwright como una baseURL al crear el contexto.

 // test.spec.ts import { test } from '@playwright/test'; test('test', async ({ page, baseURL }) => { // baseURL is taken directly from your web server, // eg http://localhost:4200 await page.goto(baseURL + '/bar'); // Alternatively, just use relative path, because baseURL is already // set for the default context and page. // For example, this will result in http://localhost:4200/foo await page.goto('/foo'); });

Luego simplemente ejecute las pruebas con el comando npx playwright test .

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!