Write browser-based tests for complex workflows, using real integrations to validate customer workflows.
Unlike our traditional end-to-end framework, these tests are designed to be run against a local instance or a staging site. This means that we have no access to fixtures or mocks — instead we need to instruct the browser to set things up in a resilient way to ensure our tests are reliable.
Playwright has some really great docs, located here:
To check whether something is as you expect, you can use Assertions:
gstenv eventually, but is currently achieved with: yarn test:browser:setup from the Ghost/ghost/core directorystripe login (this is used for Stripe webhooks)STRIPE_ACCOUNT_ID=acct_1234 \\
STRIPE_PUBLISHABLE_KEY=pk_test_1234 \\
STRIPE_SECRET_KEY=sk_test_12345 \\
yarn test:browser
Alternatively, you can export the keys or add them to your shell profile and then you only need to run yarn test:browser each time you run the tests.
This command will build and run Ghost, Admin, and all of the frontend apps like portal and comments locally, then run the browser test suite against them.