2023-10-13 06:03:42 +03:00
|
|
|
import { patchDataEnhancement } from '@affine-test/kit/e2e-enhance/initializer';
|
|
|
|
import { SnapshotStorage } from '@affine-test/kit/e2e-enhance/snapshot';
|
2023-08-29 13:07:05 +03:00
|
|
|
import { test } from '@affine-test/kit/playwright';
|
2023-09-02 08:57:04 +03:00
|
|
|
import {
|
|
|
|
clickNewPageButton,
|
|
|
|
waitForEditorLoad,
|
|
|
|
} from '@affine-test/kit/utils/page-logic';
|
2023-06-29 09:50:26 +03:00
|
|
|
|
2023-10-13 06:03:42 +03:00
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
await patchDataEnhancement(page);
|
|
|
|
});
|
2023-06-29 09:50:26 +03:00
|
|
|
|
2023-10-13 06:03:42 +03:00
|
|
|
test('record 0.7.0-canary.18 legacy data', async ({ page }) => {
|
2023-06-29 09:50:26 +03:00
|
|
|
await page.goto('http://localhost:8081/');
|
2023-09-02 06:31:07 +03:00
|
|
|
await waitForEditorLoad(page);
|
2023-09-02 08:57:04 +03:00
|
|
|
await clickNewPageButton(page);
|
2023-07-14 12:54:11 +03:00
|
|
|
const locator = page.locator('v-line').nth(0);
|
|
|
|
await locator.fill('hello');
|
2023-06-29 09:50:26 +03:00
|
|
|
|
2023-10-13 06:03:42 +03:00
|
|
|
const localStorageData = await page.evaluate(() =>
|
|
|
|
window.readAffineLocalStorage()
|
|
|
|
);
|
|
|
|
const { idbData, binaries } = await page.evaluate(() =>
|
|
|
|
window.readAffineDatabase()
|
|
|
|
);
|
|
|
|
|
|
|
|
const snapshotStorage = new SnapshotStorage('0.7.0-canary.18');
|
|
|
|
await snapshotStorage.write({
|
|
|
|
idbData,
|
|
|
|
localStorageData,
|
|
|
|
binaries,
|
|
|
|
});
|
2023-06-29 09:50:26 +03:00
|
|
|
});
|