matrix-art

An image gallery for Matrix
git clone git://archive.git.mtrnord.blog/MTRNord/matrix-art.git
Log | Files | Refs | README | LICENSE

commit f494bfe29c58b9c6600ec744356c84a49f8a1e9b
parent 32e4a94d2e349224e19c731004b67c2147b89801
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue,  8 Feb 2022 02:32:58 +0100

Wait way too long for that one locator to make that stupid test less flaky

Diffstat:
Me2e/checkEnglishWorks.spec.ts | 19++++++++-----------
Me2e/navigateToDetails.spec.ts | 7++++---
Mtsconfig.json | 2+-
3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/e2e/checkEnglishWorks.spec.ts b/e2e/checkEnglishWorks.spec.ts @@ -4,22 +4,19 @@ test.use({ locale: 'en' }); -test('test if we have english words', async ({ page, baseURL }) => { - page.on('console', msg => console.log(msg.text())); - // Go to http://localhost:3000/ - await page.goto(baseURL || 'http://localhost:3000/'); - await page.waitForLoadState("networkidle"); - - expect(await page.locator("text=Home").isVisible()); -}); - test('test if the header is there and english with correct state', async ({ page, baseURL }) => { page.on('console', msg => console.log(msg.text())); - await page.waitForLoadState("networkidle"); // Go to http://localhost:3000/ - await page.goto(baseURL || 'http://localhost:3000/'); + await Promise.all([ + await page.waitForLoadState("networkidle"), + await page.goto(baseURL || 'http://localhost:3000/'), + ]); // Make sure that we have the Hader + (await Promise.all([ + await page.waitForTimeout(5000), + await page.locator('header') + ]))[1].isVisible(); expect(await page.locator('header').isVisible()).toBeTruthy(); // Make sure unauthenticated state is correct diff --git a/e2e/navigateToDetails.spec.ts b/e2e/navigateToDetails.spec.ts @@ -6,10 +6,11 @@ test.use({ test('test navigation to details', async ({ page, baseURL }) => { page.on('console', msg => console.log(msg.text())); - await page.waitForLoadState("networkidle"); - // Go to http://localhost:3000/ - await page.goto(baseURL || "http://localhost:3000"); + await Promise.all([ + await page.waitForLoadState("networkidle"), + await page.goto(baseURL || 'http://localhost:3000/'), + ]); // Check for the Home text await expect(page.locator('h1')).toContainText('Home'); // Click text=Flowers@mtrnord:art.midnightthoughts.space diff --git a/tsconfig.json b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2017", + "target": "es2015", "lib": [ "dom", "dom.iterable",