Skip to content

Commit

Permalink
test: add full page snapshot expect FPS bar
Browse files Browse the repository at this point in the history
  • Loading branch information
lumixraku committed Oct 12, 2024
1 parent 131990f commit 26e890c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,31 @@ import { chromium, expect, test } from '@playwright/test';
import { generateSnapshotName } from '../const';

const SHEET_MAIN_CANVAS_ID = '#univer-sheet-main-canvas';
const isCI = !!process.env.CI;
test('diff default sheet toolbar', async ({ page }) => {
await page.goto('http://localhost:3000/sheets/');
await page.waitForTimeout(2000);

const filename = generateSnapshotName('default-sheet-fullpage');
const screenshot = await page.screenshot({
mask: [
page.locator('.univer-headerbar'),
],
fullPage: true,
});
await expect(screenshot).toMatchSnapshot(filename, { maxDiffPixels: 5 });
});
test('diff default sheet content', async ({ page }) => {
await page.goto('http://localhost:3000/sheets/');
await page.waitForTimeout(2000);

await page.evaluate(() => window.E2EControllerAPI.loadDefaultSheet());
await page.waitForTimeout(5000);
await page.waitForTimeout(2000);

const filename = generateSnapshotName('default-sheet');
const screenshot = await page.locator(SHEET_MAIN_CANVAS_ID).screenshot();
await expect(screenshot).toMatchSnapshot(filename, { maxDiffPixels: 5 });
});
const isCI = !!process.env.CI;

test('diff demo sheet content', async ({ page }) => {
let errored = false;
Expand Down

0 comments on commit 26e890c

Please sign in to comment.