Skip to content

[Enhancement] Playbook Mock-Page Unit Test Runner #53

Description

@rickcedwhat-ai

Problem Description

Validating playbook changes currently requires running the full end-to-end integration tests, which require databases, backends, and long execution times (3-7 minutes).

Proposed Solution

Expose a unit-testing harness that executes plays against static mock HTML strings or local templates:

import { testPlay } from '@rickcedwhat/playwright-sugar/test-utils';

test('branches correctly on readOnly page state', async () => {
  const mockHtml = '<button disabled>Save</button>';
  const result = await testPlay(projectPb.update, mockHtml);
  
  expect(result.outcome).toBe('readOnly');
});

This enables playbooks to be unit-tested in milliseconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked by another issueplaybook-frameworkBelongs to the future RBAC/playbook library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions