diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5079c2e9a4..9319bf49c8 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -72,9 +72,6 @@ jobs: restore-keys: | turbo-${{ github.job }}-${{ github.ref_name }}- - run: yarn - - run: yarn db-deploy - - run: yarn test - - name: Cache playwright binaries uses: actions/cache@v2 id: playwright-cache @@ -84,10 +81,11 @@ jobs: ~/.cache/ms-playwright **/node_modules/playwright key: cache-playwright-${{ hashFiles('**/yarn.lock') }} + - name: Install playwright deps if: steps.playwright-cache.outputs.cache-hit != 'true' run: yarn playwright install --with-deps - - run: yarn test-playwright + - run: yarn test-e2e - name: Upload videos if: ${{ always() }} diff --git a/README.md b/README.md index df939fc4cd..6740a342a2 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ yarn dx # In first terminal yarn dx # In second terminal -yarn workspace @calcom/web test-playwright +yarn workspace @calcom/web test-e2e # To open last HTML report run: yarn workspace @calcom/web playwright-report diff --git a/apps/web/package.json b/apps/web/package.json index 21a9c4ea48..4803769779 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -18,7 +18,7 @@ "deploy": "run-s build db-deploy", "dx": "env-cmd run-s db-setup dev", "test": "jest", - "test-playwright": "playwright test", + "test-e2e": "cd ../.. && yarn playwright test", "playwright-report": "playwright show-report playwright/reports/playwright-html-report", "test-codegen": "yarn playwright codegen http://localhost:3000", "type-check": "tsc --pretty --noEmit", diff --git a/package.json b/package.json index 82a7c4af1a..f3be640d9c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "start": "turbo run start", "test": "turbo run test", "test-playwright": "yarn playwright test", + "test-e2e": "turbo run test-e2e", "type-check": "turbo run type-check" }, "devDependencies": { diff --git a/playwright.config.ts b/playwright.config.ts index bed5d0cfb0..cfea12f0dc 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -24,7 +24,7 @@ const config: PlaywrightTestConfig = { globalSetup: require.resolve("./apps/web/playwright/lib/globalSetup"), outputDir: "./playwright/results", webServer: { - command: "yarn start --scope=@calcom/web", + command: "yarn workspace @calcom/web start", port: 3000, timeout: 60_000, reuseExistingServer: !process.env.CI, diff --git a/turbo.json b/turbo.json index 736d10b3b7..021f394fb1 100644 --- a/turbo.json +++ b/turbo.json @@ -1,7 +1,7 @@ { "$schema": "https://turborepo.org/schema.json", "baseBranch": "origin/main", - "globalDependencies": ["apps/web/.env"], + "globalDependencies": ["apps/web/.env", "packages/prisma/.env"], "pipeline": { "@calcom/web#db-deploy": {}, "@calcom/web#db-seed": { @@ -75,6 +75,9 @@ "test": { "dependsOn": ["@calcom/web#build", "@calcom/web#db-seed"] }, + "test-e2e": { + "dependsOn": ["^test"] + }, "type-check": { "outputs": [] }