Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

test(sheets): remove scrolling render e2e test (#7575)

wpxp123456d429bb2af5e9
diff --git a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts b/e2e/visual-comparison/sheets/sheets-scroll.spec.ts
index 6f88cf5b03..258f7fefba 100644
--- a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts
+++ b/e2e/visual-comparison/sheets/sheets-scroll.spec.ts
@@ -1,62 +1,8 @@
import { chromium, expect, test } from '@playwright/test';
import { generateSnapshotName } from '../const';
-const SHEET_MAIN_CANVAS_ID = '#univer-sheet-main-canvas_workbook-01';
const isCI = !!process.env.CI;
-test('cells rendering after scrolling', async () => {
- const browser = await chromium.launch({
- headless: isCI, // Set to false to see the browser window in local
- });
- const context = await browser.newContext({
- viewport: { width: 1280, height: 1280 },
- deviceScaleFactor: 2, // Set your desired DPR
- });
- const page = await context.newPage();
- await page.goto('http://localhost:3000/sheets/');
- await page.waitForTimeout(2000);
-
- await page.evaluate(() => window.E2EControllerAPI.loadMergeCellSheet());
- await page.waitForTimeout(1000);
-
- const canvas = page.locator(SHEET_MAIN_CANVAS_ID);
- await canvas.evaluate(async (element: HTMLCanvasElement) => {
- const scroll = async (deltaY: number) => {
- for (let elapsed = 0; elapsed < 1000; elapsed += 30) {
- element.dispatchEvent(new WheelEvent('wheel', {
- bubbles: true,
- cancelable: true,
- deltaY,
- clientX: 580,
- clientY: 580,
- }));
- await new Promise((resolve) => setTimeout(resolve, 30));
- }
- };
- await scroll(100);
- await scroll(-100);
- });
- await page.evaluate(() => new Promise<void>((resolve) => {
- let previous = '';
- let stableFrames = 0;
- const check = () => {
- const current = JSON.stringify(window.univerAPI.getActiveWorkbook().getActiveSheet().getScrollState());
- stableFrames = current === previous ? stableFrames + 1 : 0;
- previous = current;
- if (stableFrames >= 5) {
- resolve();
- return;
- }
- requestAnimationFrame(check);
- };
- requestAnimationFrame(check);
- }));
-
- const filename = generateSnapshotName('mergedCellsRenderingScrolling');
- const screenshot = await canvas.screenshot();
- await expect(screenshot).toMatchSnapshot(filename, { maxDiffPixelRatio: 0.005 });
-});
-
test('status bar count with array formula selection', async () => {
const browser = await chromium.launch({
headless: isCI, // Set to false to see the browser window in local
diff --git a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-chromium-darwin.png b/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-chromium-darwin.png
deleted file mode 100644
index e28580ff45..0000000000
Binary files a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-chromium-darwin.png and /dev/null differ
diff --git a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-ci-chromium-linux.png
deleted file mode 100644
index 8638c1d821..0000000000
Binary files a/e2e/visual-comparison/sheets/sheets-scroll.spec.ts-snapshots/mergedCellsRenderingScrolling-ci-chromium-linux.png and /dev/null differ