End‑to‑end Playwright test suite for the GCA Intranet WordPress application.
Assuming your on a mac and have brew installed, run the following to install node
brew install nvm
mkdir -p ~/.nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"' >> ~/.zshrc
echo '[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"' >> ~/.zshrc
source ~/.zshrc
nvm install --lts
nvm alias default node
node -v
npm -v
nvm use default
node -v
npm -vnpm install
npx playwright installnpm run testnpm run test:a11ynpm run test:headednpm run test:reportCreate .env.local in this repo:
PW_BASE_URL=http://localhost:8080
WP_DOCKER_CWD=/absolute/path/to/gca-intranet
WP_THEME=gca-intranetIf running parallel Docker stacks:
PARALLEL_LOCAL=true npm run test- Runs WordPress UI tests
- Ignores
tests/a11y - Uses global WP setup
- Runs only accessibility tests
- Shares base config
- Sets
PW_A11Y_RUN=true
Tests seed content using WP‑CLI via Docker:
- Create posts
- Upload featured images
- Activate theme
- Reset data between runs
Key env vars:
WP_DOCKER_CWD→ path to WordPress repoWP_SERVICE→ docker service (auto‑handled)WP_THEME→ theme to activate
e2e-tests/
│
├─ tests/
│ ├─ a11y/
│ └─ *.spec.ts
│
├─ src/
│ ├─ helpers/
│ ├─ pages/
│ ├─ utils/
│ └─ global-setup-wp.ts
│
├─ playwright.config.ts
├─ playwright.a11y.config.ts
└─ .env.local
After tests run:
npm run test:reportArtifacts:
playwright-report/test-results/- videos/screenshots on failure
- Tests run against local Docker WordPress
- Global setup ensures WP is installed and theme active
- Each worker gets isolated data via runId
- Featured images copied into container automatically