-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spsh 686 Neue Testfälle Klassen fertig (#36)
* Neue Testfälle Klassen fertig * Update pages/admin/KlasseCreationView.page.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update pages/admin/KlasseCreationView.page.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update pages/admin/KlasseManagementView.page.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update pages/admin/KlasseManagementView.page.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update tests/Klasse.spec.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update tests/Klasse.spec.ts Co-authored-by: Julian Aggarwal <[email protected]> * Update tests/Klasse.spec.ts Co-authored-by: Julian Aggarwal <[email protected]> --------- Co-authored-by: Julian Aggarwal <[email protected]>
- Loading branch information
1 parent
8566db7
commit c4679e3
Showing
4 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { type Locator, Page } from '@playwright/test'; | ||
|
||
export class KlasseCreationViewPage{ | ||
readonly page: Page; | ||
readonly text_h2_KlasseAnlegen: Locator; | ||
readonly combobox_Schulstrukturknoten: Locator; | ||
readonly input_Klassenname: Locator; | ||
readonly button_KlasseAnlegen: Locator; | ||
readonly text_success: Locator; | ||
|
||
constructor(page){ | ||
this.page = page; | ||
this.text_h2_KlasseAnlegen = page.getByTestId('layout-card-headline'); | ||
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-creation-form-create-button'); | ||
this.text_success = page.getByTestId('klasse-success-text'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { type Locator, Page } from '@playwright/test'; | ||
|
||
export class KlasseManagementViewPage{ | ||
readonly page: Page; | ||
readonly text_h1_Administrationsbereich: Locator; | ||
readonly text_h2_Klassenverwaltung: Locator; | ||
readonly combobox_Filter_Schule: Locator; | ||
readonly combobox_Filter_Klasse: Locator; | ||
readonly table_header_Dienststellennummer: Locator; | ||
readonly table_header_Klassenname: Locator; | ||
|
||
constructor(page){ | ||
this.page = page; | ||
this.text_h1_Administrationsbereich = page.getByTestId('admin-headline'); | ||
this.text_h2_Klassenverwaltung = page.getByTestId('layout-card-headline'); | ||
this.combobox_Filter_Schule = page.getByPlaceholder('Schule'); | ||
this.combobox_Filter_Klasse = page.getByPlaceholder('Klasse'); | ||
this.table_header_Dienststellennummer = page.getByText('Dienststellennummer'); | ||
this.table_header_Klassenname = page.getByTestId('klasse-table').getByText('Klasse'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { LandingPage } from "../pages/LandingView.page"; | ||
import { LoginPage } from "../pages/LoginView.page"; | ||
import { StartPage } from "../pages/StartView.page"; | ||
import { MenuPage } from "../pages/MenuBar.page"; | ||
import { KlasseCreationViewPage } from "../pages/admin/KlasseCreationView.page"; | ||
import { KlasseManagementViewPage } from "../pages/admin/KlasseManagementView.page"; | ||
import { faker } from "@faker-js/faker/locale/de"; | ||
|
||
const PW = process.env.PW; | ||
const ADMIN = process.env.USER; | ||
const FRONTEND_URL = process.env.FRONTEND_URL || ""; | ||
|
||
test.describe(`Testfälle für die Administration von Klassen: Umgebung: ${process.env.UMGEBUNG}: URL: ${process.env.FRONTEND_URL}:`, () => { | ||
test.beforeEach(async ({ page }) => { | ||
await test.step(`Login`, async () => { | ||
const Landing = new LandingPage(page); | ||
const Startseite = new StartPage(page); | ||
const Login = new LoginPage(page); | ||
|
||
await page.goto(FRONTEND_URL); | ||
await Landing.button_Anmelden.click(); | ||
await Login.login(ADMIN, PW); | ||
await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test("Eine Klasse anlegen und die Klasse anschließend in der Ergebnisliste suchen", async ({ page }) => { | ||
const Startseite = new StartPage(page); | ||
const Menue = new MenuPage(page); | ||
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 }}); | ||
|
||
await test.step(`Dialog Schule anlegen öffnen`, async () => { | ||
await Startseite.card_item_schulportal_administration.click(); | ||
await Menue.menueItem_KlasseAnlegen.click(); | ||
await expect(KlasseCreationView.text_h2_KlasseAnlegen).toHaveText("Neue Klasse hinzufügen"); | ||
}); | ||
|
||
await test.step(`Klasse anlegen`, async () => { | ||
await KlasseCreationView.combobox_Schulstrukturknoten.click(); | ||
await page.getByText(SCHULNAME).click(); | ||
await KlasseCreationView.input_Klassenname.fill(KLASSENNAME); | ||
await KlasseCreationView.button_KlasseAnlegen.click(); | ||
await expect(KlasseCreationView.text_success).toBeVisible(); | ||
}); | ||
|
||
await test.step(`In der Ergebnisliste prüfen, dass die neue Klasse angezeigt wird`, async () => { | ||
await Menue.menueItem_AlleKlassenAnzeigen.click(); | ||
await KlasseManagementView.combobox_Filter_Schule.fill(SCHULNAME); | ||
await page.keyboard.press('ArrowDown'); | ||
await page.keyboard.press('Enter'); | ||
await KlasseManagementView.combobox_Filter_Klasse.fill(KLASSENNAME); | ||
await page.keyboard.press('ArrowDown'); | ||
await page.keyboard.press('Enter'); | ||
await expect(KlasseManagementView.text_h2_Klassenverwaltung).toHaveText("Klassenverwaltung"); | ||
await expect(page.getByRole("cell", { name: KLASSENNAME })).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test("Ergebnisliste Klassen auf Vollständigkeit prüfen", async ({ page }) => { | ||
const Startseite = new StartPage(page); | ||
const Menue = new MenuPage(page); | ||
const KlasseManagementView = new KlasseManagementViewPage(page); | ||
|
||
await test.step(`Klassenverwaltung öffnen und Alle Elemente in der Ergebnisliste auf Existenz prüfen`, async () => { | ||
await Startseite.card_item_schulportal_administration.click(); | ||
await Menue.menueItem_AlleKlassenAnzeigen.click(); | ||
await expect(KlasseManagementView.text_h1_Administrationsbereich).toBeVisible(); | ||
await expect(KlasseManagementView.text_h2_Klassenverwaltung).toHaveText("Klassenverwaltung"); | ||
await expect(KlasseManagementView.combobox_Filter_Schule).toBeVisible(); | ||
await expect(KlasseManagementView.combobox_Filter_Klasse).toBeVisible(); | ||
await expect(KlasseManagementView.table_header_Dienststellennummer).toBeVisible(); | ||
await expect(KlasseManagementView.table_header_Klassenname).toBeVisible(); | ||
}); | ||
}); | ||
}); |