This project will run E2E tests to make sure a block is passing basic Gutenberg tests.
Install Block Testing Framework
npm ci
Configure & Start Environment
npm run wp-env start
Modify folder permissions
docker exec -t $( docker ps -qf "name=tests" ) chmod -R 767 /var/www/html/wp-content
Run End to End Tests
PLUGIN_SLUG=my-block-plugin npm run test:e2e
For interactive tests
PLUGIN_SLUG=my-block-plugin npm run test:e2e:interactive
-
Generate a personal token in Settings > Developer Settings > Personal Access Tokens
-
Use the token to trigger a github action via API (replace the
{account}/{repo}
with your fork):curl -H "Authorization: token $GITHUB_PERSONAL_TOKEN" -H 'Accept: application/vnd.github.everest-preview+json' "https://api.github.com/repos/{account}/{repo}/dispatches" -d '{"event_type": "Test Block", "client_payload": {"slug": "plugin-slug" }}'
-
The action will appear in the "Actions" section of your repo.