From 1e9bf765d58cd99fbf66703b91d96987666991f2 Mon Sep 17 00:00:00 2001 From: Manfred <141728305+jakobmadp@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:06:06 +0100 Subject: [PATCH 1/3] fix (#99) --- tests/workflow.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/workflow.spec.ts b/tests/workflow.spec.ts index d013bb4..2b2a3b4 100644 --- a/tests/workflow.spec.ts +++ b/tests/workflow.spec.ts @@ -103,6 +103,12 @@ test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.E await expect(personManagement.text_h2_Benutzerverwaltung).toBeVisible(); await personManagement.input_Suchfeld.fill(username); await personManagement.button_Suchen.click(); + await expect(header.icon_myProfil).toBeVisible(); + await expect(header.icon_logout).toBeVisible(); + await expect(personManagement.comboboxMenuIcon_Schule).toBeVisible(); + await expect(personManagement.comboboxMenuIcon_Rolle).toBeVisible(); + await expect(personManagement.comboboxMenuIcon_Klasse).toBeVisible(); + await expect(personManagement.comboboxMenuIcon_Status).toBeVisible(); await page.getByRole("cell", { name: lastname, exact: true }).click({delay:500}); }); From 0625c841429ab12e7c35c287f067a11ac556c366 Mon Sep 17 00:00:00 2001 From: Haby-Phael Mouko <130637379+phaelcg@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:00:27 +0100 Subject: [PATCH 2/3] SPSH-1359: Fixed the issue with the rollenName when the test once failed. (#97) Co-authored-by: Youssef Bouchara <101522419+YoussefBouch@users.noreply.github.com> --- base/testHelperGenerateTestdataNames.ts | 2 +- tests/Person.spec.ts | 7 ++++--- tests/PersonBearbeiten.spec.ts | 8 ++++---- tests/Profile.spec.ts | 13 +++++++------ tests/Schule.spec.ts | 3 ++- tests/SchulportalAdministration.spec.ts | 7 ++++--- tests/login.spec.ts | 3 ++- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/base/testHelperGenerateTestdataNames.ts b/base/testHelperGenerateTestdataNames.ts index 52134ad..9df7e9a 100644 --- a/base/testHelperGenerateTestdataNames.ts +++ b/base/testHelperGenerateTestdataNames.ts @@ -8,7 +8,7 @@ export async function generateLehrerNachname(){ return "TAuto-PW-N-" + faker.person.lastName(); } -export async function generateRolleName(){ +export function generateRolleName(){ return "TAuto-PW-R-" + faker.lorem.word({ length: { min: 8, max: 12 }}); } diff --git a/tests/Person.spec.ts b/tests/Person.spec.ts index 0ef8937..f0da1ab 100644 --- a/tests/Person.spec.ts +++ b/tests/Person.spec.ts @@ -15,6 +15,7 @@ import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page"; import { LONG, SHORT, STAGE, BROWSER } from "../base/tags"; import { deletePersonByUsername, deleteRolleById, deleteRolleByName } from "../base/testHelperDeleteTestdata.ts"; import { landesadminRolle, schuelerRolle, schuladminOeffentlichRolle } from "../base/roles.ts"; +import { generateRolleName } from "../base/testHelperGenerateTestdataNames.ts"; const PW: string | undefined = process.env.PW; const ADMIN: string | undefined = process.env.USER; @@ -229,7 +230,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro // Step 1: Create a Schuladmin as Landesadmin and login as the newly created Schuladmin user await test.step(`Schuladmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, schulstrukturknoten, 'LEIT', nachname, vorname, idSP, 'TAuto-PW-E-RolleLEIT'); + userInfo = await createRolleAndPersonWithUserContext(page, schulstrukturknoten, 'LEIT', nachname, vorname, idSP, generateRolleName()); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_VERWALTEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_ANLEGEN'); @@ -518,7 +519,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro await test.step(`Testdaten: Landesadmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, 'Land Schleswig-Holstein', 'SYSADMIN', 'TAuto-PW-B-Master', 'TAuto-PW-B-Hans', idSP, 'TAuto-PW-R-RolleSYSADMIN'); + userInfo = await createRolleAndPersonWithUserContext(page, 'Land Schleswig-Holstein', 'SYSADMIN', 'TAuto-PW-B-Master', 'TAuto-PW-B-Hans', idSP, generateRolleName()); await addSystemrechtToRolle(page, userInfo.rolleId, 'ROLLEN_VERWALTEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_SOFORT_LOESCHEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_VERWALTEN'); @@ -680,7 +681,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro 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 rolle = generateRolleName(); const berechtigung = 'SYSADMIN'; const idSP = await getSPId(page, 'Schulportal-Administration'); diff --git a/tests/PersonBearbeiten.spec.ts b/tests/PersonBearbeiten.spec.ts index c1b139c..546d84a 100644 --- a/tests/PersonBearbeiten.spec.ts +++ b/tests/PersonBearbeiten.spec.ts @@ -81,7 +81,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const addminVorname = "TAuto-PW-V-" + faker.person.firstName(); const adminNachname = "TAuto-PW-N-" + faker.person.lastName(); - const adminRolle = "TAuto-PW-LEIT-" + faker.lorem.word({length: {min: 8, max: 12}}); + const adminRolle = generateRolleName(); const adminRollenart = 'LEIT'; const adminOrganisation = 'Testschule-PW665'; const adminIdSP = await getSPId(page, 'Schulportal-Administration'); @@ -89,7 +89,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const lehrerVorname = "TAuto-PW-V-" + faker.person.firstName(); const lehrerNachname = "TAuto-PW-N-" + faker.person.lastName(); - const lehrerRolle = "TAuto-PW-LEHR-" + faker.lorem.word({length: {min: 8, max: 12}}); + const lehrerRolle = generateRolleName(); const lehrerRollenart = 'LEHR'; const lehrerOrganisation = 'Testschule-PW665'; const lehrerIdSP = await getSPId(page, 'E-Mail'); @@ -149,7 +149,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const sperrDatumAb = await generateDateToday() // Konkrete Testdaten für diesen Testfall await test.step(`Testdaten: Lehrer mit einer Rolle(LEHR) und SP(email) über die api anlegen ${ADMIN}`, async () => { - userInfoLehrer = await createRolleAndPersonWithUserContext(page, testschule, typelehrer, await generateLehrerNachname(), await generateLehrerVorname(), await getSPId(page, email), await generateRolleName()); + userInfoLehrer = await createRolleAndPersonWithUserContext(page, testschule, typelehrer, await generateLehrerNachname(), await generateLehrerVorname(), await getSPId(page, email), generateRolleName()); username.push(userInfoLehrer.username); rolleId.push(userInfoLehrer.rolleId); }) @@ -175,7 +175,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const sperrDatumBis = await generateDateFuture(5, 2); // Konkrete Testdaten für diesen Testfall await test.step(`Testdaten: Lehrer mit einer Rolle(LEHR) und SP(email) über die api anlegen ${ADMIN}`, async () => { - userInfoLehrer = await createRolleAndPersonWithUserContext(page, testschule, typelehrer, await generateLehrerNachname(), await generateLehrerVorname(), await getSPId(page, email), await generateRolleName()); + userInfoLehrer = await createRolleAndPersonWithUserContext(page, testschule, typelehrer, await generateLehrerNachname(), await generateLehrerVorname(), await getSPId(page, email), generateRolleName()); username.push(userInfoLehrer.username); rolleId.push(userInfoLehrer.rolleId); }) diff --git a/tests/Profile.spec.ts b/tests/Profile.spec.ts index e61f822..3a534ef 100644 --- a/tests/Profile.spec.ts +++ b/tests/Profile.spec.ts @@ -12,6 +12,7 @@ import { UserInfo } from "../base/api/testHelper.page"; import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page"; import { LONG, SHORT, STAGE, BROWSER } from "../base/tags"; import { deleteRolleById, deletePersonByUsername} from "../base/testHelperDeleteTestdata"; +import { generateRolleName } from "../base/testHelperGenerateTestdataNames"; const PW: string | undefined = process.env.PW; const ADMIN: string | undefined = process.env.USER; @@ -72,7 +73,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const vorname = "TAuto-PW-V-" + faker.person.firstName(); const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Land Schleswig-Holstein'; - const rollenname = 'TAuto-PW-R-RolleLandesadmin'; + const rollenname = generateRolleName(); const rollenart = 'SYSADMIN' await test.step(`Landesadmin via api anlegen und mit diesem anmelden`, async () => { @@ -140,7 +141,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = 'TAuto-PW-R-RolleLehrer'; + const rollenname = generateRolleName(); const rollenart = 'LEHR'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -198,7 +199,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = 'TAuto-PW-R-RolleSchüler'; + const rollenname = generateRolleName(); const rollenart = 'LERN'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -255,7 +256,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = 'TAuto-PW-R-RolleSchuladmin'; + const rollenname = generateRolleName(); const rollenart = 'LEIT' await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -316,7 +317,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const organisation2 = 'Carl-Orff-Schule'; const dienststellenNr1 = '1111111'; const dienststellenNr2 = '0702948'; - const rollenname = 'TAuto-PW-R-RolleLehrer'; + const rollenname = generateRolleName(); const rollenart = 'LEHR'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -383,7 +384,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const vorname = "TAuto-PW-V-" + faker.person.firstName(); const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; - const rollenname = 'TAuto-PW-R-RolleSchüler'; + const rollenname = generateRolleName(); const rollenart = 'LERN'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { diff --git a/tests/Schule.spec.ts b/tests/Schule.spec.ts index 699b936..f82ac71 100644 --- a/tests/Schule.spec.ts +++ b/tests/Schule.spec.ts @@ -14,6 +14,7 @@ import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page"; import { FooterDataTablePage } from "../pages/FooterDataTable.page"; import { LONG, SHORT, STAGE, BROWSER } from "../base/tags"; import { deletePersonById, deleteRolleById } from "../base/testHelperDeleteTestdata"; +import { generateRolleName } from "../base/testHelperGenerateTestdataNames"; const PW: string | undefined = process.env.PW; const ADMIN: string | undefined = process.env.USER; @@ -149,7 +150,7 @@ test.describe(`Testfälle für die Administration von Schulen: Umgebung: ${proce const startseite: StartPage = await test.step(`Testdaten: Schuladmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierLEIT', 'TAuto-PW-B-Hans', idSP, 'TAuto-PW-R-RolleLEIT'); + userInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierLEIT', 'TAuto-PW-B-Hans', idSP, generateRolleName()); personId.push(userInfo.personId); roleId.push(userInfo.rolleId); await addSystemrechtToRolle(page, userInfo.rolleId, 'SCHULEN_VERWALTEN'); diff --git a/tests/SchulportalAdministration.spec.ts b/tests/SchulportalAdministration.spec.ts index 75b0d79..1e139a4 100644 --- a/tests/SchulportalAdministration.spec.ts +++ b/tests/SchulportalAdministration.spec.ts @@ -9,6 +9,7 @@ import { addSystemrechtToRolle } from "../base/api/testHelperRolle.page"; import { UserInfo } from "../base/api/testHelper.page"; import { LONG, SHORT, STAGE } from "../base/tags"; import { deletePersonById, deleteRolleById } from "../base/testHelperDeleteTestdata"; +import { generateRolleName } from "../base/testHelperGenerateTestdataNames"; const PW: string | undefined = process.env.PW; const ADMIN: string | undefined = process.env.USER; @@ -60,7 +61,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'E-Mail'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEHR', 'TAuto-PW-B-MeierLehrer', 'TAuto-PW-B-Hans', idSP, 'TAuto-PW-R-RolleLehrer'); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEHR', 'TAuto-PW-B-MeierLehrer', 'TAuto-PW-B-Hans', idSP, generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); await header.logout(); @@ -87,7 +88,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'itslearning'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LERN', 'TAuto-PW-B-JansenSchüler', 'TAuto-PW-B-Helga', idSP, 'TAuto-PW-R-RolleSuS'); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LERN', 'TAuto-PW-B-JansenSchüler', 'TAuto-PW-B-Helga', idSP, generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); await header.logout(); @@ -114,7 +115,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'Schulportal-Administration'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierAdmin', 'TAuto-PW-B-Peter', idSP, 'TAuto-PW-R-RolleSchuladmin'); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierAdmin', 'TAuto-PW-B-Peter', idSP, generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); diff --git a/tests/login.spec.ts b/tests/login.spec.ts index ca7220d..98c2482 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -10,6 +10,7 @@ import { faker } from "@faker-js/faker/locale/de"; import { UserInfo } from "../base/api/testHelper.page.ts"; import { deletePersonByUsername, deleteRolleById } from "../base/testHelperDeleteTestdata.ts"; import { getOrganisationId } from "../base/api/testHelperOrganisation.page.ts"; +import { generateRolleName } from '../base/testHelperGenerateTestdataNames.ts'; const PW: string | undefined = process.env.PW; const ADMIN: string | undefined = process.env.USER; @@ -108,7 +109,7 @@ test.describe(`Testfälle für die Authentifizierung: Umgebung: ${process.env.UM const lehrerVorname = "TAuto-PW-V-" + faker.person.firstName(); const lehrerNachname = "TAuto-PW-N-" + faker.person.lastName(); - const lehrerRolle = "TAuto-PW-LEHR-" + faker.lorem.word({ length: { min: 8, max: 12 }}); + const lehrerRolle = generateRolleName(); const lehrerRollenart = 'LEHR'; const lehrerOrganisation = 'Testschule Schulportal'; let userInfoLehrer: UserInfo; From 0a6d4c161dd164f6e22e9182d37efd4b61a11d72 Mon Sep 17 00:00:00 2001 From: Haby-Phael Mouko <130637379+phaelcg@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:50:43 +0100 Subject: [PATCH 3/3] Spsh-1359: Made the method generateRolleName async (#100) * SPSH-1359: Fixed the issue with the rollenName when the test once failed. * SPSH-1359: Made the method generateRolleName() async * SPSH-1359: Cleaned up file * SPSH-1359: Added async to the method generateRolleName --- base/testHelperGenerateTestdataNames.ts | 6 ++---- tests/Person.spec.ts | 6 +++--- tests/PersonBearbeiten.spec.ts | 4 ++-- tests/Profile.spec.ts | 12 ++++++------ tests/Schule.spec.ts | 2 +- tests/SchulportalAdministration.spec.ts | 6 +++--- tests/login.spec.ts | 2 +- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/base/testHelperGenerateTestdataNames.ts b/base/testHelperGenerateTestdataNames.ts index 9df7e9a..bee955f 100644 --- a/base/testHelperGenerateTestdataNames.ts +++ b/base/testHelperGenerateTestdataNames.ts @@ -8,8 +8,6 @@ export async function generateLehrerNachname(){ return "TAuto-PW-N-" + faker.person.lastName(); } -export function generateRolleName(){ +export async function generateRolleName(){ return "TAuto-PW-R-" + faker.lorem.word({ length: { min: 8, max: 12 }}); -} - - +} \ No newline at end of file diff --git a/tests/Person.spec.ts b/tests/Person.spec.ts index f0da1ab..3cd4d53 100644 --- a/tests/Person.spec.ts +++ b/tests/Person.spec.ts @@ -230,7 +230,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro // Step 1: Create a Schuladmin as Landesadmin and login as the newly created Schuladmin user await test.step(`Schuladmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, schulstrukturknoten, 'LEIT', nachname, vorname, idSP, generateRolleName()); + userInfo = await createRolleAndPersonWithUserContext(page, schulstrukturknoten, 'LEIT', nachname, vorname, idSP, await generateRolleName()); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_VERWALTEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_ANLEGEN'); @@ -519,7 +519,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro await test.step(`Testdaten: Landesadmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, 'Land Schleswig-Holstein', 'SYSADMIN', 'TAuto-PW-B-Master', 'TAuto-PW-B-Hans', idSP, generateRolleName()); + userInfo = await createRolleAndPersonWithUserContext(page, 'Land Schleswig-Holstein', 'SYSADMIN', 'TAuto-PW-B-Master', 'TAuto-PW-B-Hans', idSP, await generateRolleName()); await addSystemrechtToRolle(page, userInfo.rolleId, 'ROLLEN_VERWALTEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_SOFORT_LOESCHEN'); await addSystemrechtToRolle(page, userInfo.rolleId, 'PERSONEN_VERWALTEN'); @@ -681,7 +681,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const vorname = "TAuto-PW-V-" + faker.person.firstName(); const nachname = "TAuto-PW-N-" + faker.person.lastName(); - const rolle = generateRolleName(); + const rolle = await generateRolleName(); const berechtigung = 'SYSADMIN'; const idSP = await getSPId(page, 'Schulportal-Administration'); diff --git a/tests/PersonBearbeiten.spec.ts b/tests/PersonBearbeiten.spec.ts index 546d84a..ffbdf10 100644 --- a/tests/PersonBearbeiten.spec.ts +++ b/tests/PersonBearbeiten.spec.ts @@ -81,7 +81,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const addminVorname = "TAuto-PW-V-" + faker.person.firstName(); const adminNachname = "TAuto-PW-N-" + faker.person.lastName(); - const adminRolle = generateRolleName(); + const adminRolle = await generateRolleName(); const adminRollenart = 'LEIT'; const adminOrganisation = 'Testschule-PW665'; const adminIdSP = await getSPId(page, 'Schulportal-Administration'); @@ -89,7 +89,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro const lehrerVorname = "TAuto-PW-V-" + faker.person.firstName(); const lehrerNachname = "TAuto-PW-N-" + faker.person.lastName(); - const lehrerRolle = generateRolleName(); + const lehrerRolle = await generateRolleName(); const lehrerRollenart = 'LEHR'; const lehrerOrganisation = 'Testschule-PW665'; const lehrerIdSP = await getSPId(page, 'E-Mail'); diff --git a/tests/Profile.spec.ts b/tests/Profile.spec.ts index 3a534ef..c04b12e 100644 --- a/tests/Profile.spec.ts +++ b/tests/Profile.spec.ts @@ -73,7 +73,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const vorname = "TAuto-PW-V-" + faker.person.firstName(); const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Land Schleswig-Holstein'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'SYSADMIN' await test.step(`Landesadmin via api anlegen und mit diesem anmelden`, async () => { @@ -141,7 +141,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'LEHR'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -199,7 +199,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'LERN'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -256,7 +256,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; const dienststellenNr = '1111111'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'LEIT' await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -317,7 +317,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const organisation2 = 'Carl-Orff-Schule'; const dienststellenNr1 = '1111111'; const dienststellenNr2 = '0702948'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'LEHR'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { @@ -384,7 +384,7 @@ test.describe(`Testfälle für das eigene Profil anzeigen: Umgebung: ${process.e const vorname = "TAuto-PW-V-" + faker.person.firstName(); const nachname = "TAuto-PW-N-" + faker.person.lastName(); const organisation = 'Testschule Schulportal'; - const rollenname = generateRolleName(); + const rollenname = await generateRolleName(); const rollenart = 'LERN'; await test.step(`Lehrer via api anlegen und mit diesem anmelden`, async () => { diff --git a/tests/Schule.spec.ts b/tests/Schule.spec.ts index f82ac71..a346e26 100644 --- a/tests/Schule.spec.ts +++ b/tests/Schule.spec.ts @@ -150,7 +150,7 @@ test.describe(`Testfälle für die Administration von Schulen: Umgebung: ${proce const startseite: StartPage = await test.step(`Testdaten: Schuladmin anlegen und mit diesem anmelden`, async () => { const idSP = await getSPId(page, 'Schulportal-Administration'); - userInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierLEIT', 'TAuto-PW-B-Hans', idSP, generateRolleName()); + userInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierLEIT', 'TAuto-PW-B-Hans', idSP, await generateRolleName()); personId.push(userInfo.personId); roleId.push(userInfo.rolleId); await addSystemrechtToRolle(page, userInfo.rolleId, 'SCHULEN_VERWALTEN'); diff --git a/tests/SchulportalAdministration.spec.ts b/tests/SchulportalAdministration.spec.ts index 1e139a4..056cc33 100644 --- a/tests/SchulportalAdministration.spec.ts +++ b/tests/SchulportalAdministration.spec.ts @@ -61,7 +61,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'E-Mail'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEHR', 'TAuto-PW-B-MeierLehrer', 'TAuto-PW-B-Hans', idSP, generateRolleName()); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEHR', 'TAuto-PW-B-MeierLehrer', 'TAuto-PW-B-Hans', idSP, await generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); await header.logout(); @@ -88,7 +88,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'itslearning'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LERN', 'TAuto-PW-B-JansenSchüler', 'TAuto-PW-B-Helga', idSP, generateRolleName()); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LERN', 'TAuto-PW-B-JansenSchüler', 'TAuto-PW-B-Helga', idSP, await generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); await header.logout(); @@ -115,7 +115,7 @@ test.describe(`Testfälle für Schulportal Administration": Umgebung: ${process. await login.login(ADMIN, PW); const idSP = await getSPId(page, 'Schulportal-Administration'); - const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierAdmin', 'TAuto-PW-B-Peter', idSP, generateRolleName()); + const userInfo: UserInfo = await createRolleAndPersonWithUserContext(page, 'Testschule Schulportal', 'LEIT', 'TAuto-PW-B-MeierAdmin', 'TAuto-PW-B-Peter', idSP, await generateRolleName()); personId.push(userInfo.personId); rolleId.push(userInfo.rolleId); diff --git a/tests/login.spec.ts b/tests/login.spec.ts index 98c2482..3f7b4d3 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -109,7 +109,7 @@ test.describe(`Testfälle für die Authentifizierung: Umgebung: ${process.env.UM const lehrerVorname = "TAuto-PW-V-" + faker.person.firstName(); const lehrerNachname = "TAuto-PW-N-" + faker.person.lastName(); - const lehrerRolle = generateRolleName(); + const lehrerRolle = await generateRolleName(); const lehrerRollenart = 'LEHR'; const lehrerOrganisation = 'Testschule Schulportal'; let userInfoLehrer: UserInfo;