|
@@ -9,12 +9,12 @@ import { IsMac, createRandomPage, newBlock, newInnerBlock, randomString, lastBlo
|
|
|
* Consider diacritics
|
|
|
***/
|
|
|
|
|
|
- let hotkeyOpenLink = 'Control+o'
|
|
|
- let hotkeyBack = 'Control+['
|
|
|
- if (IsMac) {
|
|
|
- hotkeyOpenLink = 'Meta+o'
|
|
|
- hotkeyBack = 'Meta+['
|
|
|
- }
|
|
|
+let hotkeyOpenLink = 'Control+o'
|
|
|
+let hotkeyBack = 'Control+['
|
|
|
+if (IsMac) {
|
|
|
+ hotkeyOpenLink = 'Meta+o'
|
|
|
+ hotkeyBack = 'Meta+['
|
|
|
+}
|
|
|
|
|
|
test('Search page and blocks (diacritics)', async ({ page, block }) => {
|
|
|
const rand = randomString(20)
|
|
@@ -23,7 +23,9 @@ test('Search page and blocks (diacritics)', async ({ page, block }) => {
|
|
|
await createRandomPage(page)
|
|
|
|
|
|
await block.mustType('[[Einführung in die Allgemeine Sprachwissenschaft' + rand + ']] diacritic-block-1', { delay: 10 })
|
|
|
- await page.keyboard.press(hotkeyOpenLink)
|
|
|
+ await page.waitForTimeout(500)
|
|
|
+ await page.keyboard.press(hotkeyOpenLink, { delay: 10 })
|
|
|
+ await page.waitForTimeout(500)
|
|
|
|
|
|
const pageTitle = page.locator('.page-title').first()
|
|
|
expect(await pageTitle.innerText()).toEqual('Einführung in die Allgemeine Sprachwissenschaft' + rand)
|
|
@@ -82,7 +84,7 @@ test('Search CJK', async ({ page, block }) => {
|
|
|
await page.keyboard.press("Escape") // escape modal
|
|
|
})
|
|
|
|
|
|
-async function alias_test( block: Block, page: Page, page_name: string, search_kws: string[] ) {
|
|
|
+async function alias_test(block: Block, page: Page, page_name: string, search_kws: string[]) {
|
|
|
await createRandomPage(page)
|
|
|
|
|
|
const rand = randomString(10)
|
|
@@ -102,10 +104,10 @@ async function alias_test( block: Block, page: Page, page_name: string, search_k
|
|
|
// alias_test_content_1,
|
|
|
// alias_test_content_2, and
|
|
|
// alias_test_content_3 sequentially, to validate the target page state
|
|
|
- await page.type('textarea >> nth=0', 'alias:: [[' + alias_name, {delay: 10})
|
|
|
- await page.keyboard.press('Enter', {delay: 200}) // Enter for finishing selection
|
|
|
- await page.keyboard.press('Enter', {delay: 200}) // double Enter for exit property editing
|
|
|
- await page.keyboard.press('Enter', {delay: 200}) // double Enter for exit property editing
|
|
|
+ await page.type('textarea >> nth=0', 'alias:: [[' + alias_name, { delay: 10 })
|
|
|
+ await page.keyboard.press('Enter', { delay: 200 }) // Enter for finishing selection
|
|
|
+ await page.keyboard.press('Enter', { delay: 200 }) // double Enter for exit property editing
|
|
|
+ await page.keyboard.press('Enter', { delay: 200 }) // double Enter for exit property editing
|
|
|
await page.waitForTimeout(200)
|
|
|
await block.activeEditing(1)
|
|
|
await page.type('textarea >> nth=0', alias_test_content_1)
|
|
@@ -117,7 +119,7 @@ async function alias_test( block: Block, page: Page, page_name: string, search_k
|
|
|
// create alias ref in origin Page
|
|
|
await block.activeEditing(0)
|
|
|
await block.enterNext()
|
|
|
- await page.type('textarea >> nth=0', '[[' + alias_name, {delay: 20})
|
|
|
+ await page.type('textarea >> nth=0', '[[' + alias_name, { delay: 20 })
|
|
|
await page.keyboard.press('Enter') // Enter for finishing selection
|
|
|
await page.waitForTimeout(100)
|
|
|
|
|
@@ -148,7 +150,7 @@ async function alias_test( block: Block, page: Page, page_name: string, search_k
|
|
|
await newInnerBlock(page)
|
|
|
await page.type('textarea >> nth=0', alias_test_content_3)
|
|
|
page.keyboard.press(hotkeyBack)
|
|
|
-
|
|
|
+
|
|
|
await page.waitForNavigation()
|
|
|
await block.escapeEditing()
|
|
|
// clicking alias ref opening test
|