-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tester detaljvisning for NAV-visning av Arbeidsmarkedstiltak
- Loading branch information
Showing
6 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
frontend/mulighetsrommet-veileder-flate/tests/nav-arbeidsmarkedstiltak.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { sjekkUU } from "./playwrightUtils"; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/nav"); | ||
}); | ||
|
||
test.describe("Tiltaksoversikt", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/nav/oversikt"); | ||
}); | ||
|
||
test("Sjekk at det er tiltaksgjennomføringer i oversikten", async ({ page }) => { | ||
const rows = page.getByTestId("oversikt_tiltaksgjennomforinger").getByRole("link"); | ||
await expect(page.getByTestId("oversikt_tiltaksgjennomforinger")).toContainText( | ||
"Avklaring - Fredrikstad", | ||
); | ||
await expect(await rows.count()).toBeGreaterThan(5); | ||
}); | ||
|
||
test("Sjekk UU", async ({ page }) => { | ||
await sjekkUU(page); | ||
}); | ||
|
||
test.describe("Tiltaksgjennomføringsdetaljer for alle NAV-ansatte", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/nav/oversikt"); | ||
await page.getByTestId("tiltaksgjennomforing_sindres-mentorordning-med-yoda").click(); | ||
}); | ||
|
||
test("Sjekk UU", async ({ page }) => { | ||
await sjekkUU(page); | ||
}); | ||
|
||
test("Sjekk riktig tiltaksgjennomføring", async ({ page }) => { | ||
await expect( | ||
page.getByTestId("tiltaksgjennomforing-header_sindres-mentorordning-med-yoda"), | ||
).toContainText("Sindres mentorordning med Yoda"); | ||
}); | ||
|
||
test("Sjekk at 'Del me bruker', 'Start påmelding' eller 'Opprett avtale' ikke eksisterer", async ({ | ||
page, | ||
}) => { | ||
await expect(page.getByTestId("deleknapp")).toHaveCount(0); | ||
await expect(page.getByTestId("start-pamelding-lenke")).toHaveCount(0); | ||
await expect(page.getByTestId("opprettavtaleknapp")).toHaveCount(0); | ||
}); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
frontend/mulighetsrommet-veileder-flate/tests/playwrightUtils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import AxeBuilder from "@axe-core/playwright"; | ||
import { Page, expect } from "@playwright/test"; | ||
|
||
export const sjekkUU = async (page: Page) => { | ||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) | ||
.analyze(); | ||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}; |
9 changes: 1 addition & 8 deletions
9
frontend/mulighetsrommet-veileder-flate/tests/veilederflate.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters