test: remove redundant employee creation test
All checks were successful
Playwright Tests / test (pull_request) Successful in 1m48s

This commit is contained in:
Jan Gleytenhoover 2025-01-17 14:32:27 +01:00
parent 421740910e
commit d920f8d774
Signed by: jank
GPG key ID: 50620ADD22CD330B

View file

@ -57,36 +57,5 @@ test.describe('mitarbeiter', () => {
await expect(error).toHaveCount(1);
});
test('CreationAndDeletion', async ({ page }) => {
await page.getByLabel('First Name').fill('a');
await page.getByLabel('Last Name').fill('a');
await page.getByLabel('Street').fill('a');
await page.getByLabel('Postcode').fill('12345');
await page.getByLabel('City').fill('a');
await page.getByLabel('Phone Number').fill('1234');
await page.getByText('Save').click();
expect(page.url().includes('erstellen')).toBeFalsy();
// Wait for all "Delete" buttons to be attached to the DOM
// await page.locator('text=Delete').waitFor({ state: 'attached', timeout: 10000 });
// Ensure there are at least 3 "Delete" buttons
const deleteButtons = page.locator('text=Delete');
const deleteButtonCount = await deleteButtons.count();
if (deleteButtonCount >= 3) {
// Wait for the third "Delete" button to be visible
const deleteButton = deleteButtons.nth(2);
await deleteButton.waitFor({ state: 'visible', timeout: 5000 });
await deleteButton.click();
} else {
throw new Error('Less than 3 "Delete" buttons found.');
}
const deletedEmployee = page.getByText('12345');
await expect(deletedEmployee).toHaveCount(0, { timeout: 10000 });
});
});