Skip to content

sanjeetkumaritoutlook/angular-playwright-e2e

Repository files navigation

AngularE2ePlaywright

This project was generated with Angular CLI version 17.3.13.

Setup angular 17 app, without global cli version conflict:

npx @angular/cli@17 new my-app

npx @angular/cli@17 new my-app --no-standalone

Running end-to-end tests (General)

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Run playwright

npx playwright test

npx playwright show-report

npx playwright show-trace

open browser manually (parallelly run ng serve in another terminal)

npx playwright test --headed

npx playwright test e2e/user-grid.spec.ts --headed

check if Allure results are actually being generated.

check if the allure-results/ folder is being created

npx playwright test --reporter=line,allure-playwright

If you haven't added the Angular Router yet:

ng g m app-routing --flat --module=app

๐ŸŒŸ How to View the Trace?

npx playwright show-trace test-results//trace.zip

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

About

angular 17 doesnt have default playwright option for e2e

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published