Skip to content

Commit

Permalink
Setup playwright ct
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed May 6, 2024
1 parent d73bfab commit 7f7deb4
Show file tree
Hide file tree
Showing 8 changed files with 317 additions and 104 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"

- run: npm ci
- run: npm run tsc
- run: npm run test

- run: npx playwright install chromium
- run: npm run test-ct
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
lib
node_modules
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
8 changes: 8 additions & 0 deletions e2e/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from "@playwright/experimental-ct-react";

test.use({ viewport: { width: 500, height: 1000 } });

test("should work", async ({ mount }) => {
const component = await mount(<div>Learn React</div>);
await expect(component).toContainText("Learn React");
});
Loading

0 comments on commit 7f7deb4

Please sign in to comment.