AFFiNE/tests/change-page-mode.spec.ts

47 lines
1.6 KiB
TypeScript
Raw Normal View History

2022-11-28 16:17:34 +03:00
import { test, expect } from '@playwright/test';
2023-01-09 07:20:53 +03:00
import { loadPage } from './libs/load-page.js';
import { clickPageMoreActions } from './libs/page-logic.js';
2022-11-28 16:17:34 +03:00
loadPage();
2023-02-01 16:07:35 +03:00
test.skip('Change page mode(Paper or Edgeless)', () => {
test.skip('Switch to edgeless by switch edgeless item', async ({ page }) => {
2022-11-28 16:17:34 +03:00
const switcher = page.locator('[data-testid=editor-mode-switcher]');
const box = await switcher.boundingBox();
expect(box?.x).not.toBeUndefined();
2022-11-28 16:17:34 +03:00
// mouse hover trigger animation for showing full switcher
// await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5);
await page.mouse.move((box?.x ?? 0) + 10, (box?.y ?? 0) + 10);
2022-11-28 16:17:34 +03:00
// await page.waitForTimeout(1000);
const edgelessButton = page.getByTestId('switch-edgeless-item'); // page.getByText('Edgeless').click()
2022-11-28 16:17:34 +03:00
await edgelessButton.click();
// // mouse move to edgeless button
// await page.mouse.move(
// (box?.x ?? 0) + (box?.width ?? 0) - 5,
// (box?.y ?? 0) + 5
// );
// await page.waitForTimeout(1000);
// // click switcher
// await page.mouse.click(
// (box?.x ?? 0) + (box?.width ?? 0) - 5,
// (box?.y ?? 0) + 5
// );
const edgeless = page.locator('affine-edgeless-page');
expect(await edgeless.isVisible()).toBe(true);
});
2022-11-28 16:17:34 +03:00
2023-02-01 16:07:35 +03:00
test.skip('Convert to edgeless by editor header items', async ({ page }) => {
await clickPageMoreActions(page);
const menusEdgelessItem = page.getByTestId('editor-option-menu-edgeless');
await menusEdgelessItem.click();
const edgeless = page.locator('affine-edgeless-page');
expect(await edgeless.isVisible()).toBe(true);
2022-11-28 16:17:34 +03:00
});
});