| name | acceptance-tests |
| description | Write or modify Playwright API acceptance tests in activiti-cloud-acceptance-tests-playwright/. Use when adding, editing, or reviewing *.spec.ts files, services, fixtures, flows, resources, notifications WebSocket clients, or any TypeScript under activiti-cloud-acceptance-tests-playwright/. Triggers on: acceptance test, playwright test, spec file, activiti fixture, notifications subscription. |
Acceptance Tests (Playwright API)
Before making any change, read the full canonical guidelines:
.github/instructions/acceptance-tests.instructions.md
These are API-level tests — no browser UI, page objects, or locators. Tests call REST APIs via the activiti fixture and GraphQL WebSocket subscriptions via services/notifications/.
Non-negotiable rules
- Never create
tests/**/helpers/ — API calls in services/, shared flows in flows/, assertions in specs.
- Never define functions inside spec files — only hooks and test blocks (except
for...of at describe scope).
- Keep API calls in service/endpoint classes — query/audit use hxp layout: one facade per service (
QueryService, AuditService) with user + admin endpoint fields; endpoints use admin: boolean where paths differ. Specs call service.<endpoint>.<method>() for raw HTTP; use facade methods for waitFor*, find*, status checks, and health checks only.
- Keep static test data in
resources/modeling-projects/ — no inline BPMN/JSON templates.
- No comments or JSDoc in generated code.
- No
try/catch in spec files — use afterEach/afterAll for cleanup; use helpers/query-sync.ts for tolerant polling.
- Cleanup in hooks only — last statement in every test body must be
expect.
- Import
activiti/expect from fixtures/services.fixture — never from @playwright/test.
- Never wrap
expect in try/catch, if, switch, loops, or ternary — separate tests per scenario.
- Use
activiti.step() for multi-phase tests — mandatory when a test has 2+ API calls or distinct phases.
- Register skips via
pickScenarioTest + Jira ticket — not bare inline activiti.skip().
- No REST paths in specs — URLs live in
services/*.service.ts only.
- No service class imports in specs for status checks — use fixture service instances (
queryService.build…()). Shared HTTP helpers on BaseService only.
Architecture (this repo)
activiti fixture → services → BaseService → ContextFactory
flows/ — shared process start patterns
services/notifications/ — GraphQL WebSocket engine events
Typical spec import:
import { activiti, expect } from "../../fixtures/services.fixture";
Playwright projects: acceptance → notifications (serial) → destructive-last (@destructive).
After edits from activiti-cloud-acceptance-tests-playwright/:
npm run typecheck
npm run lint:fix