2023-08-11 16:58:59 +03:00
|
|
|
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,
|
2023-08-11 16:58:59 +03:00
|
|
|
clickPageMoreActions,
|
|
|
|
getBlockSuiteEditorTitle,
|
2023-09-02 06:31:07 +03:00
|
|
|
waitForEditorLoad,
|
2023-08-11 16:58:59 +03:00
|
|
|
} from '@affine-test/kit/utils/page-logic';
|
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
|
|
|
test('Duplicate page should work', async ({ page }) => {
|
|
|
|
await openHomePage(page);
|
2023-09-02 06:31:07 +03:00
|
|
|
await waitForEditorLoad(page);
|
2023-09-02 08:57:04 +03:00
|
|
|
await clickNewPageButton(page);
|
2023-08-11 16:58:59 +03:00
|
|
|
const title = getBlockSuiteEditorTitle(page);
|
2023-12-13 10:51:59 +03:00
|
|
|
await expect(title).toBeVisible();
|
|
|
|
await title.fill('test');
|
2023-08-11 16:58:59 +03:00
|
|
|
await clickPageMoreActions(page);
|
|
|
|
const duplicateButton = page.getByTestId('editor-option-menu-duplicate');
|
2023-12-13 10:51:59 +03:00
|
|
|
await duplicateButton.click();
|
2023-08-11 16:58:59 +03:00
|
|
|
const title2 = getBlockSuiteEditorTitle(page);
|
2023-12-13 10:51:59 +03:00
|
|
|
await expect(title2).toHaveText('test(1)');
|
2023-08-11 16:58:59 +03:00
|
|
|
});
|