test: make the test of change-page-mode more stable

This commit is contained in:
tzhangchi
2022-12-23 18:25:24 +08:00
parent 86e09b82ab
commit 007e8d87ed
+6 -4
View File
@@ -11,10 +11,12 @@ test.describe('Change page mode(Paper or Edgeless)', () => {
// mouse hover trigger animation for showing full switcher // mouse hover trigger animation for showing full switcher
await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5); await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5);
await page.waitForTimeout(500);
const edgelessButton = page.locator( const edgelessButton = page
'[data-testid=editor-mode-switcher] [title=Edgeless]' .getByTestId('editor-mode-switcher')
); .locator('div')
.filter({ hasText: 'Edgeless' })
.first(); // page.getByText('Edgeless').click()
await edgelessButton.click(); await edgelessButton.click();
// // mouse move to edgeless button // // mouse move to edgeless button