Skip to content

Commit

Permalink
One playwright config to rule them all (#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
zomars authored Sep 2, 2022
1 parent b09d727 commit d27b7ab
Show file tree
Hide file tree
Showing 60 changed files with 658 additions and 970 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/e2e-app-store.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: E2E App-Store Apps
on:
push:
branches: [ feature/event-routing ]
branches: [fixes/e2e-consolidation] # TODO: Remove this after merged in main
pull_request_target: # So we can test on forks
branches:
- main
Expand Down Expand Up @@ -86,14 +86,14 @@ jobs:
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
# if: steps.playwright-cache.outputs.cache-hit != 'true'
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- name: Run Tests
run: yarn app-e2e-quick
run: yarn test-e2e:app-store

- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results-core
path: packages/app-store/**/playwright/results
path: packages/app-store/**/playwright/results
2 changes: 1 addition & 1 deletion .github/workflows/e2e-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
# if: steps.playwright-cache.outputs.cache-hit != 'true'
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- name: Run Tests
run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: E2E test
on:
push:
branches: [fixes/e2e-consolidation] # TODO: Remove this after merged in main
pull_request_target: # So we can test on forks
branches:
- main
Expand Down
104 changes: 0 additions & 104 deletions .github/workflows/integrations-third-party.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/required-checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: "Meta Workflow: Require Conditional Status Checks"
on:
push:
branches: [fixes/e2e-consolidation] # TODO: Remove this after merged in main
pull_request:
branches:
- main
Expand Down Expand Up @@ -34,3 +36,7 @@ jobs:
paths:
- /apps/web/**
- /packages/embeds/**
- job: test
paths:
- /apps/web/**
- /packages/**
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Unit tests
on:
push:
branches: [fixes/e2e-consolidation] # TODO: Remove this after merged in main
pull_request_target: # So we can test on forks
branches:
- main
paths:
- apps/web/**
- packages/**
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
fetch-depth: 2
- run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV
- name: Use Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Be sure to set the environment variable `NEXTAUTH_URL` to the correct value. If
yarn test-e2e

# To open last HTML report run:
yarn workspace @calcom/web playwright-report
yarn playwright show-report test-results/reports/playwright-html-report
```

### Upgrading from earlier versions
Expand Down
5 changes: 0 additions & 5 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
"dev": "next dev",
"dx": "yarn dev",
"test-e2e": "NEXT_PUBLIC_IS_E2E=1 yarn playwright test --config=../../tests/config/playwright.config.ts --project=chromium",
"test-e2e-integrations": "NEXT_PUBLIC_IS_E2E=1 yarn playwright test --config=playwright-integrations/config/playwright.config.ts --project=chromium",
"test-e2e-integrations-quick": "QUICK=true E2E_DEV_SERVER=1 yarn test-e2e-integrations",
"db-setup-tests": "dotenv -e ./test/.env.test -- yarn workspace @calcom/prisma prisma generate",
"playwright-report": "playwright show-report playwright/reports/playwright-html-report",
"test-codegen": "yarn playwright codegen http://localhost:3000",
"type-check": "tsc --pretty --noEmit",
"build": "next build",
Expand Down
1 change: 0 additions & 1 deletion apps/web/playwright-integrations/.gitignore

This file was deleted.

68 changes: 0 additions & 68 deletions apps/web/playwright-integrations/config/playwright.config.ts

This file was deleted.

51 changes: 0 additions & 51 deletions apps/web/playwright-integrations/lib/fixtures.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { test } from "./lib/fixtures";
test.describe.configure({ mode: "parallel" });

test.describe("App Store - Authed", () => {
test.use({ storageState: "playwright/artifacts/proStorageState.json" });
test("Browse apple-calendar and try to install", async ({ page }) => {
test("Browse apple-calendar and try to install", async ({ page, users }) => {
const pro = await users.create();
await pro.login();
await page.goto("/apps");
await page.click('[data-testid="app-store-category-calendar"]');
await page.click('[data-testid="app-store-app-card-apple-calendar"]');
await page.click('[data-testid="install-app-button"]');
await expect(page.locator(`text=Connect to Apple Server`)).toBeVisible();
await pro.delete();
});
});

Expand Down
Loading

0 comments on commit d27b7ab

Please sign in to comment.