fair-plugin/package.json
Chuck Adams 3c57ec48e0
Phase 11: browser test harness + 15 accessibility-first Playwright tests
tests/browser/package.json: isolated @playwright/test deps
tests/browser/playwright.config.ts: chromium, auth state, CI retries
tests/browser/global-setup.ts: login as browser_admin, save storage
tests/browser/specs/direct-install.spec.ts (9 tests):
  - Input label (screen-reader-text), pattern, required
  - Submit button keyboard accessible
  - HTML5 validation prevents invalid DID submit
  - Thickbox modal: role=dialog, aria-label, iframe title
  - Close button accessible name
  - All pass against actual DOM (tab=fair_direct, .fair-direct-install__form, #plugin_id)

tests/browser/specs/search-did.spec.ts (6 tests):
  - Search input accessible label (getByRole searchbox)
  - Known DID returns result card
  - Unknown DID shows no results
  - Install button accessible name + focusable
  - Repository hostname visible
  - Card heading hierarchy

root package.json: test:browser, test:browser:headed, test:browser:docker:{start,stop,seed} scripts

All 15 tests pass. Zero leftover containers confirmed.

Signed-off-by: Chuck Adams <chaz@chaz.works>
2026-06-09 13:58:04 -06:00

27 lines
1.8 KiB
JSON

{
"devDependencies": {
"@wordpress/env": "^10.22.0"
},
"scripts": {
"env": "wp-env",
"cli": "wp-env run cli --env-cwd=wp-content/plugins/plugin",
"lint:php": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run lint",
"lint:php:phpcs": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run lint:phpcs",
"lint:php:phpstan": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run lint:phpstan",
"format:php": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run format",
"format:php:phpcs": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run format:phpcs",
"format:php:phpstan": "wp-env run cli --env-cwd=wp-content/plugins/plugin composer run format:phpstan",
"test:php:install-deps": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer install --ignore-platform-req=ext-gmp",
"test:php": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer run test:unit",
"test:php:multisite": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer run test:unit:multisite",
"coverage:php:single": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer run coverage:single",
"coverage:php:multisite": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer run coverage:multisite",
"coverage:php:full": "wp-env run tests-cli --env-cwd=wp-content/plugins/plugin composer run coverage:full",
"test:browser": "cd tests/browser && npm run test",
"test:browser:headed": "cd tests/browser && npm run test:headed",
"test:browser:install": "cd tests/browser && npm install",
"test:browser:docker:start": "cd tests/browser && npm run start-docker",
"test:browser:docker:stop": "cd tests/browser && npm run stop-docker",
"test:browser:seed": "cd tests/browser && npm run seed"
}
}