Skip to content

Commit

Permalink
test(e2e): improve page-ref test robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
cnrpman authored and tiensonqin committed Jan 13, 2022
1 parent 4775be1 commit 1612a30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions e2e-tests/page-refs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async function alias_test (page, page_name: string){
await page.keyboard.press(hotkeyBack)

// clicking opening test
await page.waitForSelector('.page-blocks-inner .ls-block .page-ref >> nth=-1')
await page.click('.page-blocks-inner .ls-block .page-ref >> nth=-1')
await lastInnerBlock(page)
expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(alias_test_content_3)
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export async function lastInnerBlock(page: Page): Promise<Locator> {
// discard any popups
await page.keyboard.press('Escape')
// click last block
await page.waitForSelector('.page-blocks-inner .ls-block >> nth=-1')
await page.click('.page-blocks-inner .ls-block >> nth=-1')
// wait for textarea
await page.waitForSelector(':nth-match(textarea, 1)', { state: 'visible' })

return page.locator(':nth-match(textarea, 1)')
}

Expand Down

0 comments on commit 1612a30

Please sign in to comment.