This project is a technical task designed to demonstrate the implementation of scalable and extensible test framework for running UI, API and load tests using Playwright and K6 frameworks.
- Authentication: Utilize UI authentication to save session cookies, significantly reducing the time required to authenticate into the Moralis Admin app and enabling efficient UI and API interactions.
- UI & API Tesing integration: Playwright is used to automate testing scenarios, including UI authentication, functional and end-to-end (E2E) tests, as well as API response validation.
- Load Testing integration: Utilizes K6 for load testing, to test performance under various traffic conditions.
- Pre Commit Verification: Ensures code quality by automatically running linting checks on your code before each commit using Husky.
- Node.js installed (v20.*).
- bun installed.
- K6 framework installed.
- Clone the repository:
git clone https://github.com/itev4n7/moralis-tech-task.git && cd moralis-tech-task
- Install dependencies:
bun install
- Install Playwright browsers:
bun playwright install
- Environment variables: Create a
.env
file based on the provided.env.sample
and fill in the required parameters.
-
Setup Authentication:
- Run the setup script to login and retrieve an auth token:
bun run setup-auth
- Run the setup script to login and retrieve an auth token:
-
UI Playwright tests:
- Run the UI tests using Playwright (before first execusion you need to run
setup-auth
script):bun run test-ui
- Run the E2E tests using Playwright (before first execusion you need to run
setup-auth
script):bun run test-e2e
- Run the UI tests using Playwright (before first execusion you need to run
-
API Playwright tests:
- Run the UI tests using Playwright (before first execusion you need to run
setup-auth
script):bun run test-api
- Run the UI tests using Playwright (before first execusion you need to run
-
Run Load Tests with K6:
- Execute the load tests using K6 (before first execusion you need to run
setup-auth
script):bun run test-k6-load
- Execute the load tests using bash script:
./scripts/run-load-test.sh
- Execute the load tests using K6 (before first execusion you need to run
This project is licensed under the MIT License.