This is a public repository I created showcasing my skills and knowledge in Playwright. This is a Playwright git repository that includes some E2E Tests that has been developed from scratch for a demo website 'https://practicesoftwaretesting.com/' . This is entirely for practise purpose and whoever wanting to learn can use it too. In addition to that if there's any suggestion and improvement you believe I can make here, feel free to email me here [email protected] This repo is still on developing phase as I keep on adding the test cases or improve the existing ones.
- Playwright with TypeScript
- Page Object Model (POM)
- Simple and easy to understand Test Architecture
- Base URL Configuration
- Authentication Handling
- Snapshot test included
- Test has been categoried into different components
- All the features that are available only after login has been separated
- Similar features are bundled in same test
- Test are run in headless by default
- Reports are generated by default
Pre-requisite Ensure you have the following installed before setting up Playwright:
- Node.js (>= 16.x)
- Download and install from Node.js official site
- npm or yarn (Comes with Node.js)
⚙️ Setup Instructions
- Clone this Repository in your machine
- Open the repo from the Visual Studio or any IDE you installed
- Install Playwright:
npm install npx playwright install
Running Tests The test are usuaky categorized in such a way that they might or moght not need login session. Currently there's 2 kinds of test in this repo
- e2e-after-logins > [this is test with logged in user]
- e2e-without-logins > [this doesn't need login]
- Other test [IN PROGRESS]
-
To run tests that needs login as first step which is under folder e2e-after-logins:
npx run test:authorized
-
To run tests that doesn't need login which is under folder e2e-without-logins:
npx run test:uauthorized
-
To run all the test in parallel [Remember, the tests are categories as with/without loins]:
npx run test:all:parallel
-
To generate an HTML report after test execution: No matter what kind of test you run, it is configured in such a way that it will generate the report
- Open the report using:
npx playwright show-report
- Open the report using:
📞 Need Help? If you have any issues, feel free to open an issue or pull request. 🚀