Skip to content

Commit

Permalink
test: start each test at 'About' page
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalinDe committed Dec 4, 2023
1 parent a3f146a commit 16a75f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/frontend/tests/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import {

initI18n();

test.beforeEach(async ({ page }) => {
await page.goto(`${process.env.FRONT_END_URL}/about`);
});

// unauthenticated

test('Assert D-Voting logo is present', async({ page }) => {
await page.goto(`${process.env.FRONT_END_URL}/about`);
const logo = await page.getByAltText(i18n.t('Workflow'));
await expect(logo).toBeVisible();
await logo.click();
Expand All @@ -23,7 +26,6 @@ test('Assert D-Voting logo is present', async({ page }) => {
// authenticated non-admin

test('Assert "Profile" button is visible upon logging in', async({ page }) => {
await page.goto(process.env.FRONT_END_URL);
await assertOnlyVisibleToAuthenticated(
page, page.getByRole('button', { name: i18n.t('Profile') })
);
Expand All @@ -32,14 +34,12 @@ test('Assert "Profile" button is visible upon logging in', async({ page }) => {
// admin

test('Assert "Create form" button is (only) visible to admin', async({ page }) => {
await page.goto(process.env.FRONT_END_URL);
await assertOnlyVisibleToAdmin(
page, page.getByRole('link', { name: i18n.t('navBarCreateForm')})
);
});

test('Assert "Admin" button is (only) visible to admin', async({ page }) => {
await page.goto(process.env.FRONT_END_URL);
await assertOnlyVisibleToAdmin(
page, page.getByRole('link', { name: i18n.t('navBarAdmin') })
);
Expand Down

0 comments on commit 16a75f3

Please sign in to comment.