Skip to content

Commit

Permalink
Reduce number of network reqs in visual regression
Browse files Browse the repository at this point in the history
On my machine, this cuts down the test run time from ~5 mins to ~3 mins!

Closes #249
  • Loading branch information
Rigellute committed Aug 20, 2020
1 parent 51779f3 commit 310eb32
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/panel/visual-regression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,17 @@ describe.each(parallelize(fixtures))("%s", (id, { rendererUrl }) => {
});
};

beforeEach(async () => {
await page.goto(rendererUrl, { waitUntil: "load" });
await page.mouse.move(0, 0);
await delay(500);
});

describe("landscape viewport", () => {
beforeEach(async () => {
describe("Go to page, test landscape and portrait viewport", () => {
it("matches landscape and portrait snapshot", async () => {
await page.goto(rendererUrl, { waitUntil: "load" });
await page.mouse.move(0, 0);
await delay(500);
await page.setViewport({ width: 1200, height: 600 });
});

it("matches snapshot", () => matchSnapshot({ viewport: "landscape" }));
});

describe("portrait viewport", () => {
beforeEach(async () => {
await matchSnapshot({ viewport: "landscape" });
await page.setViewport({ width: 600, height: 1200 });
await delay(500);
await matchSnapshot({ viewport: "portrait" });
});

it("matches snapshot", () => matchSnapshot({ viewport: "portrait" }));
});
});

Expand Down

0 comments on commit 310eb32

Please sign in to comment.