test: Add timeouts for safety in employee tests
Some checks failed
Playwright Tests / test (pull_request) Failing after 2m16s
Some checks failed
Playwright Tests / test (pull_request) Failing after 2m16s
This commit is contained in:
parent
b61e00e647
commit
e91dc49804
1 changed files with 3 additions and 6 deletions
|
@ -59,26 +59,23 @@ test.describe('mitarbeiter', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('CreationAndDeletion', async ({ page }) => {
|
test('CreationAndDeletion', async ({ page }) => {
|
||||||
await page.getByLabel('First Name').fill('a');
|
|
||||||
await page.getByLabel('Last Name').fill('a');
|
await page.getByLabel('Last Name').fill('a');
|
||||||
await page.getByLabel('Street').fill('a');
|
await page.getByLabel('Street').fill('a');
|
||||||
await page.getByLabel('Postcode').fill('12345');
|
await page.getByLabel('Postcode').fill('12345');
|
||||||
await page.getByLabel('City').fill('a');
|
await page.getByLabel('City').fill('a');
|
||||||
await page.getByLabel('Phone Number').fill('1234');
|
await page.getByLabel('Phone Number').fill('1234');
|
||||||
|
|
||||||
await page.getByText("Save").click();
|
await page.getByText('Save').click();
|
||||||
|
|
||||||
expect(page.url().includes('erstellen')).toBeFalsy();
|
expect(page.url().includes('erstellen')).toBeFalsy();
|
||||||
|
|
||||||
|
|
||||||
const deleteButton = page.getByText('Delete').nth(2);
|
const deleteButton = page.getByText('Delete').nth(2);
|
||||||
|
await deleteButton.waitFor({ state: 'visible', timeout: 5000 }); // Add a timeout for safety
|
||||||
await deleteButton.waitFor({state: 'visible'});
|
|
||||||
|
|
||||||
await deleteButton.click();
|
await deleteButton.click();
|
||||||
|
|
||||||
const deletedEmployee = page.getByText('12345');
|
const deletedEmployee = page.getByText('12345');
|
||||||
await expect(deletedEmployee).toHaveCount(0);
|
await expect(deletedEmployee).toHaveCount(0, { timeout: 5000 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue