From d2e10ed7b50203d96128f63781c1fb9b7684df93 Mon Sep 17 00:00:00 2001 From: teallarson Date: Mon, 31 Mar 2025 16:34:02 -0400 Subject: [PATCH 1/4] fix bad state of package.json --- demo/package.json | 5 ++++- demo/pnpm-lock.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/demo/package.json b/demo/package.json index beab829..4156474 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,10 +2,13 @@ "name": "airbyte-embedded-widget-demo", "private": true, "scripts": { - "dev": "vite" + "dev": "vite", + "test": "playwright test", + "test:ui": "playwright test --ui" }, "license": "UNLICENSED", "devDependencies": { + "@playwright/test": "^1.42.1", "@types/node": "^22.13.14", "@vitejs/plugin-basic-ssl": "^2.0.0", "prettier": "^3.5.3", diff --git a/demo/pnpm-lock.yaml b/demo/pnpm-lock.yaml index ecaaad9..ea67753 100644 --- a/demo/pnpm-lock.yaml +++ b/demo/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@playwright/test': + specifier: ^1.42.1 + version: 1.51.1 '@types/node': specifier: ^22.13.14 version: 22.13.14 @@ -164,6 +167,11 @@ packages: cpu: [x64] os: [win32] + '@playwright/test@1.51.1': + resolution: {integrity: sha512-nM+kEaTSAoVlXmMPH10017vn3FSiFqr/bh4fKg9vmAdMfd9SDqRZNvPSiAHADc/itWak+qPvMPZQOPwCBW7k7Q==} + engines: {node: '>=18'} + hasBin: true + '@rollup/rollup-android-arm-eabi@4.38.0': resolution: {integrity: sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==} cpu: [arm] @@ -281,6 +289,11 @@ packages: engines: {node: '>=12'} hasBin: true + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -294,6 +307,16 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + playwright-core@1.51.1: + resolution: {integrity: sha512-/crRMj8+j/Nq5s8QcvegseuyeZPxpQCZb6HNk3Sos3BlZyAknRjoyJPFWkpNn8v0+P3WiwqFF8P+zQo4eqiNuw==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.51.1: + resolution: {integrity: sha512-kkx+MB2KQRkyxjYPc3a0wLZZoDczmppyGJIvQ43l+aZihkaVvmu/21kiyaHeHjiFxjxNNFnUncKmcGIyOojsaw==} + engines: {node: '>=18'} + hasBin: true + postcss@8.5.3: resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} engines: {node: ^10 || ^12 || >=14} @@ -422,6 +445,10 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true + '@playwright/test@1.51.1': + dependencies: + playwright: 1.51.1 + '@rollup/rollup-android-arm-eabi@4.38.0': optional: true @@ -518,6 +545,9 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 + fsevents@2.3.2: + optional: true + fsevents@2.3.3: optional: true @@ -525,6 +555,14 @@ snapshots: picocolors@1.1.1: {} + playwright-core@1.51.1: {} + + playwright@1.51.1: + dependencies: + playwright-core: 1.51.1 + optionalDependencies: + fsevents: 2.3.2 + postcss@8.5.3: dependencies: nanoid: 3.3.11 From 548007f3935d2248a9abd36468ed7265080691c5 Mon Sep 17 00:00:00 2001 From: teallarson Date: Mon, 31 Mar 2025 16:38:48 -0400 Subject: [PATCH 2/4] install the browsers when we run the tests --- .github/workflows/ci.yml | 6 +++--- demo/package.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5100edf..c8bae16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,9 @@ jobs: node-version: 20 cache: "pnpm" - name: Install dependencies - run: pnpm install - - name: Install Playwright Browsers - run: pnpm exec playwright install --with-deps chromium + run: | + cd demo + pnpm install - name: Run Playwright tests run: cd demo && pnpm test - uses: actions/upload-artifact@v4 diff --git a/demo/package.json b/demo/package.json index 4156474..068a51c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -3,8 +3,8 @@ "private": true, "scripts": { "dev": "vite", - "test": "playwright test", - "test:ui": "playwright test --ui" + "test": "pnpm dlx playwright install --with-deps chromium && playwright test", + "test:ui": "pnpm dlx playwright install --with-deps chromium && playwright test --ui" }, "license": "UNLICENSED", "devDependencies": { From 8164a007848632e143ee07a5b09c266d8d69e576 Mon Sep 17 00:00:00 2001 From: teallarson Date: Mon, 31 Mar 2025 16:42:20 -0400 Subject: [PATCH 3/4] run jest tests too --- .github/workflows/jest.yml | 30 ++++++++++++++++++++ .github/workflows/{ci.yml => playwright.yml} | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/jest.yml rename .github/workflows/{ci.yml => playwright.yml} (94%) diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml new file mode 100644 index 0000000..1474468 --- /dev/null +++ b/.github/workflows/jest.yml @@ -0,0 +1,30 @@ +name: Unit Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + jest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Run Jest tests + run: pnpm test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: jest-report + path: coverage/ + retention-days: 30 diff --git a/.github/workflows/ci.yml b/.github/workflows/playwright.yml similarity index 94% rename from .github/workflows/ci.yml rename to .github/workflows/playwright.yml index c8bae16..048f9ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/playwright.yml @@ -1,4 +1,4 @@ -name: CI +name: Playwright Tests on: push: @@ -7,7 +7,7 @@ on: branches: [main] jobs: - test: + playwright: timeout-minutes: 60 runs-on: ubuntu-latest steps: From 05e2d61d467aea64e7ea9aacb3fe779dab1c4cd6 Mon Sep 17 00:00:00 2001 From: teallarson Date: Tue, 1 Apr 2025 11:03:43 -0400 Subject: [PATCH 4/4] rename tests, split install out of test command, set working directory instead of prefixing all commands --- .../workflows/{playwright.yml => demo-tests.yml} | 13 ++++++++----- .github/workflows/{jest.yml => widget-tests.yml} | 2 +- demo/package.json | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) rename .github/workflows/{playwright.yml => demo-tests.yml} (72%) rename .github/workflows/{jest.yml => widget-tests.yml} (96%) diff --git a/.github/workflows/playwright.yml b/.github/workflows/demo-tests.yml similarity index 72% rename from .github/workflows/playwright.yml rename to .github/workflows/demo-tests.yml index 048f9ea..8f6154d 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/demo-tests.yml @@ -1,4 +1,4 @@ -name: Playwright Tests +name: Demo App Tests on: push: @@ -10,6 +10,9 @@ jobs: playwright: timeout-minutes: 60 runs-on: ubuntu-latest + defaults: + run: + working-directory: demo steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 @@ -20,11 +23,11 @@ jobs: node-version: 20 cache: "pnpm" - name: Install dependencies - run: | - cd demo - pnpm install + run: pnpm install + - name: Install playwright browser + run: pnpm dlx playwright install --with-deps chromium - name: Run Playwright tests - run: cd demo && pnpm test + run: pnpm test - uses: actions/upload-artifact@v4 if: always() with: diff --git a/.github/workflows/jest.yml b/.github/workflows/widget-tests.yml similarity index 96% rename from .github/workflows/jest.yml rename to .github/workflows/widget-tests.yml index 1474468..23dd1ba 100644 --- a/.github/workflows/jest.yml +++ b/.github/workflows/widget-tests.yml @@ -1,4 +1,4 @@ -name: Unit Tests +name: Widget Tests on: push: diff --git a/demo/package.json b/demo/package.json index 068a51c..4156474 100644 --- a/demo/package.json +++ b/demo/package.json @@ -3,8 +3,8 @@ "private": true, "scripts": { "dev": "vite", - "test": "pnpm dlx playwright install --with-deps chromium && playwright test", - "test:ui": "pnpm dlx playwright install --with-deps chromium && playwright test --ui" + "test": "playwright test", + "test:ui": "playwright test --ui" }, "license": "UNLICENSED", "devDependencies": {