Skip to content

Commit

Permalink
test: enable trace recording for a test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidseow committed Feb 27, 2023
1 parent 2b8dcca commit dea939c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Checks are written against React Admin demo and will include the following
- [x] Fullscreen capture on test failure
- [x] Override/extend test fixtures
- [x] Page Object with custom type
- [x] Enable trace recording for a test block

# Setup

Expand Down
13 changes: 13 additions & 0 deletions playwright-test/tests/enable-tracing.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { devices } from "@playwright/test";
import test from "../fixtures/base-fixture";

test.use({ storageState: "state.json", trace: "on" });

const { describe, expect } = test;

describe("Run test with trace enabled", () => {
test("desktop - should display", async ({ page }) => {
await page.goto("/");
expect(await page.viewportSize()).toEqual({ width: 1280, height: 720 });
});
});

0 comments on commit dea939c

Please sign in to comment.