API Automation Testing Starter Project that utilize Playwright Framework.
To use this starter project for API testing, please follow the installation guide provided below.
Clone this repository on your workspace with the following command:
git clone https://github.com/Whyu9-9/Playwright-API-Automation-Starter.git
Install the required npm package that needed to run the tools with the following command:
npm install
You will need to configure your .env file before running your tests. Copy the .env.example file, rename it, and fill in all the env variables. Contact your software engineer team to provide what you need.
This is the list of command that are available for you to run on this project. Some of this command including the usage of tools inside this project
# to copy necessary file before running npm run post-test command
npm run pre-serve
# to generate allure report
npm run post-test
# to start a web server on port 8081 that will show allure report
npm run allure:serve
# to run all available test cases on all available browser driver
npm run test
# to run all available test cases on single browser driver
npm run test-single
#to run one specific test case on single browser driver (usually we use this for debugging API testing code to see if the code is already running well or not)
#example: npx playwright test ecommerce/store-transaction/negative/scene2 --project=chromium
npx playwright test {module}/{feature_name}/{negative/positive}/{scene+order} --project=chromium
#to auto-generate API Testing data (run this before running auto-generate API testing code)
npm run generate-data
#to auto-generate API Testing code
npm run generate-test
Here is a list of documentation for easing your automation testing development
- Playwright API Testing Documentation
- Allure Playwright Documentation
- Generate Template File Documentation
- Typescript Documentation
- Mimetype Documentation
This repository is created and maintained by me myself