Skip to content

Commit

Permalink
Added for the Schule filter (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefBouch authored Nov 21, 2024
1 parent 9a207fd commit 687fb4b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pages/admin/PersonManagementView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
Expand Down
25 changes: 25 additions & 0 deletions tests/Person.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 687fb4b

Please sign in to comment.