Skip to content

Commit

Permalink
Fix locators (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmadp committed Jul 19, 2024
1 parent d1338e2 commit db4c2ec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
2 changes: 1 addition & 1 deletion tests/Klasse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe(`Testfälle für die Administration von Klassen: Umgebung: ${proce
const KlasseCreationView = new KlasseCreationViewPage(page);
const KlasseManagementView = new KlasseManagementViewPage(page);
const SCHULNAME = "Testschule Schulportal";
const KLASSENNAME = "TAuto-PW-K-12 " + faker.lorem.word({ length: { min: 4, max: 8 }});
const KLASSENNAME = "TAuto-PW-K-12 " + faker.lorem.word({ length: { min: 10, max: 10 }});

await test.step(`Dialog Schule anlegen öffnen`, async () => {
await Startseite.card_item_schulportal_administration.click();
Expand Down
22 changes: 11 additions & 11 deletions tests/Person.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
const Rolle = "Lehrkraft";
const Vorname = "TAuto-PW-V-" + faker.person.firstName();
const Nachname = "TAuto-PW-N-" + faker.person.lastName();
const Schulstrukturknoten = "(Testschule Schulportal)";
const Schulstrukturknoten = "Testschule Schulportal";
let Benutzername = "";
let Einstiegspasswort = "";

Expand All @@ -53,7 +53,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.button_PersonAnlegen.click();
Expand Down Expand Up @@ -121,7 +121,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.button_PersonAnlegen.click();
Expand Down Expand Up @@ -152,7 +152,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
const Rolle = "LiV";
const Vorname = "TAuto-PW-V-" + faker.person.firstName();
const Nachname = "TAuto-PW-N-" + faker.person.lastName();
const Schulstrukturknoten = "(Testschule Schulportal)";
const Schulstrukturknoten = "Testschule Schulportal";

await test.step(`Dialog Person anlegen öffnen`, async () => {
await Startseite.card_item_schulportal_administration.click();
Expand All @@ -164,7 +164,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.button_PersonAnlegen.click();
Expand Down Expand Up @@ -207,7 +207,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.button_PersonAnlegen.click();
Expand Down Expand Up @@ -251,11 +251,11 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.combobox_Klasse.click();
await page.getByText(Klasse).click();
await page.getByText(Klasse, { exact: true }).click();
await PersonCreationView.button_PersonAnlegen.click();
});

Expand Down Expand Up @@ -358,7 +358,7 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await test.step(`Organisation 'Schule' auswählen und Dropdown 'Rolle' prüfen`, async () => {
await PersonCreationView.combobox_Schulstrukturknoten_Clear.click();
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Organisation_Schule, { exact: true }).click();
await page.getByText(Organisation_Schule).click();
await PersonCreationView.combobox_Rolle.click();
await expect(PersonCreationView.body).toContainText(Rolle_Lehr);
await expect(PersonCreationView.body).toContainText(Rolle_LiV);
Expand All @@ -375,15 +375,15 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
const Rolle = "Lehrkraft";
const Vorname = "TAuto-PW-V-" + faker.person.firstName();
const Nachname = "TAuto-PW-N-" + faker.person.lastName();
const Schulstrukturknoten = "(Testschule Schulportal)";
const Schulstrukturknoten = "Testschule Schulportal";
let Benutzername = "";

await test.step(`Benutzer Lehrkraft anlegen`, async () => {
await page.goto(FRONTEND_URL + "admin/personen/new");
await PersonCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(Schulstrukturknoten).click();
await PersonCreationView.combobox_Rolle.click();
await page.getByText(Rolle).click();
await page.getByText(Rolle, { exact: true }).click();
await PersonCreationView.Input_Vorname.fill(Vorname);
await PersonCreationView.Input_Nachname.fill(Nachname);
await PersonCreationView.button_PersonAnlegen.click();
Expand Down
26 changes: 9 additions & 17 deletions tests/Rolle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ test.describe(`Testfälle für die Administration von Rollen: Umgebung: ${proces
const RolleCreationView = new RolleCreationViewPage(page);
const RolleManagementView = new RolleManagementViewPage(page);

const ROLLENNAME1 =
"TAuto-PW-R1-" + faker.lorem.word({ length: { min: 8, max: 12 } });
const ROLLENNAME2 =
"TAuto-PW-R2-" + faker.lorem.word({ length: { min: 8, max: 12 } });
const ROLLENNAME1 = "TAuto-PW-R1-" + faker.lorem.word({ length: { min: 8, max: 12 } });
const ROLLENNAME2 = "TAuto-PW-R2-" + faker.lorem.word({ length: { min: 8, max: 12 } });
const SCHULSTRUKTURKNOTEN1 = "Land Schleswig-Holstein";
const SCHULSTRUKTURKNOTEN2 = "0703754 (Amalie-Sieveking-Schule)";
const ROLLENART1 = "Lern";
Expand All @@ -43,17 +41,15 @@ test.describe(`Testfälle für die Administration von Rollen: Umgebung: ${proces
await test.step(`Dialog Rolle anlegen öffnen`, async () => {
await Startseite.card_item_schulportal_administration.click();
await Menue.menueItem_RolleAnlegen.click();
await expect(RolleCreationView.text_h2_RolleAnlegen).toHaveText(
"Neue Rolle hinzufügen"
);
await expect(RolleCreationView.text_h2_RolleAnlegen).toHaveText("Neue Rolle hinzufügen");
});

await test.step(`Erste Rolle anlegen`, async () => {
await RolleCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(`${SCHULSTRUKTURKNOTEN1}`, { exact: true }).click();
await page.getByText(SCHULSTRUKTURKNOTEN1, { exact: true }).click();

await RolleCreationView.combobox_Rollenart.click();
await page.getByText(`${ROLLENART1}`).click();
await page.getByText(ROLLENART1, { exact: true }).click();

await RolleCreationView.input_Rollenname.fill(ROLLENNAME1);
await RolleCreationView.button_RolleAnlegen.click();
Expand All @@ -63,10 +59,10 @@ test.describe(`Testfälle für die Administration von Rollen: Umgebung: ${proces
await test.step(`Zweite Rolle anlegen`, async () => {
await RolleCreationView.button_WeitereRolleAnlegen.click();
await RolleCreationView.combobox_Schulstrukturknoten.click();
await page.getByText(`${SCHULSTRUKTURKNOTEN2}`, { exact: true }).click();
await page.getByText(SCHULSTRUKTURKNOTEN2, { exact: true }).click();

await RolleCreationView.combobox_Rollenart.click();
await page.getByText(`${ROLLENART2}`).click();
await page.getByText(ROLLENART2, { exact: true }).click();

await RolleCreationView.input_Rollenname.fill(ROLLENNAME2);
await RolleCreationView.button_RolleAnlegen.click();
Expand All @@ -91,16 +87,12 @@ test.describe(`Testfälle für die Administration von Rollen: Umgebung: ${proces
await test.step(`Rollenverwaltung öffnen und alle Elemente in der Ergebnisliste auf Existenz prüfen`, async () => {
await Startseite.card_item_schulportal_administration.click();
await Menue.menueItem_AlleRollenAnzeigen.click();
await expect(
RolleManagementView.text_h1_Administrationsbereich
).toBeVisible();
await expect(RolleManagementView.text_h1_Administrationsbereich).toBeVisible();
await expect(RolleManagementView.text_h2_Rollenverwaltung).toBeVisible();
await expect(RolleManagementView.table_header_Rollenname).toBeVisible();
await expect(RolleManagementView.table_header_Rollenart).toBeVisible();
await expect(RolleManagementView.table_header_Merkmale).toBeVisible();
await expect(
RolleManagementView.table_header_Administrationsebene
).toBeVisible();
await expect(RolleManagementView.table_header_Administrationsebene).toBeVisible();
});
});
});

0 comments on commit db4c2ec

Please sign in to comment.