Automation test framework for API testing (home assignment). The project uses Mocha, Chai, and Supertest to validate the exercise API (create, read, update, delete main keys and quota behaviour).
- Key store quota limit – Creating keys up to the quota (10), fetching all keys, and cleanup.
- Update main key – Creating a key, updating its value, attempting update of a non-existing key, and cleanup.
- Node.js v18 LTS or v20 LTS (originally run on v16.14.1)
-
Clone the repository and go to the project folder.
-
Install dependencies:
npm install
-
Configure environment:
- Copy the example file:
cp .env.testing.example .env.testing - Open
.env.testingand set your API base URL, for example:BASE_URL=https://l761dniu80.execute-api.us-east-2.amazonaws.com
- Copy the example file:
Run all API tests (uses TEST_ENV=production and loads .env.testing):
npm run test:apiTests are in tests/api/. Default timeout is 60 seconds.
├── tests/
│ ├── api/ # API test specs
│ │ ├── keyStoreQuoteLimit-spec.js
│ │ └── updateMainKey-spec.js
│ ├── utilities/
│ │ ├── http-api-helper.js # API client (create, get, update, delete)
│ │ └── mainKeyValues-helper.js
│ └── config.js # Environment config (base URL)
├── .env.testing.example # Example env – copy to .env.testing
├── package.json
└── README.md
This code is part of an assessment for the QA hiring process and cannot be copied, reused, or distributed for other purposes.
Ana Marković