Skip to content

Commit

Permalink
Record Playwright tests with Replay
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed May 1, 2024
1 parent 8f89ea8 commit fbfeae2
Show file tree
Hide file tree
Showing 5 changed files with 813 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Build NPM package
run: pnpm prerelease
- name: Run Playwright tests
run: cd packages/react-resizable-panels-website && pnpm test:e2e
run: cd packages/react-resizable-panels-website && pnpm test:e2e --project replay-chromium
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"devDependencies": {
"@babel/preset-typescript": "^7.22.5",
"@playwright/test": "^1.37.0",
"@replayio/playwright": "3.0.0-alpha.4",
"@types/jest": "^29.5.3",
"@types/node": "^18.17.5",
"@types/react": "latest",
Expand Down
16 changes: 16 additions & 0 deletions packages/react-resizable-panels-website/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices as replayDevices } from "@replayio/playwright";

const { DEBUG } = process.env;

const config: PlaywrightTestConfig = {
projects: [
{
name: "replay-chromium",
use: { ...(replayDevices["Replay Chromium"] as any) },
},
],
reporter: [
[
"@replayio/playwright/reporter",
{
apiKey: process.env.REPLAY_API_KEY,
upload: true,
},
],
],
use: {
browserName: "chromium",
headless: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const panelGroupABC = createElement(

test.describe("Storage", () => {
test.describe("localStorage (default)", () => {
test("should restore previous layout if autoSaveId prop has been provided", async ({
test.only("should restore previous layout if autoSaveId prop has been provided", async ({
page,
}) => {
await goToUrl(page, panelGroupABC);
Expand Down
Loading

0 comments on commit fbfeae2

Please sign in to comment.