mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 04:51:49 +08:00
feat!: unified migration logic in server electron, and browser (#4079)
Co-authored-by: Mirone <Saul-Mirone@outlook.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { clickEdgelessModeButton } from '@affine-test/kit/utils/editor';
|
||||
import {
|
||||
getBlockSuiteEditorTitle,
|
||||
waitForEditorLoad,
|
||||
} from '@affine-test/kit/utils/page-logic';
|
||||
import {
|
||||
check8080Available,
|
||||
setupProxyServer,
|
||||
} from '@affine-test/kit/utils/proxy';
|
||||
import { test } from '@playwright/test';
|
||||
|
||||
const { switchToNext } = setupProxyServer(
|
||||
test,
|
||||
resolve(__dirname, '..', 'static')
|
||||
);
|
||||
|
||||
test('surface migration', async ({ page, context }) => {
|
||||
await check8080Available(context);
|
||||
await page.goto('http://localhost:8081/');
|
||||
await page.waitForSelector('v-line', {
|
||||
timeout: 10000,
|
||||
});
|
||||
await page.getByTestId('new-page-button').click();
|
||||
const title = getBlockSuiteEditorTitle(page);
|
||||
await title.type('hello');
|
||||
await page.keyboard.press('Enter', { delay: 50 });
|
||||
await page.keyboard.type('world', {
|
||||
delay: 50,
|
||||
});
|
||||
await page.getByTestId('switch-edgeless-mode-button').click({
|
||||
delay: 50,
|
||||
});
|
||||
const url = page.url();
|
||||
|
||||
await switchToNext();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.goto(url);
|
||||
await waitForEditorLoad(page);
|
||||
|
||||
// check edgeless mode is correct
|
||||
await clickEdgelessModeButton(page);
|
||||
await page.waitForTimeout(200);
|
||||
});
|
||||
Reference in New Issue
Block a user