|
@@ -111,6 +111,9 @@ test(
|
|
"but dont trigger RIME #3440 ",
|
|
"but dont trigger RIME #3440 ",
|
|
// cases should trigger [[]] #3251
|
|
// cases should trigger [[]] #3251
|
|
async ({ page, block }) => {
|
|
async ({ page, block }) => {
|
|
|
|
+ // This test requires dev mode
|
|
|
|
+ test.skip(process.env.RELEASE === 'true', 'not avaliable for release version')
|
|
|
|
+
|
|
for (let [idx, events] of [
|
|
for (let [idx, events] of [
|
|
kb_events.win10_pinyin_left_full_square_bracket,
|
|
kb_events.win10_pinyin_left_full_square_bracket,
|
|
kb_events.macos_pinyin_left_full_square_bracket
|
|
kb_events.macos_pinyin_left_full_square_bracket
|
|
@@ -253,7 +256,7 @@ test('undo after starting an action should close the action menu #6269', async (
|
|
// Open the action modal
|
|
// Open the action modal
|
|
await block.mustType('text1 ')
|
|
await block.mustType('text1 ')
|
|
await page.waitForTimeout(550)
|
|
await page.waitForTimeout(550)
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100) // Tolerable delay for the action menu to open
|
|
await page.waitForTimeout(100) // Tolerable delay for the action menu to open
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
@@ -275,8 +278,8 @@ test('#6266 moving cursor outside of brackets should close autocomplete menu', a
|
|
// First, left arrow
|
|
// First, left arrow
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
- await block.mustFill('')
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustFill('t ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100) // Sometimes it doesn't trigger without this
|
|
await page.waitForTimeout(100) // Sometimes it doesn't trigger without this
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
@@ -288,10 +291,9 @@ test('#6266 moving cursor outside of brackets should close autocomplete menu', a
|
|
// Then, right arrow
|
|
// Then, right arrow
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
- await block.mustFill('')
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustFill('t ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
- await page.waitForTimeout(100)
|
|
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
@@ -308,11 +310,8 @@ test('#6266 moving cursor outside of parens immediately after searching should s
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
- // TODO: Maybe remove these "text " entries in tests that don't need them
|
|
|
|
- await block.mustFill('')
|
|
|
|
- await page.waitForTimeout(550)
|
|
|
|
-
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustFill('t ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await page.keyboard.type("some block search text")
|
|
await page.keyboard.type("some block search text")
|
|
@@ -331,10 +330,9 @@ test('pressing up and down should NOT close autocomplete menu', async ({ page, b
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
- await block.mustFill('')
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustFill('t ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
- await page.waitForTimeout(100) // Sometimes it doesn't trigger without this
|
|
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
const cursorPos = await block.selectionStart()
|
|
const cursorPos = await block.selectionStart()
|
|
|
|
|
|
@@ -355,16 +353,15 @@ test('moving cursor inside of brackets should NOT close autocomplete menu', asyn
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
- await block.mustFill('')
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustType('test ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
if (commandTrigger === '[[') {
|
|
if (commandTrigger === '[[') {
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
}
|
|
}
|
|
|
|
|
|
- await page.keyboard.type("search")
|
|
|
|
- await page.waitForTimeout(100)
|
|
|
|
|
|
+ await page.keyboard.type("search", { delay: 20 })
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
// Move cursor, still inside the brackets
|
|
// Move cursor, still inside the brackets
|
|
@@ -381,7 +378,7 @@ test('moving cursor inside of brackets when autocomplete menu is closed should N
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
await block.mustFill('')
|
|
await block.mustFill('')
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100) // Sometimes it doesn't trigger without this
|
|
await page.waitForTimeout(100) // Sometimes it doesn't trigger without this
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
@@ -394,14 +391,14 @@ test('moving cursor inside of brackets when autocomplete menu is closed should N
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
|
|
|
|
- await page.keyboard.press('ArrowLeft', {delay: 50})
|
|
|
|
|
|
+ await page.keyboard.press('ArrowLeft', { delay: 50 })
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
|
|
|
|
- await page.keyboard.press('ArrowLeft', {delay: 50})
|
|
|
|
|
|
+ await page.keyboard.press('ArrowLeft', { delay: 50 })
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
await autocompleteMenu.expectHidden(modalName)
|
|
|
|
|
|
// Type a letter, this should open the autocomplete menu
|
|
// Type a letter, this should open the autocomplete menu
|
|
- await page.keyboard.type('z', { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type('z', { delay: 20 })
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
}
|
|
}
|
|
@@ -413,12 +410,12 @@ test('selecting text inside of brackets should NOT close autocomplete menu', asy
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
await block.mustFill('')
|
|
await block.mustFill('')
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
- await page.keyboard.type("some page search text", {delay: 10})
|
|
|
|
|
|
+ await page.keyboard.type("some page search text", { delay: 10 })
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
@@ -434,13 +431,13 @@ test('pressing backspace and remaining inside of brackets should NOT close autoc
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
// Open the autocomplete menu
|
|
// Open the autocomplete menu
|
|
- await block.mustFill('')
|
|
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await block.mustFill('test ')
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
- await page.keyboard.type("some page search text", {delay: 10})
|
|
|
|
|
|
+ await page.keyboard.type("some page search text", { delay: 10 })
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
await autocompleteMenu.expectVisible(modalName)
|
|
|
|
|
|
@@ -458,7 +455,7 @@ test('press escape when autocomplete menu is open, should close autocomplete men
|
|
// Open the action modal
|
|
// Open the action modal
|
|
await block.mustFill('text ')
|
|
await block.mustFill('text ')
|
|
await page.waitForTimeout(550)
|
|
await page.waitForTimeout(550)
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
@@ -480,7 +477,7 @@ test('press escape when link/image dialog is open, should restore focus to input
|
|
// Open the action modal
|
|
// Open the action modal
|
|
await block.mustFill('')
|
|
await block.mustFill('')
|
|
await page.waitForTimeout(550)
|
|
await page.waitForTimeout(550)
|
|
- await page.keyboard.type(commandTrigger, { delay: 10 })
|
|
|
|
|
|
+ await page.keyboard.type(commandTrigger, { delay: 20 })
|
|
|
|
|
|
await page.waitForTimeout(100)
|
|
await page.waitForTimeout(100)
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
await expect(page.locator(`[data-modal-name="${modalName}"]`)).toBeVisible()
|
|
@@ -503,9 +500,9 @@ test('should show text after soft return when node is collapsed #5074', async ({
|
|
const delay = 100
|
|
const delay = 100
|
|
await createRandomPage(page)
|
|
await createRandomPage(page)
|
|
|
|
|
|
- await page.type('textarea >> nth=0', 'Before soft return', {delay: 10})
|
|
|
|
- await page.keyboard.press('Shift+Enter', {delay: 10})
|
|
|
|
- await page.type('textarea >> nth=0', 'After soft return', {delay: 10})
|
|
|
|
|
|
+ await page.type('textarea >> nth=0', 'Before soft return', { delay: 10 })
|
|
|
|
+ await page.keyboard.press('Shift+Enter', { delay: 10 })
|
|
|
|
+ await page.type('textarea >> nth=0', 'After soft return', { delay: 10 })
|
|
|
|
|
|
await block.enterNext()
|
|
await block.enterNext()
|
|
expect(await block.indent()).toBe(true)
|
|
expect(await block.indent()).toBe(true)
|