chore(editor): fix imports in legacy tests (#10300)
This commit is contained in:
119 files changed
+96
-90
No files matched your search
+5
-2
@@ -3,9 +3,9 @@ import { fileURLToPath } from 'node:url';
|
|||||||
|
|
||||||
import { sleep } from '@blocksuite/global/utils';
|
import { sleep } from '@blocksuite/global/utils';
|
||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { switchEditorMode } from 'utils/actions/edgeless.js';
|
|
||||||
|
|
||||||
import { dragBlockToPoint, popImageMoreMenu } from './utils/actions/drag.js';
|
import { dragBlockToPoint, popImageMoreMenu } from './utils/actions/drag.js';
|
||||||
|
import { switchEditorMode } from './utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
pressArrowDown,
|
pressArrowDown,
|
||||||
pressArrowUp,
|
pressArrowUp,
|
||||||
@@ -43,7 +43,10 @@ import { test } from './utils/playwright.js';
|
|||||||
|
|
||||||
const FILE_NAME = 'test-card-1.png';
|
const FILE_NAME = 'test-card-1.png';
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const FILE_PATH = path.resolve(__dirname, `../playground/public/${FILE_NAME}`);
|
const FILE_PATH = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
`../../playground/public/${FILE_NAME}`
|
||||||
|
);
|
||||||
|
|
||||||
function getAttachment(page: Page) {
|
function getAttachment(page: Page) {
|
||||||
const attachment = page.locator('affine-attachment');
|
const attachment = page.locator('affine-attachment');
|
||||||
File renamed without changes.
+2
-2
@@ -3,8 +3,6 @@ import './utils/declare-test-window.js';
|
|||||||
import type { BlockSnapshot } from '@blocksuite/store';
|
import type { BlockSnapshot } from '@blocksuite/store';
|
||||||
import type { Page } from '@playwright/test';
|
import type { Page } from '@playwright/test';
|
||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import { ignoreSnapshotId } from 'utils/ignore.js';
|
|
||||||
import { getEmbedCardToolbar } from 'utils/query.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
activeNoteInEdgeless,
|
activeNoteInEdgeless,
|
||||||
@@ -42,7 +40,9 @@ import {
|
|||||||
assertParentBlockFlavour,
|
assertParentBlockFlavour,
|
||||||
assertRichTextInlineRange,
|
assertRichTextInlineRange,
|
||||||
} from './utils/asserts.js';
|
} from './utils/asserts.js';
|
||||||
|
import { ignoreSnapshotId } from './utils/ignore.js';
|
||||||
import { scoped, test } from './utils/playwright.js';
|
import { scoped, test } from './utils/playwright.js';
|
||||||
|
import { getEmbedCardToolbar } from './utils/query.js';
|
||||||
|
|
||||||
const LOCAL_HOST_URL = 'http://localhost';
|
const LOCAL_HOST_URL = 'http://localhost';
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,8 +1,7 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import { dragBetweenIndices } from 'utils/actions/drag.js';
|
|
||||||
import { getFormatBar } from 'utils/query.js';
|
|
||||||
|
|
||||||
import { updateBlockType } from '../utils/actions/block.js';
|
import { updateBlockType } from '../utils/actions/block.js';
|
||||||
|
import { dragBetweenIndices } from '../utils/actions/drag.js';
|
||||||
import {
|
import {
|
||||||
createCodeBlock,
|
createCodeBlock,
|
||||||
pressArrowLeft,
|
pressArrowLeft,
|
||||||
@@ -32,6 +31,7 @@ import {
|
|||||||
assertTitle,
|
assertTitle,
|
||||||
} from '../utils/asserts.js';
|
} from '../utils/asserts.js';
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
import { getFormatBar } from '../utils/query.js';
|
||||||
import { getCodeBlock } from './utils.js';
|
import { getCodeBlock } from './utils.js';
|
||||||
|
|
||||||
test('use debug menu can create code block', async ({ page }) => {
|
test('use debug menu can create code block', async ({ page }) => {
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
-4
@@ -1,16 +1,16 @@
|
|||||||
import { expect, type Locator, type Page } from '@playwright/test';
|
import { expect, type Locator, type Page } from '@playwright/test';
|
||||||
import { dragBetweenCoords } from 'utils/actions/drag.js';
|
|
||||||
|
import { dragBetweenCoords } from '../utils/actions/drag.js';
|
||||||
import {
|
import {
|
||||||
addBasicShapeElement,
|
addBasicShapeElement,
|
||||||
Shape,
|
Shape,
|
||||||
switchEditorMode,
|
switchEditorMode,
|
||||||
triggerComponentToolbarAction,
|
triggerComponentToolbarAction,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
enterPlaygroundRoom,
|
enterPlaygroundRoom,
|
||||||
initEmptyEdgelessState,
|
initEmptyEdgelessState,
|
||||||
} from 'utils/actions/misc.js';
|
} from '../utils/actions/misc.js';
|
||||||
|
|
||||||
import { parseStringToRgba } from '../utils/bs-alternative.js';
|
import { parseStringToRgba } from '../utils/bs-alternative.js';
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
-5
@@ -1,5 +1,6 @@
|
|||||||
import type { Page } from '@playwright/test';
|
import type { Page } from '@playwright/test';
|
||||||
import { clickView, moveView } from 'utils/actions/click.js';
|
|
||||||
|
import { clickView, moveView } from '../../utils/actions/click.js';
|
||||||
import {
|
import {
|
||||||
autoFit,
|
autoFit,
|
||||||
createFrame as _createFrame,
|
createFrame as _createFrame,
|
||||||
@@ -14,15 +15,14 @@ import {
|
|||||||
shiftClickView,
|
shiftClickView,
|
||||||
triggerComponentToolbarAction,
|
triggerComponentToolbarAction,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
pasteByKeyboard,
|
pasteByKeyboard,
|
||||||
pressBackspace,
|
pressBackspace,
|
||||||
pressEscape,
|
pressEscape,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../../utils/actions/keyboard.js';
|
||||||
import { assertContainerOfElements } from 'utils/asserts.js';
|
import { assertContainerOfElements } from '../../utils/asserts.js';
|
||||||
|
|
||||||
import { test } from '../../utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
const createFrame = async (
|
const createFrame = async (
|
||||||
+6
-6
@@ -1,5 +1,6 @@
|
|||||||
import type { Page } from '@playwright/test';
|
import type { Page } from '@playwright/test';
|
||||||
import { clickView } from 'utils/actions/click.js';
|
|
||||||
|
import { clickView } from '../../utils/actions/click.js';
|
||||||
import {
|
import {
|
||||||
createFrame,
|
createFrame,
|
||||||
dragBetweenViewCoords as _dragBetweenViewCoords,
|
dragBetweenViewCoords as _dragBetweenViewCoords,
|
||||||
@@ -9,11 +10,10 @@ import {
|
|||||||
toViewCoord,
|
toViewCoord,
|
||||||
triggerComponentToolbarAction,
|
triggerComponentToolbarAction,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import { pressEscape } from 'utils/actions/keyboard.js';
|
import { pressEscape } from '../../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../../utils/actions/misc.js';
|
||||||
import { assertContainerOfElements } from 'utils/asserts.js';
|
import { assertContainerOfElements } from '../../utils/asserts.js';
|
||||||
|
|
||||||
import { test } from '../../utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
const dragBetweenViewCoords = async (
|
const dragBetweenViewCoords = async (
|
||||||
+4
-4
@@ -1,4 +1,5 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addNote,
|
addNote,
|
||||||
autoFit,
|
autoFit,
|
||||||
@@ -8,15 +9,14 @@ import {
|
|||||||
getFrameTitle,
|
getFrameTitle,
|
||||||
zoomOutByKeyboard,
|
zoomOutByKeyboard,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
pressBackspace,
|
pressBackspace,
|
||||||
pressEnter,
|
pressEnter,
|
||||||
pressEscape,
|
pressEscape,
|
||||||
type,
|
type,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../../utils/actions/misc.js';
|
||||||
|
|
||||||
import { test } from '../../utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
const createFrame = async (
|
const createFrame = async (
|
||||||
File renamed without changes.
+6
-3
@@ -1,4 +1,5 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createFrame,
|
createFrame,
|
||||||
createNote,
|
createNote,
|
||||||
@@ -8,9 +9,11 @@ import {
|
|||||||
getEdgelessSelectedRectModel,
|
getEdgelessSelectedRectModel,
|
||||||
Shape,
|
Shape,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import { pressEscape, selectAllByKeyboard } from 'utils/actions/keyboard.js';
|
import {
|
||||||
|
pressEscape,
|
||||||
|
selectAllByKeyboard,
|
||||||
|
} from '../../utils/actions/keyboard.js';
|
||||||
import { test } from '../../utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
+6
-6
@@ -1,5 +1,6 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { click, clickView, dblclickView } from 'utils/actions/click.js';
|
|
||||||
|
import { click, clickView, dblclickView } from '../../utils/actions/click.js';
|
||||||
import {
|
import {
|
||||||
addNote,
|
addNote,
|
||||||
autoFit,
|
autoFit,
|
||||||
@@ -13,21 +14,20 @@ import {
|
|||||||
Shape,
|
Shape,
|
||||||
toViewCoord,
|
toViewCoord,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
pressBackspace,
|
pressBackspace,
|
||||||
pressEnter,
|
pressEnter,
|
||||||
pressEscape,
|
pressEscape,
|
||||||
selectAllByKeyboard,
|
selectAllByKeyboard,
|
||||||
type,
|
type,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../../utils/actions/misc.js';
|
||||||
import {
|
import {
|
||||||
assertEdgelessCanvasText,
|
assertEdgelessCanvasText,
|
||||||
assertRichTexts,
|
assertRichTexts,
|
||||||
assertSelectedBound,
|
assertSelectedBound,
|
||||||
} from 'utils/asserts.js';
|
} from '../../utils/asserts.js';
|
||||||
|
|
||||||
import { test } from '../../utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
const createFrame = async (
|
const createFrame = async (
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -254,7 +254,7 @@ test.skip('polygonal lasso should complete selection when clicking the last poin
|
|||||||
const curController = edgeless.gfx.tool.currentTool$.peek();
|
const curController = edgeless.gfx.tool.currentTool$.peek();
|
||||||
if (curController?.toolName !== 'lasso')
|
if (curController?.toolName !== 'lasso')
|
||||||
throw new Error('expected lasso tool controller');
|
throw new Error('expected lasso tool controller');
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
return (curController as any)['_isSelecting'];
|
return (curController as any)['_isSelecting'];
|
||||||
});
|
});
|
||||||
|
|
||||||
File renamed without changes.
+6
-6
@@ -1,5 +1,6 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { clickView, dblclickView, moveView } from 'utils/actions/click.js';
|
|
||||||
|
import { clickView, dblclickView, moveView } from '../utils/actions/click.js';
|
||||||
import {
|
import {
|
||||||
createBrushElement,
|
createBrushElement,
|
||||||
createConnectorElement,
|
createConnectorElement,
|
||||||
@@ -16,7 +17,7 @@ import {
|
|||||||
getSelectedIds,
|
getSelectedIds,
|
||||||
getTypeById,
|
getTypeById,
|
||||||
setEdgelessTool,
|
setEdgelessTool,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
pasteByKeyboard,
|
pasteByKeyboard,
|
||||||
@@ -29,15 +30,14 @@ import {
|
|||||||
SHORT_KEY,
|
SHORT_KEY,
|
||||||
type,
|
type,
|
||||||
undoByKeyboard,
|
undoByKeyboard,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../utils/actions/misc.js';
|
||||||
import {
|
import {
|
||||||
assertCanvasElementsCount,
|
assertCanvasElementsCount,
|
||||||
assertEdgelessElementBound,
|
assertEdgelessElementBound,
|
||||||
assertEdgelessSelectedModelRect,
|
assertEdgelessSelectedModelRect,
|
||||||
assertRichTexts,
|
assertRichTexts,
|
||||||
} from 'utils/asserts.js';
|
} from '../utils/asserts.js';
|
||||||
|
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test.describe('lock', () => {
|
test.describe('lock', () => {
|
||||||
+14
-14
@@ -1,6 +1,7 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import { clickView } from 'utils/actions/click.js';
|
|
||||||
import { dragBetweenCoords } from 'utils/actions/drag.js';
|
import { clickView } from '../utils/actions/click.js';
|
||||||
|
import { dragBetweenCoords } from '../utils/actions/drag.js';
|
||||||
import {
|
import {
|
||||||
addBasicRectShapeElement,
|
addBasicRectShapeElement,
|
||||||
autoFit,
|
autoFit,
|
||||||
@@ -10,7 +11,7 @@ import {
|
|||||||
selectElementInEdgeless,
|
selectElementInEdgeless,
|
||||||
waitFontsLoaded,
|
waitFontsLoaded,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
pressBackspace,
|
pressBackspace,
|
||||||
pressEnter,
|
pressEnter,
|
||||||
@@ -18,18 +19,17 @@ import {
|
|||||||
selectAllByKeyboard,
|
selectAllByKeyboard,
|
||||||
type,
|
type,
|
||||||
undoByKeyboard,
|
undoByKeyboard,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../utils/actions/misc.js';
|
||||||
import {
|
import {
|
||||||
assertEdgelessSelectedRect,
|
assertEdgelessSelectedRect,
|
||||||
assertSelectedBound,
|
assertSelectedBound,
|
||||||
} from 'utils/asserts.js';
|
} from '../utils/asserts.js';
|
||||||
import {
|
import {
|
||||||
addMindmapNodes,
|
addMindmapNodes,
|
||||||
createMindMap,
|
createMindMap,
|
||||||
getMindMapNode,
|
getMindMapNode,
|
||||||
} from 'utils/mindmap.js';
|
} from '../utils/mindmap.js';
|
||||||
|
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test('elements should be selectable after open mindmap menu', async ({
|
test('elements should be selectable after open mindmap menu', async ({
|
||||||
@@ -224,17 +224,17 @@ test('drag root node should layout in real time', async ({ page }) => {
|
|||||||
const { rect: thirdRect } = await getMindMapNode(page, mindmapId, [0, 2]);
|
const { rect: thirdRect } = await getMindMapNode(page, mindmapId, [0, 2]);
|
||||||
|
|
||||||
const assertMindMapNodesPosition = async (deltaX: number, deltaY: number) => {
|
const assertMindMapNodesPosition = async (deltaX: number, deltaY: number) => {
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 0])).rect).toEqual({
|
expect((await getMindMapNode(page, mindmapId, [0, 0])).rect).toEqual({
|
||||||
...firstRect,
|
...firstRect,
|
||||||
x: firstRect.x + deltaX,
|
x: firstRect.x + deltaX,
|
||||||
y: firstRect.y + deltaY,
|
y: firstRect.y + deltaY,
|
||||||
});
|
});
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 1])).rect).toEqual({
|
expect((await getMindMapNode(page, mindmapId, [0, 1])).rect).toEqual({
|
||||||
...secondRect,
|
...secondRect,
|
||||||
x: secondRect.x + deltaX,
|
x: secondRect.x + deltaX,
|
||||||
y: secondRect.y + deltaY,
|
y: secondRect.y + deltaY,
|
||||||
});
|
});
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 2])).rect).toEqual({
|
expect((await getMindMapNode(page, mindmapId, [0, 2])).rect).toEqual({
|
||||||
...thirdRect,
|
...thirdRect,
|
||||||
x: thirdRect.x + deltaX,
|
x: thirdRect.x + deltaX,
|
||||||
y: thirdRect.y + deltaY,
|
y: thirdRect.y + deltaY,
|
||||||
@@ -359,13 +359,13 @@ test('allow to type content directly when node has been selected', async ({
|
|||||||
await type(page, 'child node 2');
|
await type(page, 'child node 2');
|
||||||
await pressEnter(page);
|
await pressEnter(page);
|
||||||
|
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 1])).text).toBe(
|
expect((await getMindMapNode(page, mindmapId, [0, 1])).text).toBe(
|
||||||
'parent node'
|
'parent node'
|
||||||
);
|
);
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 1, 0])).text).toBe(
|
expect((await getMindMapNode(page, mindmapId, [0, 1, 0])).text).toBe(
|
||||||
'child node 1'
|
'child node 1'
|
||||||
);
|
);
|
||||||
await expect((await getMindMapNode(page, mindmapId, [0, 1, 1])).text).toBe(
|
expect((await getMindMapNode(page, mindmapId, [0, 1, 1])).text).toBe(
|
||||||
'child node 2'
|
'child node 2'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6
-5
@@ -1,4 +1,5 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addNote,
|
addNote,
|
||||||
locatorScalePanelButton,
|
locatorScalePanelButton,
|
||||||
@@ -6,19 +7,19 @@ import {
|
|||||||
switchEditorMode,
|
switchEditorMode,
|
||||||
triggerComponentToolbarAction,
|
triggerComponentToolbarAction,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
pasteByKeyboard,
|
pasteByKeyboard,
|
||||||
selectAllByKeyboard,
|
selectAllByKeyboard,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../../utils/actions/keyboard.js';
|
||||||
import {
|
import {
|
||||||
enterPlaygroundRoom,
|
enterPlaygroundRoom,
|
||||||
initEmptyEdgelessState,
|
initEmptyEdgelessState,
|
||||||
waitNextFrame,
|
waitNextFrame,
|
||||||
} from 'utils/actions/misc.js';
|
} from '../../utils/actions/misc.js';
|
||||||
import { assertRectExist } from 'utils/asserts.js';
|
import { assertRectExist } from '../../utils/asserts.js';
|
||||||
import { test } from 'utils/playwright.js';
|
import { test } from '../../utils/playwright.js';
|
||||||
|
|
||||||
async function setupAndAddNote(page: Page) {
|
async function setupAndAddNote(page: Page) {
|
||||||
await enterPlaygroundRoom(page);
|
await enterPlaygroundRoom(page);
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,4 +1,5 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
click,
|
click,
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
@@ -17,8 +18,7 @@ import {
|
|||||||
setEdgelessTool,
|
setEdgelessTool,
|
||||||
switchEditorMode,
|
switchEditorMode,
|
||||||
type,
|
type,
|
||||||
} from 'utils/actions/index.js';
|
} from '../utils/actions/index.js';
|
||||||
|
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test.describe('pasting blocks', () => {
|
test.describe('pasting blocks', () => {
|
||||||
+4
-4
@@ -1,4 +1,5 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assertEdgelessTool,
|
assertEdgelessTool,
|
||||||
createFrame,
|
createFrame,
|
||||||
@@ -11,15 +12,14 @@ import {
|
|||||||
setEdgelessTool,
|
setEdgelessTool,
|
||||||
Shape,
|
Shape,
|
||||||
toggleFramePanel,
|
toggleFramePanel,
|
||||||
} from 'utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
pasteByKeyboard,
|
pasteByKeyboard,
|
||||||
pressEscape,
|
pressEscape,
|
||||||
selectAllBlocksByKeyboard,
|
selectAllBlocksByKeyboard,
|
||||||
} from 'utils/actions/keyboard.js';
|
} from '../utils/actions/keyboard.js';
|
||||||
import { waitNextFrame } from 'utils/actions/misc.js';
|
import { waitNextFrame } from '../utils/actions/misc.js';
|
||||||
|
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test.describe('presentation', () => {
|
test.describe('presentation', () => {
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,5 +1,4 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { getLinkedDocPopover } from 'utils/actions/linked-doc.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assertEdgelessTool,
|
assertEdgelessTool,
|
||||||
@@ -16,6 +15,7 @@ import {
|
|||||||
waitNextFrame,
|
waitNextFrame,
|
||||||
zoomResetByKeyboard,
|
zoomResetByKeyboard,
|
||||||
} from '../utils/actions/index.js';
|
} from '../utils/actions/index.js';
|
||||||
|
import { getLinkedDocPopover } from '../utils/actions/linked-doc.js';
|
||||||
import { assertEdgelessCanvasText } from '../utils/asserts.js';
|
import { assertEdgelessCanvasText } from '../utils/asserts.js';
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
+4
-4
@@ -1,16 +1,16 @@
|
|||||||
import type { DatabaseBlockModel } from '@blocksuite/affine-model';
|
import type { DatabaseBlockModel } from '@blocksuite/affine-model';
|
||||||
import { assertExists } from '@blocksuite/global/utils';
|
import { assertExists } from '@blocksuite/global/utils';
|
||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { switchEditorMode } from 'utils/actions/edgeless.js';
|
|
||||||
import { getLinkedDocPopover } from 'utils/actions/linked-doc.js';
|
import { switchEditorMode } from './utils/actions/edgeless.js';
|
||||||
|
import { getLinkedDocPopover } from './utils/actions/linked-doc.js';
|
||||||
import {
|
import {
|
||||||
enterPlaygroundRoom,
|
enterPlaygroundRoom,
|
||||||
focusRichText,
|
focusRichText,
|
||||||
initEmptyEdgelessState,
|
initEmptyEdgelessState,
|
||||||
initEmptyParagraphState,
|
initEmptyParagraphState,
|
||||||
waitNextFrame,
|
waitNextFrame,
|
||||||
} from 'utils/actions/misc.js';
|
} from './utils/actions/misc.js';
|
||||||
|
|
||||||
import { test } from './utils/playwright.js';
|
import { test } from './utils/playwright.js';
|
||||||
|
|
||||||
test.describe('Embed synced doc', () => {
|
test.describe('Embed synced doc', () => {
|
||||||
File renamed without changes.
File renamed without changes.
+6
-6
@@ -1,11 +1,6 @@
|
|||||||
import { expect, type Locator, type Page } from '@playwright/test';
|
import { expect, type Locator, type Page } from '@playwright/test';
|
||||||
import { dragBetweenCoords } from 'utils/actions/drag.js';
|
|
||||||
import {
|
|
||||||
assertEdgelessNonSelectedRect,
|
|
||||||
assertEdgelessSelectedRect,
|
|
||||||
assertZoomLevel,
|
|
||||||
} from 'utils/asserts.js';
|
|
||||||
|
|
||||||
|
import { dragBetweenCoords } from '../utils/actions/drag.js';
|
||||||
import {
|
import {
|
||||||
addBasicShapeElement,
|
addBasicShapeElement,
|
||||||
addNote,
|
addNote,
|
||||||
@@ -21,6 +16,11 @@ import {
|
|||||||
toggleFramePanel,
|
toggleFramePanel,
|
||||||
} from '../utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import { waitNextFrame } from '../utils/actions/index.js';
|
import { waitNextFrame } from '../utils/actions/index.js';
|
||||||
|
import {
|
||||||
|
assertEdgelessNonSelectedRect,
|
||||||
|
assertEdgelessSelectedRect,
|
||||||
|
assertZoomLevel,
|
||||||
|
} from '../utils/asserts.js';
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
async function dragFrameCard(
|
async function dragFrameCard(
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
-4
@@ -1,9 +1,5 @@
|
|||||||
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
|
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
|
||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import {
|
|
||||||
assertRichTextInlineDeltas,
|
|
||||||
assertRichTextInlineRange,
|
|
||||||
} from 'utils/asserts.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
cutByKeyboard,
|
cutByKeyboard,
|
||||||
@@ -25,6 +21,10 @@ import {
|
|||||||
focusRichText,
|
focusRichText,
|
||||||
initEmptyParagraphState,
|
initEmptyParagraphState,
|
||||||
} from '../utils/actions/misc.js';
|
} from '../utils/actions/misc.js';
|
||||||
|
import {
|
||||||
|
assertRichTextInlineDeltas,
|
||||||
|
assertRichTextInlineRange,
|
||||||
|
} from '../utils/asserts.js';
|
||||||
import { test } from '../utils/playwright.js';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test('add inline latex at the start of line', async ({ page }) => {
|
test('add inline latex at the start of line', async ({ page }) => {
|
||||||
File renamed without changes.
+2
-2
@@ -1,6 +1,4 @@
|
|||||||
import { expect, type Page } from '@playwright/test';
|
import { expect, type Page } from '@playwright/test';
|
||||||
import { switchEditorMode } from 'utils/actions/edgeless.js';
|
|
||||||
import { getLinkedDocPopover } from 'utils/actions/linked-doc.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addNewPage,
|
addNewPage,
|
||||||
@@ -8,6 +6,7 @@ import {
|
|||||||
switchToPage,
|
switchToPage,
|
||||||
} from './utils/actions/click.js';
|
} from './utils/actions/click.js';
|
||||||
import { dragBetweenIndices, dragBlockToPoint } from './utils/actions/drag.js';
|
import { dragBetweenIndices, dragBlockToPoint } from './utils/actions/drag.js';
|
||||||
|
import { switchEditorMode } from './utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
copyByKeyboard,
|
copyByKeyboard,
|
||||||
cutByKeyboard,
|
cutByKeyboard,
|
||||||
@@ -20,6 +19,7 @@ import {
|
|||||||
SHORT_KEY,
|
SHORT_KEY,
|
||||||
type,
|
type,
|
||||||
} from './utils/actions/keyboard.js';
|
} from './utils/actions/keyboard.js';
|
||||||
|
import { getLinkedDocPopover } from './utils/actions/linked-doc.js';
|
||||||
import {
|
import {
|
||||||
captureHistory,
|
captureHistory,
|
||||||
enterPlaygroundRoom,
|
enterPlaygroundRoom,
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import { expect, type Locator } from '@playwright/test';
|
import { expect, type Locator } from '@playwright/test';
|
||||||
import { getFormatBar } from 'utils/query.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
dragBetweenIndices,
|
dragBetweenIndices,
|
||||||
@@ -39,6 +38,7 @@ import {
|
|||||||
assertTextContent,
|
assertTextContent,
|
||||||
} from './utils/asserts.js';
|
} from './utils/asserts.js';
|
||||||
import { test } from './utils/playwright.js';
|
import { test } from './utils/playwright.js';
|
||||||
|
import { getFormatBar } from './utils/query.js';
|
||||||
|
|
||||||
async function isToggleIconVisible(toggleIcon: Locator) {
|
async function isToggleIconVisible(toggleIcon: Locator) {
|
||||||
const connected = await toggleIcon.isVisible();
|
const connected = await toggleIcon.isVisible();
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user