Skip to content

Commit

Permalink
Merge branch 'main' into SPSH-1127
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmadp committed Sep 27, 2024
2 parents d84da48 + 4a76966 commit df808b4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 67 deletions.
3 changes: 0 additions & 3 deletions docs/testcases.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Testfälle(Testname)

## Api.spec.ts
### GET und Post request Personen und Benutzer anschließend über das FE löschen @long @short @stage

## Klasse.spec.ts
### Eine Klasse als Landesadmin anlegen und die Klasse anschließend in der Ergebnisliste suchen und dann löschen @long @short @stage
### Ergebnisliste Klassen als Landesadmin auf Vollständigkeit prüfen @long @short @stage
Expand Down
6 changes: 6 additions & 0 deletions pages/admin/PersonDetailsView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export class PersonDetailsViewPage{
readonly icon_pwVisible: Locator;
readonly input_pw: Locator;
readonly button_close_pwreset: Locator;
readonly button_deletePerson: Locator;
readonly button_deletePersonConfirm: Locator;
readonly button_closeDeletePersonConfirm: Locator;

constructor(page){
this.page = page;
Expand All @@ -19,5 +22,8 @@ export class PersonDetailsViewPage{
this.icon_pwVisible = page.getByTestId('show-password-icon');
this.input_pw = page.locator('[data-testid="password-output-field"] input');
this.button_close_pwreset = page.getByTestId('close-password-reset-dialog-button');
this.button_deletePerson = page.getByTestId('open-person-delete-dialog-icon');
this.button_deletePersonConfirm = page.getByTestId('person-delete-button');
this.button_closeDeletePersonConfirm = page.getByTestId('close-person-delete-success-dialog-button');
}
}
27 changes: 27 additions & 0 deletions tests/Person.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { StartPage } from "../pages/StartView.page";
import { MenuPage } from "../pages/MenuBar.page";
import { PersonCreationViewPage } from "../pages/admin/PersonCreationView.page";
import { PersonManagementViewPage } from "../pages/admin/PersonManagementView.page";
import { PersonDetailsViewPage } from "../pages/admin/PersonDetailsView.page";
import { HeaderPage } from "../pages/Header.page";
import { faker } from "@faker-js/faker/locale/de";
import { deletePersonen, getPersonId, createPersonWithUserContext } from "../base/api/testHelperPerson.page";
Expand Down Expand Up @@ -682,4 +683,30 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await deleteRolle(page, userInfo.rolleId);
});
});

test("Einen Benutzer über das FE löschen @long @short @stage", async ({page, }) => {
const PersonManagementView = new PersonManagementViewPage(page);
const PersonDetailsView = new PersonDetailsViewPage(page);

const vorname = "TAuto-PW-V-" + faker.person.firstName();
const nachname = "TAuto-PW-N-" + faker.person.lastName();
const rolle = "TAuto-PW-R-" + faker.lorem.word({ length: { min: 8, max: 12 }});
const berechtigung = 'SYSADMIN';
const idSP = await getSPId(page, 'Schulportal-Administration');

await test.step(`Neuen Benutzer über die api anlegen`, async () => {
await createPersonWithUserContext(page, 'Land Schleswig-Holstein', berechtigung, vorname, nachname, idSP, rolle);
})

await test.step(`Benutzer wieder löschen über das FE`, async () => {
await page.goto(FRONTEND_URL + "admin/personen");
await PersonManagementView.input_Suchfeld.fill(nachname);
await PersonManagementView.button_Suchen.click();
await page.getByRole("cell", { name: nachname, exact: true }).click();
await PersonDetailsView.button_deletePerson.click();
await PersonDetailsView.button_deletePersonConfirm.click();
await PersonDetailsView.button_closeDeletePersonConfirm.click();
await expect(page.getByRole("cell", { name: nachname, exact: true })).toBeHidden();
});
})
});
64 changes: 0 additions & 64 deletions tests/api.spec.ts

This file was deleted.

0 comments on commit df808b4

Please sign in to comment.