-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4aab4cb
commit 74d7fcd
Showing
28 changed files
with
14,836 additions
and
12,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,85 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
- v1 | ||
branches: [main, next, v1] | ||
pull_request: | ||
branches: | ||
- main | ||
- next | ||
- v1 | ||
branches: [main, next, v1] | ||
jobs: | ||
unit: | ||
name: API Tests | ||
e2e: | ||
name: E2E Tests | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
- os: ubuntu-latest | ||
shardIndex: [1, 2, 3, 4] | ||
shardTotal: [4] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- uses: pnpm/action-setup@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
version: 8 | ||
- name: Download deps | ||
node-version: lts/* | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Build packages | ||
run: pnpm run build | ||
- name: Run tests | ||
run: pnpm exec vitest | ||
- name: Typecheck | ||
run: pnpm -r run typecheck | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: pnpm exec playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | ||
- name: Upload blob report to GitHub Actions Artifacts | ||
if: ${{ !cancelled() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: blob-report-${{ matrix.shardIndex }} | ||
path: blob-report | ||
retention-days: 1 | ||
merge-reports: | ||
# Merge reports after playwright-tests, even if some shards have failed | ||
if: ${{ !cancelled() }} | ||
needs: [e2e] | ||
|
||
e2e: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- uses: pnpm/action-setup@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
version: 8 | ||
- name: Download deps | ||
node-version: lts/* | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Install Playwright | ||
run: pnpm exec playwright install --with-deps | ||
- name: Run tests | ||
run: pnpm exec playwright test | ||
- name: Upload test result | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
- name: Download blob reports from GitHub Actions Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: all-blob-reports | ||
pattern: blob-report-* | ||
merge-multiple: true | ||
|
||
- name: Merge into HTML Report | ||
run: pnpm exec playwright merge-reports --reporter html ./all-blob-reports | ||
|
||
- name: Upload HTML report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html-report--attempt-${{ github.run_attempt }} | ||
path: playwright-report | ||
retention-days: 14 | ||
unit: | ||
name: API Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
name: test-results | ||
path: test-results/ | ||
retention-days: 30 | ||
node-version: lts/* | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Run Vitest tests | ||
run: pnpm exec vitest | ||
- name: Run Typecheck | ||
run: pnpm -r run typecheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ntegrations/conform-validitystate.spec.ts → e2e/conform-validitystate.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/integrations/custom-inputs.spec.ts → e2e/custom-inputs.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/integrations/file-upload.spec.ts → e2e/file-upload.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/integrations/form-attributes.spec.ts → e2e/form-attributes.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/integrations/form-control.spec.ts → e2e/form-control.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import type { Locator, Page } from '@playwright/test'; | ||
|
||
export function getPlayground(page: Page) { | ||
const container = page.locator('body'); | ||
const submission = container.locator('pre'); | ||
|
||
return { | ||
container, | ||
form: container.locator('form'), | ||
submit: container.locator('footer button[type="submit"]'), | ||
reset: container.locator('footer button[type="reset"]'), | ||
submission, | ||
result: () => submission.innerText().then(JSON.parse), | ||
error: container.locator('main p'), | ||
}; | ||
} | ||
|
||
export async function selectAll(locator: Locator) { | ||
switch (process.platform) { | ||
case 'darwin': | ||
await locator.press('Meta+a'); | ||
break; | ||
default: | ||
await locator.press('Control+a'); | ||
} | ||
} | ||
|
||
export async function cut(locator: Locator) { | ||
switch (process.platform) { | ||
case 'darwin': | ||
await locator.press('Meta+x'); | ||
break; | ||
default: | ||
await locator.press('Control+x'); | ||
} | ||
} | ||
|
||
export async function paste(locator: Locator) { | ||
switch (process.platform) { | ||
case 'darwin': | ||
await locator.press('Meta+v'); | ||
break; | ||
default: | ||
await locator.press('Control+v'); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
tests/integrations/input-attributes.spec.ts → e2e/input-attributes.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/integrations/nested-list.spec.ts → e2e/nested-list.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.