Skip to content

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.

Notifications You must be signed in to change notification settings

itev4n7/moralis-tech-task

Repository files navigation

Moralis Tech Task

Overview

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.

Features

  • 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.

Test Framework Structure

Diagram of Page Object Structure

Setup Instructions

Prerequisites

Installation

  1. Clone the repository:
    git clone https://github.com/itev4n7/moralis-tech-task.git && cd moralis-tech-task
  2. Install dependencies:
    bun install
  3. Install Playwright browsers:
    bun playwright install

Configuration

  • Environment variables: Create a .env file based on the provided .env.sample and fill in the required parameters.

Running Tests

  • Setup Authentication:

    • Run the setup script to login and retrieve an auth token:
      bun run setup-auth
  • 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
  • API Playwright tests:

    • Run the UI tests using Playwright (before first execusion you need to run setup-auth script):
      bun run test-api
  • 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

License

This project is licensed under the MIT License.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published