1a0362f3db
refs https://github.com/TryGhost/Toolbox/issues/207 - we want to start writing some E2E tests that involve automated pointing and clicking around the frontend of Ghost to test that members of Ghost sites can still do what we expect - we've decided to look in to Playwright for this - it looks __really__ nice - this is a VERY basic first test - it'll check for a 200 on the homepage of whatever we provide as the TEST_URL env variable, or default to a (manually-run) Ghost instance on port 2368 - also adds a `yarn test:browser` command to run the tests using the Playwright CLI, and a sample GitHub Action workflow which we can manually run with a site URL - there's a lot more to add here in terms of test framework but this gets us started
9 lines
256 B
JavaScript
9 lines
256 B
JavaScript
const {expect, test} = require('@playwright/test');
|
|
|
|
let siteUrl = process.env.TEST_URL || 'http://localhost:2368';
|
|
|
|
test('Homepage is 200', async ({page}) => {
|
|
const response = await page.goto(siteUrl);
|
|
expect(response.status()).toEqual(200);
|
|
});
|