AFFiNE/tests/affine-local/e2e/duplicate-page.spec.ts

23 lines
827 B
TypeScript
Raw Normal View History

import { test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import {
2023-09-02 08:57:04 +03:00
clickNewPageButton,
clickPageMoreActions,
getBlockSuiteEditorTitle,
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { expect } from '@playwright/test';
test('Duplicate page should work', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);
2023-09-02 08:57:04 +03:00
await clickNewPageButton(page);
const title = getBlockSuiteEditorTitle(page);
await title.pressSequentially('test');
await clickPageMoreActions(page);
const duplicateButton = page.getByTestId('editor-option-menu-duplicate');
await duplicateButton.click({ delay: 100 });
const title2 = getBlockSuiteEditorTitle(page);
2023-11-17 10:50:01 +03:00
await expect(title2).toHaveText('test(1)', { timeout: 1000 });
});