Skip to content
Version: XState v4

Playwright

Integrating with Playwright is simple with @xstate/test.

import { createTestMachine, createTestModel } from '@xstate/test';
import { test } from '@playwright/test';

const machine = createTestMachine({
// machine config
});

describe('My app', () => {
createTestModel(machine)
.getPaths()
.forEach((path) => {
test(path.description, async ({ page }) => {
await path.test({
states: {},
events: {},
});
});
});
});