浏览代码

Fix dnd e2e tests (#5762)

Andelf 3 年之前
父节点
当前提交
0f30893636
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. 1 1
      e2e-tests/basic.spec.ts
  2. 7 7
      e2e-tests/dnd.spec.ts

+ 1 - 1
e2e-tests/basic.spec.ts

@@ -223,5 +223,5 @@ test('invalid page props #3944', async ({ page, block }) => {
   await block.mustFill('public:: true\nsize:: 65535')
   await page.press('textarea >> nth=0', 'Enter')
   // Force rendering property block
-  await block.clickNext()
+  await block.enterNext()
 })

+ 7 - 7
e2e-tests/dnd.spec.ts

@@ -33,21 +33,21 @@ test('drop to left center', async ({ page }) => {
 })
 
 
-test('drop to upper left', async ({ page }) => {
+test('drop to upper left', async ({ page, block }) => {
   await createRandomPage(page)
 
-  await page.fill('textarea >> nth=0', 'block a')
-  await enterNextBlock(page)
+  await block.mustFill('block a')
+  await block.enterNext()
 
-  await page.fill('textarea >> nth=0', 'block b')
-  await page.press('textarea >> nth=0', 'Escape')
+  await block.mustFill('block b')
+  await block.escapeEditing()
 
   const bullet = page.locator('span.bullet-container >> nth=-1')
   const where = page.locator('.ls-block >> nth=0')
   await bullet.dragTo(where, {
     targetPosition: {
-      x: 30,
-      y: 5
+      x: 0,
+      y: 0
     }
   })