/playwright-moralis-project

Test Automation of Moralis endpoints using Playwright

Primary LanguageTypeScript

Test Automation for Moralis Endpoints Using Playwright

This project contains automated tests using Playwright and k6 for the following Moralis endpoints:

How To Run test project

  1. Clone this repository:

    git clone https://github.com/your_username/playwright-moralis-project.git
  2. Navigate to the project directory:

    cd playwright-moralis-project
  3. Install all project dependencies:

    $npm install //This installs all Playwright dependencies

    and

    $brew install k6 //This installs k6 and its dependencies
  4. To run Playwright tests, create a .env file, copy paste the following code and edit file with valid values

    MORALIS_NODE_API_KEY_CORRECT=
    MORALIS_WEB3_API_KEY_CORRECT=
    MORALIS_NODE_API_KEY_WRONG=
    MORALIS_WEB3_API_KEY_WRONG=
    EMAIL=
    PASSWORD=
    

    The values for Moralis keys were gotten after creating an account and signing into Moralis Admin

    Then run tests using the below commands:

    $npm run test //This will run all playwright test files

    or

    $npm run test tast-1.spec.ts //This runs specific playwright test files

    The test runs with headless mode set to false so the test's interraction with the browser is visible and all test results are displayed in a UI at the end of each test run

  5. To run load test with k6, from root folder, run

    $k6 run k6-load-test.js //This will faill all load test which is a negative test case to ensure users use the correct authentication for each end point.

    To run k6 tests with valid authentication, set an environment variable in terminal using your personal moralis endpoint API and and Web3 endpoint keys gotten after creating an account and signing into Moralis Admin

    $k6 run k6-load-test.js -e <moralis-node-api-key> -e <moralis-web3-api-key>

Automated Tests Performed on Endpoints

  • Functional Tests
  • UI Tests
  • API Contract tests
  • Load tests