Skip to content

Latest commit

 

History

History
83 lines (66 loc) · 1.99 KB

README.md

File metadata and controls

83 lines (66 loc) · 1.99 KB

Playwright Automation framework (Page object model)

This framework is designed to be used as a boilerplate template to start automation testing quickly for any web application. The page object model is used to structure the test.

Built With

Installation

Prerequisites: NodeJS 14(or above) and Java 8 (or above)

- npm install
  • Install Playwright browsers
- npx @playwright/test install

Usage

  • Run all the spec files present in the "./tests" directory by using the below command
npm run test
  • Run specific spec file
npx playwright test tests/{specfile_name.ts}
  • To generate allure report
npm run test:reporter 
npm run open:allure-report

Docker

  • Directly use docker compose file with below command
docker-compose -f docker-compose.yml up

OR use below

  • To run tests in docker containers, install docker and use the below commands to compose the docker image from the docker file;
docker build -t {give image name} .   
  • To create the container and launch it use:
docker run -it -d {same image name as in the previous command}
  • Check the container is up and running; copy the container id
docker ps -a 
  • Login in to the running container
docker exec -it {container id} bash
  • Run the commands as per need in the docker bash;
npm run test

GitHub Actions

  • The workflow file is in directory .github/workflows named playwright.yml
  • Every push or pull request action will trigger the workflow
  • Results can be seen on the 'Actions' tab in the repo.

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change.