Skip to content

Commit

Permalink
[e2e] [Unauthenticated Landing] Paperwork Reduction Act (#956)
Browse files Browse the repository at this point in the history
closes #941

## Changes
- e2e: tests if a user can navigate from the unauthenticated landing
page to the Paperwork Reduction Act

## How to test
- Run `npx playwright test --ui`
- Run the test under `paperworkReductionAct.spec.ts`
  • Loading branch information
shindigira authored Sep 27, 2024
1 parent 260fcb6 commit 916f49d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { expect, test } from '@playwright/test';
import { expectedPaperworkReductionActUrl } from '../../../utils/testFixture.utils';

test('Unauthenticated homepage: Paperwork Reduction Act', async ({ page }) => {
test.slow();

await test.step('Verify on the Paperwork Reduction Act and link exists', async () => {
await page.goto('/');
await expect(page.locator('#sidebar')).toContainText(
'Paperwork Reduction Act',
);
await expect(
page.getByRole('link', { name: 'View Paperwork Reduction Act' }),
).toBeVisible();
});

await test.step('Navigates to the Paperwork Reduction Act summary', async () => {
await page
.getByRole('link', { name: 'View Paperwork Reduction Act' })
.click();
await expect(page).toHaveURL(expectedPaperworkReductionActUrl);
await expect(page.getByText('/Home')).toBeVisible();
await expect(page.getByRole('heading')).toContainText(
'Paperwork Reduction Act statement',
);
});
});
2 changes: 2 additions & 0 deletions e2e/utils/testFixture.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const expectedWithAssociationsUrl =
/\/profile\/complete\/with-associations$/; // $ = ends with

export const expectedPrivacyNoticeUrl = /\/privacy-notice$/; // $ = ends with
export const expectedPaperworkReductionActUrl =
/\/paperwork-reduction-act-notice$/; // $ = ends with

export interface Account {
testUsername: string;
Expand Down

0 comments on commit 916f49d

Please sign in to comment.