This repository encompasses a comprehensive automation framework designed to validate the quality and performance of web applications. It contains:
- UI Testing: Automated the product purchasing flow tests using Cypress for the SauceDemo website.
- API Testing: Automated API tests using Newman for the Simple Grocery Store API.
- Performance Testing: Load and performance tests using k6 .
- UI Testing: Cypress
- API Testing: Postman collections executed via Newman
- Performance Testing: k6
- Reporting: mochawesome for UI, htmlxtra for API
- Design pattern : Page Object Model
- CI/CD: GitHub Actions
- dotenv for secure config management
qa-candidate-assessment/
├── .github/workflows/ # CI/CD workflows
├── api-tests/ # Postman collections and environment files
├── performance-tests/ # k6 scripts for load testing
├── ui-tests/ # Cypress tests and configurations
├── cypress.config.js # Cypress configuration file
├── package.json # Project dependencies and scripts
├── sample.env # environment variables (you need to create .env in root dir)
└── README.md # Project documentation
Ensure the following are installed on your system:
- Node.js (LTS version)
- Git
- k6
- Use an IDE like Visual Studio Code (optional)
-
Clone the Repository
git clone https://github.com/ashik-e-rabbani/qa-candidate-assessment.git
-
Change the Directory
cd qa-candidate-assessment -
Install Dependencies
npm install
-
Set Up Environment Variables
- Duplicate the
sample.envfile and rename it to.env; - Don't forget to replace dummy values of
.envfile with the actual one.
- Duplicate the
npx cypress runOr use the NPM script:
npm run testUi
npx cypress opennpm run testUi && npm run report:merge && npm run report:generatenewman run api-tests/Simple_Grocery_Store_API.postman_collection.json \
-e api-tests/sgsEnv.postman_environment.json
newman run api-tests/collection.json -e api-tests/environment.jsonOr via NPM script:
npm run testApi
Note: Those postman collections and environment json are exported from Postman.
newman run api-tests/Simple_Grocery_Store_API.postman_collection.json \
-e api-tests/sgsEnv.postman_environment.json \
-r htmlextra --reporter-htmlextra-export=api-tests/reports/api-test-report.htmlOr use npm script:
npm run testApiWithReportReplace *_collection.json and *_environment.json with your specific filenames if they differ.
k6 run performance-tests/tests/createOrderTest.jsThis will perform a minimal load test on POST /order of the Simple Grocery Store API.
Run load for the complete Cycle(Authenticate -> Pick products -> Add to carts -> Place order)
k6 run performance-tests/tests/createOrderTest.js --env fullCycle=true --env type=load
variable fullCycle can only be true, and type can be load, spike or stress
Also can be run by: npm run testLoadFull
- Installing dependencies
- Running Cypress tests
- Running Postman collections with Newman
- Running K6 performance tests
- Generating Results and Report (Will be avaiable for download under each GHA)
by Ashik E Rabbani