test: enhance 0.8.3 migration test (#4251)

This commit is contained in:
Alex Yang 2023-09-06 23:03:31 -07:00 committed by GitHub
parent 498683ff4c
commit a766279867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import {
check8080Available,
setupProxyServer,
} from '@affine-test/kit/utils/proxy';
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';
const { switchToNext } = setupProxyServer(
test,
@ -32,6 +32,21 @@ test('surface migration', async ({ page, context }) => {
await page.getByTestId('switch-edgeless-mode-button').click({
delay: 50,
});
await page
.locator('edgeless-toolbar edgeless-toolbar-button')
.filter({
hasText: 'Pen',
})
.click({
delay: 50,
});
await page.mouse.move(500, 500);
await page.mouse.down();
await page.mouse.move(500, 600, {
steps: 10,
});
await page.mouse.up();
const url = page.url();
await switchToNext();
@ -41,5 +56,6 @@ test('surface migration', async ({ page, context }) => {
// check edgeless mode is correct
await clickEdgelessModeButton(page);
await page.waitForTimeout(200);
await expect(page.locator('edgeless-toolbar')).toBeVisible();
await expect(page.locator('affine-edgeless-page')).toBeVisible();
});