Skip to content

Commit

Permalink
Spsh 799 bestaetigungsseiten (#48)
Browse files Browse the repository at this point in the history
* Neuer Testfall Bestaetigungsseite Klassen pruefen

* Bestaetigungsseite Benutzer und Klasse fertig

* Bestätigungsseite Rolle fertig

* Test Bestaetigungsseiten fertig

* Mehere Benutzer hintereinander anlegen in der Rolle Landesadmin für die Rollenarten SuS und LEHR und die Bestätigungsseiten vollständig prüfen

* Testfall fertig: Mehere Benutzer hintereinander anlegen in der Rolle Landesadmin für die Rollenarten SuS und LEHR und die Bestätigungsseiten vollständig prüfen

* Testdaten angepasst

* fix sonarcloud issues

* Update tests/Klasse.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

* Update tests/Person.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

* fix Rechtschreibfehler

* Update tests/Person.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

* Leerzeichen im Dateinamen entfernt

* Rechtschreibfehler korrigiert

* Update tests/Schule.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

* Rechtschreibfehler korrigiert

* fix, Organisationen Land haben jetzt eine Dienstellennummer, Zurgriff auf auf die Dropdowns angepasst.

* Update tests/Klasse.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

* Update tests/Rolle.spec.ts

Co-authored-by: Julian Aggarwal <[email protected]>

---------

Co-authored-by: Julian Aggarwal <[email protected]>
  • Loading branch information
jakobmadp and jaggarnaut authored Aug 20, 2024
1 parent 7449b24 commit 835f752
Show file tree
Hide file tree
Showing 15 changed files with 611 additions and 38 deletions.
12 changes: 12 additions & 0 deletions base/api/testHelperOrganisation.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ export async function getOrganisationId(page: Page, nameOrganisation: string): P
expect(response.status()).toBe(200);
const json = await response.json();
return json[0].id;
}

export async function deleteKlasse(page: Page, KlasseId: string): Promise<void> {
const response = await page.request.delete(FRONTEND_URL + `api/organisationen/${KlasseId}/klasse`, {});
expect(response.status()).toBe(204);
}

export async function getKlasseId(page: Page, Klassennname: string): Promise<string> {
const response = await page.request.get(FRONTEND_URL + `api/organisationen?name=${Klassennname}&excludeTyp=ROOT&excludeTyp=LAND&excludeTyp=TRAEGER&excludeTyp=SCHULE&excludeTyp=ANBIETER&excludeTyp=SONSTIGE%20ORGANISATION%20%2F%20EINRICHTUNG&excludeTyp=UNBESTAETIGT`, {});
expect(response.status()).toBe(200);
const json = await response.json();
return json[0].id;
}
8 changes: 8 additions & 0 deletions base/api/testHelperPerson.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function createPerson(page: Page, familienname: string, vorname: st
}

export async function createPersonWithUserContext(page: Page, organisationName: string, rollenArt: string, familienname: string, vorname: string, idSP: string, rolleName: string): Promise<UserInfo> {
// Organisation wird nicht angelegt, da diese zur Zeit nicht gelöscht werden kann
// API-Calls machen und Benutzer mit Kontext anlegen
const organisationId: string = await getOrganisationId(page, organisationName);
const rolleId: string = await createRolle(page, rollenArt, organisationId, rolleName);
Expand All @@ -37,4 +38,11 @@ export async function createPersonWithUserContext(page: Page, organisationName:
export async function deletePersonen(page: Page, personId: string): Promise<void> {
const response = await page.request.delete(FRONTEND_URL + `api/personen/${personId}`, {});
expect(response.status()).toBe(204);
}

export async function getPersonId(page: Page, Benutzername: string): Promise<string> {
const response = await page.request.get(FRONTEND_URL + `api/personen-frontend?suchFilter=${Benutzername}`, {});
expect(response.status()).toBe(200);
const json = await response.json();
return json.items[0].person.id;
}
7 changes: 7 additions & 0 deletions base/api/testHelperRolle.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ export async function addSystemrechtToRolle(page: Page, rolleId: string, systemr
export async function deleteRolle(page: Page, RolleId: string): Promise<void> {
const response = await page.request.delete(FRONTEND_URL + `api/rolle/${RolleId}`, {});
expect(response.status()).toBe(204);
}

export async function getRolleId(page: Page, Rollenname: string): Promise<string> {
const response = await page.request.get(FRONTEND_URL + `api/rolle?searchStr=${Rollenname}`, {});
expect(response.status()).toBe(200);
const json = await response.json();
return json[0].id;
}
File renamed without changes.
1 change: 1 addition & 0 deletions pages/LoginView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ export class LoginPage{
await this.input_ConfirmPW.click();
await this.input_ConfirmPW.fill(new_Password);
await this.button_submitPWChange.click();
return new_Password;
}
}
20 changes: 20 additions & 0 deletions pages/admin/KlasseCreationView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,37 @@ import { type Locator, Page } from '@playwright/test';
export class KlasseCreationViewPage{
readonly page: Page;
readonly text_h2_KlasseAnlegen: Locator;
readonly button_Schliessen: Locator;
readonly combobox_Schulstrukturknoten: Locator;
readonly input_Klassenname: Locator;
readonly button_KlasseAnlegen: Locator;
readonly text_success: Locator;
readonly icon_success: Locator;
readonly text_DatenGespeichert: Locator;
readonly label_Schule: Locator;
readonly data_Schule: Locator;
readonly label_Klasse: Locator;
readonly data_Klasse: Locator;
readonly button_ZurueckErgebnisliste: Locator;
readonly button_WeitereKlasseAnlegen: Locator;

constructor(page){
// Anlage Klasse
this.page = page;
this.text_h2_KlasseAnlegen = page.getByTestId('layout-card-headline');
this.button_Schliessen = page.getByTestId('close-layout-card-button');
this.combobox_Schulstrukturknoten = page.getByTestId('schule-select').locator('.v-input__control');
this.input_Klassenname = page.getByTestId('klassenname-input').locator('input');
this.button_KlasseAnlegen = page.getByTestId('klasse-form-create-button');
// Bestätigungsseite Klasse
this.text_success = page.getByTestId('klasse-success-text');
this.icon_success = page.locator('.mdi-check-circle');
this.text_DatenGespeichert = page.getByText('Folgende Daten wurden gespeichert:');
this.label_Schule = page.getByText('Schule:', { exact: true });
this.data_Schule = page.getByTestId('created-klasse-schule');
this.label_Klasse = page.getByText('Klassenname:', { exact: true });
this.data_Klasse = page.getByTestId('created-klasse-name');
this.button_ZurueckErgebnisliste = page.getByTestId('back-to-list-button');
this.button_WeitereKlasseAnlegen = page.getByTestId('create-another-klasse-button');
}
}
6 changes: 6 additions & 0 deletions pages/admin/KlasseManagementView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export class KlasseManagementViewPage{
readonly combobox_Filter_Klasse: Locator;
readonly table_header_Dienststellennummer: Locator;
readonly table_header_Klassenname: Locator;
readonly icon_KlasseLoeschen: Locator;
readonly button_KlasseLoeschen: Locator;
readonly button_SchliesseKlasseLoeschenDialog: Locator;

constructor(page){
this.page = page;
Expand All @@ -17,5 +20,8 @@ export class KlasseManagementViewPage{
this.combobox_Filter_Klasse = page.getByPlaceholder('Klasse');
this.table_header_Dienststellennummer = page.getByText('Dienststellennummer');
this.table_header_Klassenname = page.getByTestId('klasse-table').getByText('Klasse', { exact: true });
this.icon_KlasseLoeschen = page.getByTestId('open-klasse-delete-dialog-icon');
this.button_KlasseLoeschen = page.getByTestId('klasse-delete-button');
this.button_SchliesseKlasseLoeschenDialog = page.getByTestId('close-klasse-delete-success-dialog-button');
}
}
40 changes: 36 additions & 4 deletions pages/admin/PersonCreationView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export class PersonCreationViewPage{
readonly page: Page;
readonly body: Locator;
readonly text_h2_PersonAnlegen: Locator;
readonly button_Schliessen: Locator;
readonly combobox_Rolle: Locator;
readonly combobox_Rolle_Clear: Locator;
readonly Input_Vorname: Locator;
Expand All @@ -13,16 +14,32 @@ export class PersonCreationViewPage{
readonly combobox_Klasse: Locator;
readonly button_PersonAnlegen: Locator;
readonly text_success: Locator;
readonly text_Bestaetigungsseite_Benutzername: Locator;
readonly icon_success: Locator;
readonly text_DatenGespeichert: Locator;
readonly text_Bestaetigungsseite_Benutzernachname: Locator;
readonly text_Bestaetigungsseite_Rolle: Locator;
readonly input_EinstiegsPasswort: Locator;
readonly label_EinstiegsPasswort: Locator;
readonly button_ZurueckErgebnisliste: Locator;
readonly button_WeiterenBenutzerAnlegen: Locator;
readonly label_Vorname: Locator;
readonly data_Vorname: Locator;
readonly label_Nachname: Locator;
readonly data_Nachname: Locator;
readonly label_Benutzername: Locator;
readonly data_Benutzername: Locator;
readonly label_Rolle: Locator;
readonly data_Rolle: Locator;
readonly label_Organisationsebene: Locator;
readonly data_Organisationsebene: Locator;
readonly label_Klasse: Locator;
readonly data_Klasse: Locator;

constructor(page){
// Anlage Person
this.page = page;
this.body = page.locator('body');
this.text_h2_PersonAnlegen = page.getByTestId('layout-card-headline');
this.button_Schliessen = page.getByTestId('close-layout-card-button');
this.combobox_Rolle = page.getByTestId('rolle-select').locator('.v-field__input');
this.combobox_Rolle_Clear = page.getByTestId('rolle-select').getByLabel('leeren');
this.combobox_Schulstrukturknoten_Clear = page.getByTestId('organisation-select').getByLabel('leeren');
Expand All @@ -31,10 +48,25 @@ export class PersonCreationViewPage{
this.combobox_Schulstrukturknoten = page.getByTestId('organisation-select').locator('.v-field__input');
this.combobox_Klasse = page.getByTestId('klasse-select').locator('.v-field__input');
this.button_PersonAnlegen = page.getByTestId('person-creation-form-create-button');
// Bestätigungsseite Klasse
this.text_success = page.getByTestId('person-success-text');
this.text_Bestaetigungsseite_Benutzername = page.getByTestId('created-person-username');
this.text_Bestaetigungsseite_Rolle = page.getByTestId('created-person-rolle');
this.icon_success = page.locator('.mdi-check-circle');
this.text_DatenGespeichert = page.getByText('Folgende Daten wurden gespeichert:');
this.label_Vorname = page.getByText('Vorname:', { exact: true });
this.data_Vorname = page.getByTestId('created-person-vorname');
this.label_Nachname = page.getByText('Nachname:', { exact: true });
this.data_Nachname = page.getByTestId('created-person-familienname');
this.label_Benutzername = page.getByText('Benutzername:', { exact: true });
this.data_Benutzername = page.getByTestId('created-person-username');
this.label_Rolle = page.getByText('Rolle:', { exact: true });
this.data_Rolle = page.getByTestId('created-person-rolle');
this.label_Organisationsebene = page.getByText('Organisationsebene:', { exact: true });
this.data_Organisationsebene = page.getByTestId('created-person-organisation');
this.label_Klasse = page.getByText('Klasse:', { exact: true });
this.data_Klasse = page.getByTestId('created-person-klasse');
this.label_EinstiegsPasswort = page.getByText(' Einstiegs-Passwort:', { exact: true });
this.input_EinstiegsPasswort = page.locator('[data-testid="password-output-field"] input');
this.button_ZurueckErgebnisliste = page.getByTestId('back-to-list-button');
this.button_WeiterenBenutzerAnlegen = page.getByTestId('create-another-person-button');
}
}
38 changes: 38 additions & 0 deletions pages/admin/RolleCreationView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,61 @@ import { type Locator, Page } from '@playwright/test';
export class RolleCreationViewPage{
readonly page: Page;
readonly text_h2_RolleAnlegen: Locator;
readonly button_Schliessen: Locator;
readonly combobox_Schulstrukturknoten: Locator;
readonly combobox_Rollenart: Locator;
readonly input_Rollenname: Locator;
readonly combobox_Merkmal: Locator;
readonly combobox_Angebote: Locator;
readonly combobox_Systemrechte: Locator;
readonly button_RolleAnlegen: Locator;
readonly button_WeitereRolleAnlegen: Locator;
readonly button_ZurueckErgebnisliste: Locator;
readonly text_success: Locator;
readonly icon_success: Locator;
readonly text_DatenGespeichert: Locator;
readonly label_Administrationsebene: Locator;
readonly data_Administrationsebene: Locator;
readonly label_Rollenart: Locator;
readonly data_Rollenart: Locator;
readonly label_Rollenname: Locator;
readonly data_Rollenname: Locator;
readonly label_Merkmale: Locator;
readonly data_Merkmale: Locator;
readonly label_Angebote: Locator;
readonly data_Angebote: Locator;
readonly label_Systemrechte: Locator;
readonly data_Systemrechte: Locator;

constructor(page){
// Anlage Rolle
this.page = page;
this.text_h2_RolleAnlegen = page.getByTestId('layout-card-headline');
this.button_Schliessen = page.getByTestId('close-layout-card-button');
this.combobox_Schulstrukturknoten = page.getByTestId('administrationsebene-select').locator('.v-input__control');
this.combobox_Rollenart = page.getByTestId('rollenart-select').locator('.v-input__control');
this.input_Rollenname = page.getByTestId('rollenname-input').locator('input');
this.combobox_Merkmal = page.getByTestId('merkmale-select').locator('.v-input__control');
this.combobox_Angebote = page.getByTestId('service-provider-select').locator('.v-input__control');
this.combobox_Systemrechte = page.getByTestId('systemrechte-select').locator('.v-input__control');
this.button_RolleAnlegen = page.getByTestId('rolle-form-create-button');
this.button_WeitereRolleAnlegen = page.getByTestId('create-another-rolle-button');
// Bestätigungsseite Rolle
this.button_ZurueckErgebnisliste = page.getByTestId('back-to-list-button');
this.text_success = page.getByTestId('rolle-success-text');
this.icon_success = page.locator('.mdi-check-circle');
this.text_DatenGespeichert = page.getByText('Folgende Daten wurden gespeichert:');
this.label_Administrationsebene = page.getByText('Administrationsebene:', { exact: true });
this.data_Administrationsebene = page.getByTestId('created-rolle-administrationsebene');
this.label_Rollenart = page.getByText('Rollenart:', { exact: true });
this.data_Rollenart = page.getByTestId('created-rolle-rollenart');
this.label_Rollenname = page.getByText('Rollenname:', { exact: true });
this.data_Rollenname = page.getByTestId('created-rolle-name');
this.label_Merkmale = page.getByText('Merkmale:', { exact: true });
this.data_Merkmale = page.getByTestId('created-rolle-merkmale');
this.label_Angebote = page.getByText('Zugeordnete Angebote:', { exact: true });
this.data_Angebote = page.getByTestId('created-rolle-angebote');
this.label_Systemrechte = page.getByText('Systemrechte:', { exact: true });
this.data_Systemrechte = page.getByTestId('created-rolle-systemrecht');
}
}
24 changes: 23 additions & 1 deletion pages/admin/SchuleCreationView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,45 @@ import { type Locator, Page } from '@playwright/test';
export class SchuleCreationViewPage{
readonly page: Page;
readonly text_h2_SchuleAnlegen: Locator;
readonly button_Schliessen: Locator;
readonly radio_button_Public_Schule: Locator;
readonly radio_button_Ersatzschule: Locator;
readonly input_Dienststellennummer: Locator;
readonly input_Schulname: Locator;
readonly button_SchuleAnlegen: Locator;
readonly button_WeitereSchuleAnlegen: Locator;
readonly button_ZurueckErgebnisliste: Locator;
readonly text_success: Locator;

readonly icon_success: Locator;
readonly text_DatenGespeichert: Locator;
readonly label_Schulform: Locator;
readonly data_Schulform: Locator;
readonly label_Dienststellennummer: Locator;
readonly data_Dienststellennummer: Locator;
readonly label_Schulname: Locator;
readonly data_Schulname: Locator;

constructor(page){
// Anlage Schule
this.page = page;
this.text_h2_SchuleAnlegen = page.getByTestId('layout-card-headline');
this.button_Schliessen = page.getByTestId('close-layout-card-button');
this.radio_button_Public_Schule = page.getByTestId('public-schule-radio-button');
this.radio_button_Ersatzschule = page.getByTestId('ersatzschule-radio-button');
this.input_Dienststellennummer = page.getByTestId('dienststellennummer-input').locator('input');
this.input_Schulname = page.getByTestId('schulname-input').locator('input');
this.button_SchuleAnlegen = page.getByTestId('schule-creation-form-create-button');
this.button_WeitereSchuleAnlegen = page.getByTestId('create-another-schule-button');
// Bestätigungsseite
this.button_ZurueckErgebnisliste = page.getByTestId('back-to-list-button');
this.text_success = page.getByTestId('schule-success-text');
this.icon_success = page.locator('.mdi-check-circle');
this.text_DatenGespeichert = page.getByText('Folgende Daten wurden gespeichert:');
this.label_Schulform = page.getByText('Schulform:', { exact: true });
this.data_Schulform = page.getByTestId('created-schule-form');
this.label_Dienststellennummer = page.getByText('Dienststellennummer:', { exact: true });
this.data_Dienststellennummer = page.getByTestId('created-schule-dienststellennummer');
this.label_Schulname = page.getByText('Schulname:', { exact: true });
this.data_Schulname = page.getByTestId('created-schule-name');
}
}
4 changes: 2 additions & 2 deletions pages/admin/SchuleManagementView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export class SchuleManagementViewPage{
readonly page: Page;
readonly text_h1_Administrationsbereich: Locator;
readonly text_h2_Schulverwaltung: Locator;
readonly table_header_Dienstellennummer: Locator;
readonly table_header_Dienststellennummer: Locator;
readonly table_header_Schulname: Locator;

constructor(page){
this.page = page;
this.text_h1_Administrationsbereich = page.getByTestId('admin-headline');
this.text_h2_Schulverwaltung = page.getByTestId('layout-card-headline');
this.table_header_Dienstellennummer = page.getByText('Dienststellennummer');
this.table_header_Dienststellennummer = page.getByText('Dienststellennummer');
this.table_header_Schulname = page.getByText('Schulname');
}
}
Loading

0 comments on commit 835f752

Please sign in to comment.