From 687fb4b14087961f13fa69e9e3fe5f3289d974a6 Mon Sep 17 00:00:00 2001 From: Youssef Bouchara <101522419+YoussefBouch@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:57:38 +0100 Subject: [PATCH] Added for the Schule filter (#96) --- pages/admin/PersonManagementView.page.ts | 2 ++ tests/Person.spec.ts | 25 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/pages/admin/PersonManagementView.page.ts b/pages/admin/PersonManagementView.page.ts index cca3472..5fecc87 100644 --- a/pages/admin/PersonManagementView.page.ts +++ b/pages/admin/PersonManagementView.page.ts @@ -18,6 +18,7 @@ export class PersonManagementViewPage{ readonly comboboxMenuIcon_Rolle: Locator; readonly comboboxMenuIcon_Klasse: Locator; readonly comboboxMenuIcon_Status: Locator; + readonly comboboxMenuIcon_Schule_input: Locator; constructor(page: Page){ this.page = page; @@ -33,6 +34,7 @@ export class PersonManagementViewPage{ this.table_header_Zuordnungen = page.getByText('Zuordnung(en)'); this.table_header_Klasse = page.getByTestId('person-table').getByText('Klasse', { exact: true }); this.comboboxMenuIcon_Schule = page.locator('[data-testid="schule-select"] .mdi-menu-down'); + this.comboboxMenuIcon_Schule_input = page.locator('[data-testid="schule-select"] input'); this.comboboxMenuIcon_Rolle = page.locator('[data-testid="rolle-select"] .mdi-menu-down'); this.comboboxMenuIcon_Klasse = page.locator('[data-testid="klasse-select"] .mdi-menu-down'); this.comboboxMenuIcon_Status = page.locator('[data-testid="status-select"] .mdi-menu-down'); diff --git a/tests/Person.spec.ts b/tests/Person.spec.ts index e8a0429..53571e9 100644 --- a/tests/Person.spec.ts +++ b/tests/Person.spec.ts @@ -461,6 +461,31 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro }); }); + + test("In der Ergebnisliste die Filterfunktion der Schulen benutzen als Landesadmin", {tag: [LONG, SHORT, STAGE]}, async ({ page }) => { + const personManagementView = new PersonManagementViewPage(page); + const schulstrukturknoten = "Testschule-PW665"; + + await test.step(`Filter öffnen und Schule selektieren`, async () => { + await page.goto(FRONTEND_URL + "admin/personen"); + await expect(personManagementView.text_h2_Benutzerverwaltung).toHaveText("Benutzerverwaltung"); + + // Fill the input with the name of the Schule and let the autocomplete find it + await personManagementView.comboboxMenuIcon_Schule_input.fill(schulstrukturknoten); + + // Click on the found Schule + await page.getByText(schulstrukturknoten).click(); + + // Close the dropdown + await personManagementView.comboboxMenuIcon_Schule.click(); + + // Click elsewhere on the page to fully confirm the selected Schule + await page.locator('body').click(); + + await expect(page.getByTestId('schule-select')).toHaveText('1111165 (Testschule-PW665)'); + }); +}); + test("Eine Lehrkraft anlegen in der Rolle Landesadmin und die Bestätigungsseite vollständig prüfen", {tag: [LONG, SHORT, STAGE]}, async ({ page }) => { const personCreationView = new PersonCreationViewPage(page); const rolle = "Lehrkraft";