This repository contains automated Playwright test scripts designed to verify core functionalities of the Amazon website, including:
- User login
- Search Functionality
- Product Checkout
- Wishlist Functionality
-
Cross-browser compatibility: Tests run seamlessly on Chromium, Firefox, and WebKit engines.
-
Detailed assertions: Assertions ensure expected behavior for each test case.
Open the terminal and run the command
npm init
npm init playwright@latest
This command will run all test files
npx playwright test
This command will run a single test file in the folder
npx playwright test \<File name>
This command will run the test in headed mode
npx playwright test \<File name> --headed
This command will run a test in a single browser in a headed mode
npx playwright test\<File name> -- project <Browser name> --headed
eg.
npx playwright test\<File name> -- project Chromium --headed
This command will run your tests with UI Mode for a better developer experience with time travel debugging, watch mode, and more.
npx playwright test --ui
This command will show you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests, and flaky tests. You can click on each test and explore the test's errors as well as each step of the test. By default, the HTML report is opened automatically if some of the tests failed.
npx playwright test show-report
To run the code locally you need to enter your amazon.in login credential at lines no 9 and 15 resp. of the test file