0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-30 22:34:01 -05:00

Added the ability to run browser tests using local Portal (#20990)

ref DOGM-32

Using the dev script as a template, this script runs the tests with
local copies of the applications needed instead of the released CDN
versions
This commit is contained in:
Sam Lord 2024-09-12 15:55:47 +01:00 committed by GitHub
parent 2e43017757
commit 625c89e37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View file

@ -58,6 +58,14 @@ const COMMAND_ADMIN = {
env: {}
};
const COMMAND_BROWSERTESTS = {
name: 'browser-tests',
command: 'nx run ghost:test:browser',
cwd: path.resolve(__dirname, '../../ghost/core'),
prefixColor: 'blue',
env: {}
};
const COMMAND_TYPESCRIPT = {
name: 'ts',
command: `while [ 1 ]; do nx watch --projects=${tsPackages} -- nx run \\$NX_PROJECT_NAME:build:ts; done`,
@ -86,6 +94,8 @@ if (DASH_DASH_ARGS.includes('ghost')) {
commands = [COMMAND_GHOST, COMMAND_TYPESCRIPT];
} else if (DASH_DASH_ARGS.includes('admin')) {
commands = [COMMAND_ADMIN, ...COMMANDS_ADMINX];
} else if (DASH_DASH_ARGS.includes('browser-tests')) {
commands = [COMMAND_BROWSERTESTS, COMMAND_TYPESCRIPT];
} else {
commands = [COMMAND_GHOST, COMMAND_TYPESCRIPT, COMMAND_ADMIN, ...COMMANDS_ADMINX];
}

View file

@ -343,7 +343,6 @@ jobs:
run: yarn nx run ghost-admin:build:dev
- name: Run Playwright tests locally
working-directory: ghost/core
run: yarn test:browser
env:
CI: true

View file

@ -37,6 +37,7 @@
"lint": "nx run-many -t lint",
"test": "nx run-many -t test",
"test:unit": "nx run-many -t test:unit",
"test:browser": "node .github/scripts/dev.js --browser-tests --all",
"main": "yarn main:monorepo && yarn main:submodules",
"main:monorepo": "git checkout main && git pull ${GHOST_UPSTREAM:-origin} main && yarn",
"main:submodules": "git submodule sync && git submodule update && git submodule foreach \"git checkout main && git pull ${GHOST_UPSTREAM:-origin} main\"",