mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 21:48:48 +08:00
chore: bump playwright (#13947)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated Playwright test tooling to 1.58.2 across the repository and test packages. * **Tests** * Improved end-to-end robustness: replaced fragile timing/coordinate logic with element-based interactions, added polling/retry checks for flaky asserts and async state, and simplified input/rename flows to reduce test flakiness. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
pressShiftTab,
|
||||
pressTab,
|
||||
redoByKeyboard,
|
||||
SHORT_KEY,
|
||||
type,
|
||||
undoByKeyboard,
|
||||
} from './utils/actions/keyboard.js';
|
||||
@@ -113,11 +112,13 @@ function getAttachment(page: Page) {
|
||||
await attachment.click();
|
||||
await expect(toolbar).toBeVisible();
|
||||
await renameBtn.click();
|
||||
await page.keyboard.press(`${SHORT_KEY}+a`, { delay: 50 });
|
||||
await pressBackspace(page);
|
||||
await type(page, newName);
|
||||
await expect(renameInput).toBeVisible();
|
||||
await renameInput.fill(newName);
|
||||
await pressEnter(page);
|
||||
expect(await getName()).toContain(newName);
|
||||
await expect(renameInput).not.toBeVisible();
|
||||
if (newName.length > 0) {
|
||||
await expect.poll(getName).toContain(newName);
|
||||
}
|
||||
},
|
||||
|
||||
// external
|
||||
@@ -215,11 +216,11 @@ test('should rename attachment works', async ({ page }) => {
|
||||
await expect(renameInput).not.toBeVisible();
|
||||
|
||||
await rename('new-name');
|
||||
expect(await getName()).toBe('new-name.png');
|
||||
await expect.poll(getName).toBe('new-name.png');
|
||||
await rename('');
|
||||
expect(await getName()).toBe('.png');
|
||||
await expect.poll(getName).toBe('.png');
|
||||
await rename('abc');
|
||||
expect(await getName()).toBe('abc');
|
||||
await expect.poll(getName).toBe('abc');
|
||||
});
|
||||
|
||||
test('should turn attachment to image works', async ({ page }, testInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user