To run Playmatic tests locally, use the Playwright runner. All Playmatic SDK capabilities like AI actions and the environment manager are fully Playwright compatible, allowing you to get the benefit of AI reasoning with all the built-in tools of Playwright.Documentation Index
Fetch the complete documentation index at: https://docs.playmatic.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before running tests locally, ensure you have:- Node.js 18 or newer: Required for Playwright & Playmatic SDK
- Playmatic tests: Tests written in the
playmatic/directory - Configuration files:
playmatic.config.tsandplaywright.config.tsin your test directory
Step 1: Navigate to your test directory
Navigate to theplaymatic/ directory in your project root where your Playmatic tests are located:
Step 2: Install the dependencies to run tests locally
Step 3: Add your Playmatic API key
The API key is required for AI actions (likeaiClick and aiVerify) to work locally. Go to your Playmatic dashboard → Settings and create an API key. Then, add it to your shell environment:
Tests that only use standard Playwright actions will run without an API key. AI actions require authentication to the Playmatic service.
Step 4: Configure your test environment
Initialize your test environment in theplaywright.config.ts file. The environment determines which baseUrl and variables your tests will use.
playwright.config.ts
defaultEnv specified in your playmatic.config.ts. To run tests against a different environment, set the PLAYMATIC_TEST_ENV variable: