Skip to content

ashik-e-rabbani/qa-candidate-assessment

Repository files navigation

QA candidate assessment (Automation Suite)

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 .

Technologies Used

  • 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

Project Structure

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

Setup Instructions

Prerequisites

Ensure the following are installed on your system:


Installation Steps

  1. Clone the Repository

    git clone https://github.com/ashik-e-rabbani/qa-candidate-assessment.git
  2. Change the Directory

    cd qa-candidate-assessment
    
  3. Install Dependencies

    npm install
  4. Set Up Environment Variables

    • Duplicate the sample.env file and rename it to .env;
    • Don't forget to replace dummy values of .env file with the actual one.

Test Execution / Running tests locally

1. UI Tests (Cypress)

Run tests in headless mode
npx cypress run

Or use the NPM script:

npm run testUi
Run tests in GUI mode
npx cypress open
Run tests with report
npm run testUi && npm run report:merge && npm run report:generate

2. API Tests (Newman)

Execute Postman Collection
newman 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.json

Or via NPM script:

npm run testApi

Note: Those postman collections and environment json are exported from Postman.

Run API Tests with HTML Report
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.html

Or use npm script:

npm run testApiWithReport

Replace *_collection.json and *_environment.json with your specific filenames if they differ.

3. Performance Tests (k6)

Run Load Test
k6 run performance-tests/tests/createOrderTest.js

This 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

GitHub Actions Workflow automates:
  • 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

About

Cypress for UI testing, Newman for Postman API testing, and K6 for performance testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors