From 7258a09ff25d6ce6877e831aa6877b6756aab426 Mon Sep 17 00:00:00 2001 From: David Matejka Date: Thu, 25 May 2023 11:29:48 +0200 Subject: [PATCH] pw config up --- .github/workflows/ci.yaml | 3 +-- docker-compose.yaml | 8 ++++---- package.json | 24 +++++++++++------------- packages/admin/package.json | 6 +++--- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bdf2ac6b72..918e46f6af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml index 28b1bf9e02..62dd04f239 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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' @@ -69,7 +68,8 @@ 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: @@ -77,7 +77,7 @@ services: 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 diff --git a/package.json b/package.json index c2cbe6f0d3..2e438e6354 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" }, diff --git a/packages/admin/package.json b/packages/admin/package.json index 579207bd1e..22616c7925 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -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"