Skip to content

Commit

Permalink
e2e tests: Fix the "empty page" test
Browse files Browse the repository at this point in the history
  • Loading branch information
juyrjola committed Oct 18, 2024
1 parent 8d25c6e commit f9ddc08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions e2e-tests/common/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 6 additions & 5 deletions e2e-tests/tests/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f9ddc08

Please sign in to comment.