Skip to content

playcanvas/editor-test

Repository files navigation

PlayCanvas Editor Testing Suite

User Manual | Forum

This is the official testing suite for the PlayCanvas Editor

Average time to resolve an issue Percentage of issues still open Twitter

Playwright

Tests

Tests are split into two categories:

  • test/api - tests for the Editor API behavior
  • test/ui - tests for the Editor UI behavior

Usage

To run the test suite ensure you have Docker installed. Follow these steps:

  1. Create a .env file based on the template

    PC_HOST=playcanvas.com
    PC_LOGIN_HOST=login.playcanvas.com
    PC_LAUNCH_HOST=launch.playcanvas.com
    PC_EMAIL=<playcanvas-email>
    PC_PASSWORD=<playcanvas-password>
    PC_LOCAL_FRONTEND=<true|false>

Important

The account used must be an existing account. Create one here

  1. Run the container with Docker compose

    docker compose up
  2. Stop the container with Docker compose

    docker compose down --remove-orphans

Note

To build the image from source instead of pulling from the registry append the --build flag

Local Development

To create new tests, ensure you have Node.js 18 or later installed. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/playcanvas/editor-test.git
    cd editor-test
  2. Install dependencies:

    npx playwright install --with-deps
    npm install
  3. Create tests and put them into the respective folders. For dynamic recording of tests run this command:

    npm run codegen

Note

Run npm run for the full list of npm scripts

Library integration testing

The testing suite is built on the following open source libraries:

Library Details
PlayCanvas Engine Powers the Editor's 3D View and Launch Page
Observer Data binding and history
Editor API Public API for Editor automation

To test the integration of these libraries use npm link. Follow these steps:

  1. Create a global link from source

    cd <library>
    npm run link
  2. Create a link to the global link

    cd editor-test
    npm run link <library>

About

The official PlayCanvas Editor testing suite built on Playwright

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages