From 1bcf8db3b797259256530de207a24a16d0215de3 Mon Sep 17 00:00:00 2001 From: Konstantinos Kaloutas Date: Wed, 4 Jan 2023 10:56:52 +0200 Subject: [PATCH] enhance: test stability --- e2e-tests/whiteboards.spec.ts | 38 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/e2e-tests/whiteboards.spec.ts b/e2e-tests/whiteboards.spec.ts index eedc70d27e2..0f91859c4af 100644 --- a/e2e-tests/whiteboards.spec.ts +++ b/e2e-tests/whiteboards.spec.ts @@ -4,7 +4,7 @@ import { IsMac } from './utils' test('enable whiteboards', async ({ page }) => { await page.evaluate(() => { - window.localStorage.removeItem('ls-onboarding-whiteboard?') + window.localStorage.setItem('ls-onboarding-whiteboard?', "true") }) await expect(page.locator('.nav-header .whiteboard')).toBeHidden() @@ -19,26 +19,17 @@ test('enable whiteboards', async ({ page }) => { test('create new whiteboard', async ({ page }) => { await page.click('.nav-header .whiteboard') await page.click('#tl-create-whiteboard') + await page.waitForTimeout(2000) await expect(page.locator('.logseq-tldraw')).toBeVisible() }) -test('check if the page contains the onboarding whiteboard', async ({ - page, -}) => { - await expect( - page.locator('.tl-text-shape-wrapper >> text=Welcome to') - ).toHaveCount(1) -}) - -test('cleanup the shapes', async ({ page }) => { - if (IsMac) { - await page.keyboard.press('Meta+a') - } else { - await page.keyboard.press('Control+a') - } - await page.keyboard.press('Delete') - await expect(page.locator('[data-type=Shape]')).toHaveCount(0) -}) +// test('check if the page contains the onboarding whiteboard', async ({ +// page, +// }) => { +// await expect( +// page.locator('.tl-text-shape-wrapper >> text=Welcome to') +// ).toHaveCount(1) +// }) test('can right click title to show context menu', async ({ page }) => { await page.click('.whiteboard-page-title', { @@ -100,6 +91,17 @@ test('draw a rectangle', async ({ page }) => { ).not.toHaveCount(0) }) + +test('cleanup the shapes', async ({ page }) => { + if (IsMac) { + await page.keyboard.press('Meta+a') + } else { + await page.keyboard.press('Control+a') + } + await page.keyboard.press('Delete') + await expect(page.locator('[data-type=Shape]')).toHaveCount(0) +}) + test('zoom in', async ({ page }) => { await page.click('#tl-zoom-in') await expect(page.locator('#tl-zoom')).toContainText('125%')