WordPress.com End to End Tests
Automated end-to-end acceptance tests for the wp-calypso client and WordPress.com.
Resources
- Overview
- Setup
- Test Environment
- Running tests on your machine
- Running tests on CI
- Writing tests
- Library objects
- Style Guide
- Patterns, Tricks, and Gotchas
- Debugging
- Troubleshooting
- Environment Variable
Prerequisites
Calypso E2E requires the following:
- NodeJS at the version in the root package.json "engines" field. (Typically latest LTS.)
- The yarn version available in the repo.
- Dependencies such as Typescript and Playwright are installed via yarn, and you can find information about the versions we use in ./package.json.
Quick start
- install
homebrew.
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
- install
nvm.
brew install nvm
- install the required nodeJS version.
nvm install <node_version>
- use the installed nodeJS version.
nvm use <node_version>
- enable
yarnpackage manager.
corepack enable
- clone this repository
git clone https://github.com/Automattic/wp-calypso.git
- navigate to the cloned directory.
cd wp-calypso
From this point on, all commands are executed within the wp-calypso root directory.
- install project dependencies.
yarn install
- obtain the secrets decryption key.
export E2E_SECRETS_KEY='Calypso E2E Config decode key from the Automattic secret store>'
- decrypt the secrets file.
yarn workspace wp-e2e-tests decrypt-secrets
- transpile the packages.
yarn workspace wp-e2e-tests build --watch
- run test.
yarn workspace wp-e2e-tests test -- <test_path>
To run on calypso.localhost, don't forget the environment variable:
CALYPSO_BASE_URL=http://calypso.localhost:3000 yarn workspace wp-e2e-tests test -- <test_path>
Advanced setup
Please refer to the Advanced Setup page.
Contribute to E2E tests
Please refer to the Writing Tests and Style Guide pages.
Troubleshooting
Please refer to the Troubleshooting page.