Skip to content

fifernandez/playwright-typescript

Repository files navigation

playwright-typescript

This is a Playwright project for runing End-To-End automated test. With this, you can do frontend and backend test, or a mix of both.

Job Status Reports
Smoke Smoke Tests Allure Report Playwright Report Ortoni Report
Regression Regression Tests Allure Report Playwright Report Ortoni Report

Features:

Pre-Requisites:

For Beginners:

#1 - Clone the repo or manually download it.
#2 - Open a console inside the repo folder
#3 - Make sure you have Node correctly installed. If it is this command should display your node version:
node -v
#3 - Install project dependencies:
npm install
#4 - Install Playwright:
npx playwright install --with-deps
#5 - Run the tests:
npx playwright test --project=chrome --headed
#6 - Open the report:
npx playwright show-report

For developers:

Intalation

npm install
npx playwright install --with-deps

Runing the tests:

This command will run all the test for all the available browsers in headless mode.

npm run test
# or
npx playwright test

Parameters:

If you don't want to run the scripts and want something more specific use the next parameters.

Configuration File:

The file is under: 'config/.env'. This is where you must select the configurarion for you environment, xray reporting or add test accounts if needed. For better secutiry is not allowed to storage and commit secret values. You can add the variables but do not commit the values.

- Environment:

Use it to select in which environment you want to test. Available: qa, prod. Default: prod

On the configuration file fill the value for 'env_name' with one of the available ones.

- Browsers:

You can specify the browser you want to run. Available: chrome, firefox, safari, edge, backend. Default: when empty it will run for all. Note: When choosing backend it will run only backend tests, when choosing any of the browsers only frontend tests will be run.

    npx playwright test --project=chrome

By default browser will be headless and will run in the background. If you want to see it:

    npx playwright test --project=chrome --headed

- Tests Tags:

You can choose which test you want to run using test tags. Like:

    npx playwright test --grep @Smoke

You can also use operators like:

    npx playwright test --grep '@Smoke | @Regression'

- Running test in Parallel:

By default test will run sequentially, one after another. To speed things up, you can run test in parallel, so many browsers will open up and run each test. To do it, just change in the configuration file: runInParallel=true

Reports:

For seeing reports, after test execution run this commands.

  • Playwright:

    npx playwright show-report
  • Allure:

    npm run allureReport
  • Ortoni: Under: ortoni-report/index.html

  • Json and XML Junit: Files are saved under /test-results after tests execution.

Learn More

  • Playwright - to learn about Playright framework.

About

Web & Backend automation using playwright with typescript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors