Skip to content

Latest commit

 

History

History
 
 

tests

Playwright tests

Prerequisites

  • Node.js and npm
  • Java 17
  • jq
  • Docker Engine 19.03.0+
  • Preferably the latest docker-compose

Usage

  1. Clone the repo and go to its directory

  2. Build ODD Platform's docker image locally:

    ./gradlew jibDockerBuild -x test --image odd-platform:e2e-latest-build
    

    or use the following command if your environment is ARM based

    ./gradlew jibDockerBuild -x test --image odd-platform:e2e-latest-build -PcontainerBuildArm=true
    
  3. Go to tests directory

  4. Install dependencies:

     npm install
    
  5. Install browsers:

     npx playwright install --with-deps chromium
    
  6. Configure and run ODD Platform (inside the docker containers):

     npm run odd-up
    

    Note: Check the instructions in Step 1 of this manual if you encounter any problems.

  7. Run test suite:

    • in headful mode:

        npm test
      
    • or in headless mode:

        npm run test:ci
      
  8. Tear down all parts of the ODD platform (i.e. stop and remove containers):

     npm run odd-down
    

Useful commands

  • npm run lint to run linter
  • npm run format to run code formatter
  • npm run lint:fix to fix fixable linter issues and run code formatter

Setup user friendly development environment

  1. Install the ESLint plugin to lint your code

  2. Install the Prettier plugin to automatically format your code on Save

  3. Open a project from the "tests" directory, so that the ESLint and Prettier plugins work correctly in the text editor

Notes

  1. Do the following if you want to run tests in CI to check your changes in your feature branch without creating a pull request:
    • create a feature branch with a name that starts with "debug/" (for instance: debug/my_wonderful_tests)