Skip to content

Add integration test harness with playwright#4392

Open
jekkos wants to merge 4 commits intomasterfrom
feature/integration-tests
Open

Add integration test harness with playwright#4392
jekkos wants to merge 4 commits intomasterfrom
feature/integration-tests

Conversation

@jekkos
Copy link
Member

@jekkos jekkos commented Mar 4, 2026

  • Add basic Docker integration tests (run-integration-tests.sh)

    • Validates Docker stack startup
    • Checks login page accessibility and HTTP status
    • Verifies login form presence
  • Add Playwright E2E test suite

    • Login tests: valid/invalid credentials, protected pages
    • Items tests: create, update, verify in inventory table
    • Customers tests: create with details, search, table verification
    • Sales tests: full sale flow with items, customers, payment, and receipt validation
  • Configure Playwright with multi-browser support (Chrome, Firefox)

  • Add GitHub Actions workflow for CI/CD

    • Runs on push/PR to master
    • Includes both basic and Playwright tests
    • Uploads screenshots, traces, and logs on failure
  • Organize tests in integration-tests/ directory

  • Update package.json with test scripts

  • Include comprehensive documentation

This provides automated testing for core POS workflows including item management, customer management, and complete sales transactions with receipt generation verification.

- Add basic Docker integration tests (run-integration-tests.sh)
  - Validates Docker stack startup
  - Checks login page accessibility and HTTP status
  - Verifies login form presence

- Add Playwright E2E test suite
  - Login tests: valid/invalid credentials, protected pages
  - Items tests: create, update, verify in inventory table
  - Customers tests: create with details, search, table verification
  - Sales tests: full sale flow with items, customers, payment, and receipt validation

- Configure Playwright with multi-browser support (Chrome, Firefox)
- Add GitHub Actions workflow for CI/CD
  - Runs on push/PR to master
  - Includes both basic and Playwright tests
  - Uploads screenshots, traces, and logs on failure

- Organize tests in integration-tests/ directory
- Update package.json with test scripts
- Include comprehensive documentation

This provides automated testing for core POS workflows including
item management, customer management, and complete sales transactions
with receipt generation verification.
@jekkos jekkos changed the title Add integration test harness with Playwright E2E tests Add integration test harness with playwright Mar 4, 2026
objecttothis
objecttothis previously approved these changes Mar 6, 2026
The --wait flag causes CI to fail when init containers (like sqlscript)
exit successfully with code 0. The workflow already has a dedicated
'Wait for Application' step that polls the application endpoint.

Also remove redundant webServer config from playwright.config.ts since
the workflow handles container startup separately.
@jekkos
Copy link
Member Author

jekkos commented Mar 6, 2026

CI Fix Applied

The test failures were caused by docker compose up -d --wait treating the sqlscript init container's successful exit (code 0) as a failure.

Root Cause:

  • The sqlscript container is an init container that runs database migrations and exits normally
  • docker compose up -d --wait fails when any container exits, even with success code 0
  • This prevented the Playwright tests from ever running

Fix:

  1. Removed --wait flag from docker compose up command in the workflow
  2. The workflow already has a dedicated 'Wait for Application' step that polls the endpoint
  3. Removed redundant webServer config from playwright.config.ts since the workflow handles startup separately

The tests should now run properly once the CI re-runs.

…yntax error

- Add 'needs: integration' and 'if: always()' so playwright job runs
  even when integration job fails, ensuring screenshots get uploaded
- Fix npm run test command (remove incorrect cd into integration-tests)
- Fix JavaScript error: navigationOption used before declaration
- Add explicit outputDir and outputFolder in playwright config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants