Ghost/ghost/core/test/e2e-browser
Rishabh aa693039a3 🐛 Removed expired offers shown in portal account detail
closes https://github.com/TryGhost/Team/issues/2376#event-8026429598

- if an offer is expired/in past, we no longer show it in member account info against the price
- one-time offers are never showed in portal in member account detail, as the payment information shown to member in Portal points to charge at next payment
- if trial days are over for a subscription, portal doesn't show any offer data on member account detail
2022-12-14 15:27:49 +05:30
..
admin Improved count of items in e2e tests (#15986) 2022-12-12 16:51:31 +04:00
portal 🐛 Removed expired offers shown in portal account detail 2022-12-14 15:27:49 +05:30
site-settings Added Playwright "Private site" test 2022-12-09 14:01:19 +07:00
utils
README.md

Browser testing

Install

As per the docs, run the following to install the supported browsers for Playwright:

npx playwright install

Running tests

Run the browser test suite with yarn test:browser.

Record test instructions

After installing PlayWright, start to record tests using yarn test:browser:record.

Available flags:

  • --admin - Runs a test starting in Ghost Admin
  • --no-setup - When testing Ghost Admin, prevents the automated setup from running (for testing the setup wizard)
  • --fixtures="posts,users" - Install a set of fixtures, given as a comma-delimited list

When the window loads, hit the record button and click around. All of the link click steps will need to be tidied up to use better selectors, and any page.goto calls should be dropped (as they are likely a result of clicking links). The test generator is a useful assistant, but be wary of taking anything it generates as correct.

Writing tests

Recording tests will allow you to execute the steps in a browser that a user would follow. It's important to add assertions to ensure that we're not just testing that the site doesn't crash, but that we see the expected values on the page.

The test suite uses beforeAll and afterAll to setup Ghost and install fixtures. Each set of fixtures should have a new describe block to start a new instance of Ghost to be tested against.