test: add initial tests for qualifications management
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m3s
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m3s
This commit is contained in:
parent
56a2ef77fa
commit
3882cde8ca
1 changed files with 58 additions and 0 deletions
58
tests/qualifikationsverwaltung.spec.ts
Normal file
58
tests/qualifikationsverwaltung.spec.ts
Normal file
|
@ -0,0 +1,58 @@
|
|||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe('qualifikationen', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('http://localhost:4200');
|
||||
|
||||
await page.getByRole('button').click();
|
||||
await page.waitForFunction(() => window.location.href.includes('keycloak'));
|
||||
await page.getByLabel('Username or email').fill('user');
|
||||
await page.getByLabel('Password').fill('test');
|
||||
await page.click('#kc-login');
|
||||
|
||||
await page.goto('http://localhost:4200/qualifikationsverwaltung');
|
||||
});
|
||||
|
||||
test('ShouldLoad', async ({ page }) => {
|
||||
await expect(page.getByRole('heading')).toHaveText("Qualifications");
|
||||
});
|
||||
|
||||
test('ShouldLoadQualifications', async ({ page }) => {
|
||||
expect(page.getByText('Java')).toBeTruthy();
|
||||
});
|
||||
|
||||
// TODO
|
||||
// test('AddQualificationShouldRedirect', async ({ page }) => {
|
||||
// await page.getByText('Add qualification').click();
|
||||
|
||||
// expect(page.url()).toContain('mitarbeitererstellen');
|
||||
// });
|
||||
|
||||
test('EditShouldRedirectToCorrespondingPage', async ({ page }) => {
|
||||
const button = page.getByText('Edit').first();
|
||||
await button.click();
|
||||
|
||||
expect(page.url()).toContain('qualifikationbearbeiten');
|
||||
expect(page.url()).toContain('1');
|
||||
});
|
||||
|
||||
test('DeleteShouldBeThere', async ({ page }) => {
|
||||
const button = page.getByText('Delete').first();
|
||||
|
||||
const users = page.getByText('Delete');
|
||||
await users.first().waitFor({ state: "visible" });
|
||||
expect(await users.count()).toBe(2);
|
||||
expect(button).toBeTruthy();
|
||||
});
|
||||
|
||||
test('SearchShouldWork', async ({ page }) => {
|
||||
const searchField = page.getByRole('textbox');
|
||||
const searchButton = page.getByText('Search').first();
|
||||
|
||||
await searchField.fill('Java');
|
||||
await searchButton.click();
|
||||
|
||||
const hiddenItem = page.getByText('Angular');
|
||||
await expect(hiddenItem).toHaveCount(0);
|
||||
});
|
||||
});
|
Loading…
Add table
Reference in a new issue