-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): support switching render unit (#4580)
Co-authored-by: GitHub Actions <[email protected]>
- Loading branch information
1 parent
ce0b939
commit 45a1c14
Showing
19 changed files
with
346 additions
and
78 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
e2e/visual-comparison/sheets/sheets-switching-render-unit.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { chromium, expect, test } from '@playwright/test'; | ||
import { generateSnapshotName } from '../const'; | ||
|
||
const isCI = !!process.env.CI; | ||
|
||
test('ensure switching render unit successful with no errors', async () => { | ||
const browser = await chromium.launch({ | ||
headless: isCI, // Set to false to see the browser window | ||
}); | ||
const context = await browser.newContext({ | ||
viewport: { width: 1280, height: 720 }, | ||
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.loadDemoSheet()); | ||
await page.waitForTimeout(1000); | ||
|
||
await page.evaluate(() => window.E2EControllerAPI.loadDefaultSheet()); | ||
const filename = generateSnapshotName('switching-render-unit'); | ||
const firstScreenshot = await page.screenshot({ | ||
mask: [ | ||
page.locator('.univer-headerbar'), | ||
page.locator('.univer-defined-name'), | ||
], | ||
fullPage: true, | ||
}); | ||
expect(firstScreenshot).toMatchSnapshot(filename, { maxDiffPixels: 50 }); | ||
}); |
Binary file added
BIN
+76.5 KB
...ching-render-unit.spec.ts-snapshots/switching-render-unit-ci-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.