Skip to content

faticamer/playwright-testing

Repository files navigation

Playwright Automation Framework (POM)

version license MIT
This framework is designed and built to enable cross-browser web automation. It supports Node.js, Python, Java and .NET

Built With

Prerequisites

Running locally

You can clone this repository in the terminal:

git clone https://github.com/faticamer/playwright-testing.git

After cloning the repository, navigate into it and run command below to install all dependencies

npm install

Installation

Directory and package setup

  • Navigate to the project directory inside your terminal and run:
npm init playwright@latest

After running the command, you will be offered to install Playwright Browsers. Or, you can do it manually:

npx playwright install

Configure Typescript

  • Within the same directory, run this command to generate tsconfig.json:
npx tsc --init

Before running tests, ensure that the test directory path is valid

  • Locate playwright.config.ts file
  • Find config and set testDir: './tests'

To run all tests, locate your package.json file and add script:

"test": "npx playwright test",
"test:reporter": "npx playwright test tests/fwkTesting.spec.ts --headed --reporter=allure-playwright",
"open:allure-report": "npx ./allure generate ./allure-results && allure open"

Usage

To run all tests, run this command:

npm run test

This will run all tests inside the terminal and open the localhost port where report will be generated.

You can manually access the report by running this command:

npx playwright show-report

If you want to run a single test file, you can modify the command accordingly:

npx playwright test tests/{specfile_name.ts}

Make sure to remove curly braces when you specify the file name.

Playwright's UI

If you want to open the Playwright's UI for running test, run this command:

npx playwright test --ui

Contributions

This is a collaborative project, but PR's are welcome. For any major changes, please open an issue first to discuss what you would like to change.

About

Automated Testing for SwagLabs Webpage ⚙️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published