test(e2e): refine test for template expansion

This commit is contained in:
Andelf
2023-05-11 16:16:16 +08:00
parent 2a81e634a5
commit 862bbd7513
2 changed files with 16 additions and 3 deletions

View File

@@ -141,8 +141,8 @@ test('template', async ({ page, block }) => {
await block.waitForBlocks(5)
// NOTE: use delay to type slower, to trigger auto-completion UI.
await block.clickNext()
// See-also: #9354
await block.enterNext()
await block.mustType('/template')
await page.click('[title="Insert a created template here"]')
@@ -154,6 +154,19 @@ test('template', async ({ page, block }) => {
await popupMenuItem.click()
await block.waitForBlocks(9)
await block.clickNext()
await block.mustType('/template')
await page.click('[title="Insert a created template here"]')
// type to search template name
await page.keyboard.type(randomTemplate.substring(0, 3), { delay: 100 })
await popupMenuItem.waitFor({ timeout: 2000 }) // wait for template search
await popupMenuItem.click()
await block.waitForBlocks(13) // 9 + 4
})
test('auto completion square brackets', async ({ page, block }) => {

View File

@@ -27,7 +27,7 @@ const consoleLogWatcher = (msg: ConsoleMessage) => {
const text = msg.text()
logs += text + '\n'
expect(text, logs).not.toMatch(/^(Failed to|Uncaught)/)
expect(text, logs).not.toMatch(/^(Failed to|Uncaught|Assert failed)/)
// youtube video
// Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'ch-ua-reduced'.