Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPSH-1375: Fixed the flaky test by selecting another locator. #98

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pages/admin/PersonCreationView.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class PersonCreationViewPage{
readonly data_Organisationsebene: Locator;
readonly label_Klasse: Locator;
readonly data_Klasse: Locator;
readonly listbox_Rolle: Locator;

constructor(page){
// Anlage Person
Expand Down Expand Up @@ -70,5 +71,6 @@ export class PersonCreationViewPage{
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');
this.listbox_Rolle = page.locator('.v-list');
}
}
40 changes: 20 additions & 20 deletions tests/Person.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await page.getByText(Organisation_Land, { exact: true }).nth(1).click();

await personCreationView.combobox_Rolle.click();
await expect(personCreationView.body).toContainText(landesadminRolle);
await expect(personCreationView.body).not.toContainText(rolleLehr);
await expect(personCreationView.body).not.toContainText(rolleLiV);
await expect(personCreationView.body).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.body).not.toContainText(schuelerRolle);
await expect(personCreationView.listbox_Rolle).toContainText(landesadminRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLehr);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLiV);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuelerRolle);
});

await test.step(`Organisation 'Öffentliche Schulen Land Schleswig-Holstein' auswählen und Dropdown 'Rolle' prüfen`, async () => {
Expand All @@ -365,11 +365,11 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await page.keyboard.type(Organisation_OeffentlicheSchule);
await page.getByText(Organisation_OeffentlicheSchule, { exact: true }).click();
await personCreationView.combobox_Rolle.click();
await expect(personCreationView.body).toContainText(landesadminRolle);
await expect(personCreationView.body).not.toContainText(rolleLehr);
await expect(personCreationView.body).not.toContainText(rolleLiV);
await expect(personCreationView.body).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.body).not.toContainText(schuelerRolle);
await expect(personCreationView.listbox_Rolle).toContainText(landesadminRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLehr);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLiV);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuelerRolle);
});

await test.step(`Organisation 'Ersatzschulen Land Schleswig-Holstein' auswählen und Dropdown 'Rolle' prüfen`, async () => {
Expand All @@ -378,23 +378,23 @@ test.describe(`Testfälle für die Administration von Personen": Umgebung: ${pro
await page.keyboard.type(Organisation_Ersatzschule);
await page.getByText(Organisation_Ersatzschule, { exact: true }).click();
await personCreationView.combobox_Rolle.click();
await expect(personCreationView.body).toContainText(landesadminRolle);
await expect(personCreationView.body).not.toContainText(rolleLehr);
await expect(personCreationView.body).not.toContainText(rolleLiV);
await expect(personCreationView.body).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.body).not.toContainText(schuelerRolle);
await expect(personCreationView.listbox_Rolle).toContainText(landesadminRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLehr);
await expect(personCreationView.listbox_Rolle).not.toContainText(rolleLiV);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(schuelerRolle);
});

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).click();
await personCreationView.combobox_Rolle.click();
await expect(personCreationView.body).toContainText(rolleLehr);
await expect(personCreationView.body).toContainText(rolleLiV);
await expect(personCreationView.body).toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.body).toContainText(schuelerRolle);
await expect(personCreationView.body).not.toContainText(landesadminRolle);
await expect(personCreationView.listbox_Rolle).toContainText(rolleLehr);
await expect(personCreationView.listbox_Rolle).toContainText(rolleLiV);
await expect(personCreationView.listbox_Rolle).toContainText(schuladminOeffentlichRolle);
await expect(personCreationView.listbox_Rolle).toContainText(schuelerRolle);
await expect(personCreationView.listbox_Rolle).not.toContainText(landesadminRolle);
});
});

Expand Down
Loading