From f9ddc08983ae09b785085ef020fb3fc030c1293d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Yrj=C3=B6l=C3=A4?= Date: Fri, 18 Oct 2024 17:38:26 +0300 Subject: [PATCH] e2e tests: Fix the "empty page" test --- e2e-tests/common/context.ts | 3 +-- e2e-tests/tests/basic.spec.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e-tests/common/context.ts b/e2e-tests/common/context.ts index fa6da9f9..339c02ed 100644 --- a/e2e-tests/common/context.ts +++ b/e2e-tests/common/context.ts @@ -318,8 +318,7 @@ export function getIdentifiersToTest(): string[] { export function getPageBaseUrlToTest(instanceId: string): string { let baseUrl = - process.env.TEST_PAGE_BASE_URL || - `https://{instanceId}.watch.staging.kausal.tech`; + process.env.TEST_PAGE_BASE_URL || `http://{instanceId}.localhost:3000`; baseUrl = baseUrl.replace('{instanceId}', instanceId); return baseUrl; } diff --git a/e2e-tests/tests/basic.spec.ts b/e2e-tests/tests/basic.spec.ts index 3a56b618..fae9016d 100644 --- a/e2e-tests/tests/basic.spec.ts +++ b/e2e-tests/tests/basic.spec.ts @@ -97,17 +97,18 @@ const testPlan = (planId: string) => }); test('empty page', async ({ page, ctx }) => { - const EmptyPageMenuItem = ctx.getEmptyPageMenuItem(); - test.skip(!EmptyPageMenuItem, 'No empty pages for plan'); + const emptyPageMenuItem = ctx.getEmptyPageMenuItem(); + test.skip(!emptyPageMenuItem, 'No empty pages for plan'); - const items = ctx.getEmptyPageChildrenItems(EmptyPageMenuItem?.page.id); + const items = ctx.getEmptyPageChildrenItems(emptyPageMenuItem?.page.id); test.skip( !items || items.length === 0, 'No children category or content pages for plan' ); const nav = page.locator('nav#global-navigation-bar'); - const emptyPageMenuLink = nav.getByRole('link', { - name: EmptyPageMenuItem?.page.title, + await expect(nav).toBeVisible(); + const emptyPageMenuLink = nav.getByRole('button', { + name: emptyPageMenuItem?.page.title, exact: true, }); await emptyPageMenuLink.click();