Skip to content

Commit

Permalink
pw config up
Browse files Browse the repository at this point in the history
  • Loading branch information
matej21 committed May 25, 2023
1 parent 09e2f4d commit 7258a09
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
run: ${{ matrix.run_script }}

playwright:
needs: [test]
needs: []
runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.32.3-focal

Expand Down Expand Up @@ -141,7 +141,6 @@ jobs:
- name: Prepare for playwright tests
run: |
yarn run build:js:prod
yarn run admin:pw:build
- name: Run playwright tests
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ services:
- .:/src:cached

playwright:
image: mcr.microsoft.com/playwright:v1.32.3-focal
image: node:16-alpine
command: [ 'npm', 'run', 'pw:dev' ]
user: '1000:1000'

environment:
DISPLAY: ${DISPLAY}
CONTEMBER_API_URL: 'http://contember-engine:4000'
VITE_CONTEMBER_ADMIN_SESSION_TOKEN: '0000000000000000000000000000000000000000'
VITE_CONTEMBER_ADMIN_API_BASE_URL: 'http://localhost:3001'
Expand All @@ -69,15 +68,16 @@ services:

playwright-tests:
image: mcr.microsoft.com/playwright:v1.32.3-focal
command: [ 'npm', 'run', 'pw:dev' ]
scale: 0
command: [ 'sh' ]
user: '1000:1000'

environment:
DISPLAY: ${DISPLAY}
VITE_CONTEMBER_ADMIN_API_BASE_URL: 'http://playwright-contember-engine:4000'
VITE_CONTEMBER_ADMIN_SESSION_TOKEN: '0000000000000000000000000000000000000000'

working_dir: /src/packages/admin
working_dir: /src
volumes:
- .:/src:cached

Expand Down
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
"deploy": "yarn workspaces foreach -pt run deploy",
"eslint:fix": "eslint --fix \"**/*.{ts,tsx}\" ",
"eslint:lint": "eslint \"**/*.{ts,tsx}\" ",
"pw:build": "cd packages/admin && docker-compose run --rm playwright-tests yarn run pw:build",
"pw:preview": "cd packages/admin && docker-compose run --rm playwright-tests yarn run pw:preview",
"pw:report": "cd packages/admin && yarn run pw:report",
"pw:update": "yarn run pw:build && yarn run pw:update-only",
"pw:update-only": "cd packages/admin && docker-compose run --rm playwright-tests yarn run pw:update",
"pw:test": "yarn run pw:build && yarn run pw:test-only",
"pw:test-only": "cd packages/admin && docker-compose run --rm playwright-tests yarn run pw:test",
"pw:debug": "yarn run pw:build && yarn run pw:debug-only",
"pw:debug-only": "cd packages/admin && docker-compose run --rm playwright-tests yarn run pw:debug",
"start": "docker-compose up --detach && yarn run contember migrations:execute . --yes",
"storybook": "cd packages/ui && yarn run storybook",
"test": "yarn workspaces foreach -pt run test --run",
Expand All @@ -30,12 +21,19 @@
"ae:build": "yarn workspaces foreach -pt run ae:build",
"ae:update": "yarn run clean:generated && yarn run ts:build --clean && yarn run ts:build && yarn run ae:build",
"ae:test": "yarn workspaces foreach -pt run ae:test",
"build:js:prod": "yarn workspaces foreach run build",
"build:js:prod": "yarn workspaces foreach -p run build:js:prod",
"build:css": "yarn workspaces foreach -p run yarn build:css",
"pw:build": "docker-compose run --rm playwright-tests yarn run admin:pw:build",
"pw:debug": "yarn pw:build && yarn pw:debug-only",
"pw:debug-only": "docker-compose run --rm playwright-tests yarn run admin:pw:debug",
"pw:test": "yarn pw:build && yarn pw:test-only",
"pw:test-only": "docker-compose run --rm playwright-tests yarn run admin:pw:test",
"pw:update": "yarn pw:update && yarn pw:update-only",
"pw:update-only": "docker-compose run --rm playwright-tests yarn run admin:pw:update",
"admin:pw:build": "yarn workspace @contember/admin run pw:build",
"admin:pw:preview": "yarn workspace @contember/admin run pw:preview",
"admin:pw:update": "yarn workspace @contember/admin run pw:update",
"admin:pw:report": "yarn workspace @contember/admin run pw:report",
"admin:pw:debug": "yarn workspace @contember/admin run pw:debug",
"admin:pw:test": "yarn workspace @contember/admin run pw:test",
"admin:pw:update": "yarn workspace @contember/admin run pw:update",
"vite": "cd packages/admin-sandbox && yarn run start",
"as:build": "yarn workspace @contember/admin-server run build"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"build:css": "sass --no-charset src/index.sass:dist/assets/index.css && yarn build:css:copy-fonts",
"build:css:copy-fonts": "rm -rf \"dist/assets/Inter\" && cp -R \"../ui/src/assets/Inter\" \"dist/assets/Inter\"",
"pw:build": "vite build tests/playwright/admin",
"pw:preview": "vite preview tests/playwright/admin",
"pw:dev": "vite dev tests/playwright/admin",
"pw:update": "playwright test --update-snapshots",
"pw:preview": "vite preview tests/playwright/admin",
"pw:debug": "playwright test --debug --project='Desktop Chrome'",
"pw:report": "playwright show-report tests/playwright/admin",
"pw:test": "playwright test",
"pw:debug": "playwright test --debug --project='Desktop Chrome'",
"pw:update": "playwright test --update-snapshots",
"ae:build": "api-extractor run --local",
"ae:test": "api-extractor run",
"test": "vitest --environment jsdom tests/vitest"
Expand Down

0 comments on commit 7258a09

Please sign in to comment.