Skip to content

Commit

Permalink
Update screenshots (#322)
Browse files Browse the repository at this point in the history
* Better regression update flow

* Reorganize regression files

* Move screenshots

* Update readme

* Fix CI

* Update regression

* Optimize playwright

* Try using bezkrovny
  • Loading branch information
brachkow authored Sep 25, 2024
1 parent 6c4cd37 commit 3846d8b
Show file tree
Hide file tree
Showing 121 changed files with 16 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 16 additions & 8 deletions tests/regression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,21 @@ describe('visual regression test for', () => {
});
});

beforeEach(async () => {
beforeAll(async () => {
browser = await playwright.chromium.launch();
});

afterAll(async () => {
await browser.close();
});

beforeEach(async () => {
page = await browser.newPage();
});

const goto = (route: string) => {
return page.goto(`http://localhost:3000${route}`, {
waitUntil: 'networkidle',
});
};
afterEach(async () => {
await page.close();
});

let testIndex = 0;

Expand All @@ -128,7 +133,10 @@ describe('visual regression test for', () => {
async (name, route, action, width, height, colorScheme) => {
console.log(`Running test ${++testIndex} of ${tests.length}: ${name}`);
await page.setViewportSize({ width, height });
await goto(route);

await page.goto(`http://localhost:3000${route}`, {
waitUntil: 'networkidle',
});

if (colorScheme === 'dark') {
await page.evaluate(() => {
Expand All @@ -143,7 +151,7 @@ describe('visual regression test for', () => {
expect(image).toMatchImageSnapshot({
comparisonMethod: 'ssim',
customDiffConfig: {
ssim: 'fast',
ssim: 'bezkrovny',
},
failureThreshold: Math.pow(16, 2),
failureThresholdType: 'pixel',
Expand Down

0 comments on commit 3846d8b

Please sign in to comment.