-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
88 additions
and
76 deletions.
There are no files selected for viewing
50 changes: 26 additions & 24 deletions
50
frontend/e2e/navigate-to-affected-documents-and-test-content.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 |
---|---|---|
@@ -1,31 +1,33 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { amendingLaws } from "@e2e/testData/testData" | ||
|
||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify navigation to affected standard for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
// Navigation | ||
await page.goto(`/amending-laws/${amendingLaw.eli}/affected-documents`) | ||
test.describe("Affected documents page", () => { | ||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify navigation to affected documents for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
// Navigation | ||
await page.goto(`/amending-laws/${amendingLaw.eli}/affected-documents`) | ||
|
||
// Menu | ||
const locator = page.locator(`a:has-text("Betroffene Normenkomplexe")`) | ||
await expect(locator).toHaveClass(/router-link-active/) | ||
await expect(locator).toHaveClass(/bg-blue-200/) | ||
// Menu | ||
const locator = page.locator(`a:has-text("Betroffene Normenkomplexe")`) | ||
await expect(locator).toHaveClass(/router-link-active/) | ||
await expect(locator).toHaveClass(/bg-blue-200/) | ||
|
||
// Content | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
for (const article of amendingLaw.articles ?? []) { | ||
await expect( | ||
page.getByText(`Artikel ${article.enumeration}`), | ||
).toBeVisible() | ||
await expect(page.getByText(article.eli)).toBeVisible() | ||
} | ||
// Content | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
for (const article of amendingLaw.articles ?? []) { | ||
await expect( | ||
page.getByText(`Artikel ${article.enumeration}`), | ||
).toBeVisible() | ||
await expect(page.getByText(article.eli)).toBeVisible() | ||
} | ||
|
||
await expect(page.getByText("Metadaten editieren")).toBeVisible() | ||
await expect(page.getByText("Metadaten editieren")).toBeVisible() | ||
|
||
// Back | ||
await page.getByText("Zurück").click() | ||
await expect(page).toHaveURL("/amending-laws") | ||
}) | ||
} | ||
// Back | ||
await page.getByText("Zurück").click() | ||
await expect(page).toHaveURL("/amending-laws") | ||
}) | ||
} | ||
}) |
64 changes: 33 additions & 31 deletions
64
frontend/e2e/navigate-to-article-overview-and-test-content.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 |
---|---|---|
@@ -1,38 +1,40 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { amendingLaws } from "@e2e/testData/testData" | ||
|
||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify navigation to articles page for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
// Navigation | ||
await page.goto(`/amending-laws/${amendingLaw.eli}/articles`) | ||
test.describe("Articles page", () => { | ||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify navigation to articles page for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
// Navigation | ||
await page.goto(`/amending-laws/${amendingLaw.eli}/articles`) | ||
|
||
// Menu | ||
const locator = page.locator(`a:has-text("Artikelübersicht")`) | ||
await expect(locator).toHaveClass(/router-link-active/) | ||
await expect(locator).toHaveClass(/bg-blue-200/) | ||
// Menu | ||
const locator = page.locator(`a:has-text("Artikelübersicht")`) | ||
await expect(locator).toHaveClass(/router-link-active/) | ||
await expect(locator).toHaveClass(/bg-blue-200/) | ||
|
||
// Content | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
for (const article of amendingLaw.articles ?? []) { | ||
await expect( | ||
page.getByText(`Artikel ${article.enumeration}`), | ||
).toBeVisible() | ||
await expect( | ||
page.getByText(article.title, { | ||
exact: true, | ||
}), | ||
).toBeVisible() | ||
} | ||
// Content | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
for (const article of amendingLaw.articles ?? []) { | ||
await expect( | ||
page.getByText(`Artikel ${article.enumeration}`), | ||
).toBeVisible() | ||
await expect( | ||
page.getByText(article.title, { | ||
exact: true, | ||
}), | ||
).toBeVisible() | ||
} | ||
|
||
const checkChangeCommandButton = page.locator( | ||
'text="Änderungsbefehl prüfen"', | ||
) | ||
await expect(checkChangeCommandButton).toBeVisible() | ||
const checkChangeCommandButton = page.locator( | ||
'text="Änderungsbefehl prüfen"', | ||
) | ||
await expect(checkChangeCommandButton).toBeVisible() | ||
|
||
// Back | ||
await page.click("text=Zurück") | ||
await expect(page).toHaveURL("/amending-laws") | ||
}) | ||
} | ||
// Back | ||
await page.click("text=Zurück") | ||
await expect(page).toHaveURL("/amending-laws") | ||
}) | ||
} | ||
}) |
22 changes: 13 additions & 9 deletions
22
frontend/e2e/navigate-to-detail-page-and-test-header.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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { amendingLaws, getExpectedHeading } from "@e2e/testData/testData" | ||
|
||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify header for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
await page.goto(`/amending-laws/${amendingLaw.eli}`) | ||
test.describe("Info header", () => { | ||
for (const amendingLaw of amendingLaws) { | ||
test(`navigate and verify header for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
await page.goto(`/amending-laws/${amendingLaw.eli}`) | ||
|
||
await expect(page.getByText(getExpectedHeading(amendingLaw))).toBeVisible() | ||
await expect(page.getByText(amendingLaw.title ?? "")).toBeVisible() | ||
}) | ||
} | ||
await expect( | ||
page.getByText(getExpectedHeading(amendingLaw)), | ||
).toBeVisible() | ||
await expect(page.getByText(amendingLaw.title ?? "")).toBeVisible() | ||
}) | ||
} | ||
}) |
28 changes: 16 additions & 12 deletions
28
frontend/e2e/redirect-to-amending-laws-page-and-test-content.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