mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Enabled browser-based tests to start Ghost with default test fixtures
refs: https://github.com/TryGhost/Toolbox/issues/479
This commit is contained in:
parent
bbbef3555f
commit
49605a9559
@ -32,7 +32,8 @@
|
||||
"test:integration": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/integration' --timeout=10000",
|
||||
"test:e2e": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/e2e-api' './test/e2e-frontend' './test/e2e-server' './test/e2e-webhooks' --timeout=15000",
|
||||
"test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000",
|
||||
"test:browser": "playwright test --browser=all test/e2e-browser",
|
||||
"test:browser": "NODE_ENV=testing playwright test --browser=all test/e2e-browser",
|
||||
"test:browser:start": "node test/e2e-browser/bin/ghost",
|
||||
"test:ci": "c8 -c ./.c8rc.e2e.json yarn test:ci:base",
|
||||
"test:ci:base": "yarn test:e2e -b",
|
||||
"test:unit:slow": "yarn test:unit --reporter=mocha-slow-test-reporter",
|
||||
|
15
ghost/core/playwright.config.js
Normal file
15
ghost/core/playwright.config.js
Normal file
@ -0,0 +1,15 @@
|
||||
const ghostConfig = require('./core/shared/config');
|
||||
|
||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||
const config = {
|
||||
timeout: 10 * 1000,
|
||||
webServer: {
|
||||
command: 'yarn test:browser:start',
|
||||
url: ghostConfig.get('url')
|
||||
},
|
||||
use: {
|
||||
baseURL: ghostConfig.get('url')
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = config;
|
7
ghost/core/test/e2e-browser/bin/ghost.js
Normal file
7
ghost/core/test/e2e-browser/bin/ghost.js
Normal file
@ -0,0 +1,7 @@
|
||||
const testUtils = require('../../utils');
|
||||
|
||||
async function startGhost() {
|
||||
await testUtils.startGhost();
|
||||
}
|
||||
|
||||
startGhost();
|
@ -1,8 +1,8 @@
|
||||
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);
|
||||
test.describe('Ghost frontend', function () {
|
||||
test('Loads the homepage', async ({page}) => {
|
||||
const response = await page.goto('/');
|
||||
expect(response.status()).toEqual(200);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user