Robustify playwright tests (#12331)

* Robustify playwright tests

* More test tweaks
This commit is contained in:
Oliver
2026-07-08 20:31:34 +10:00
committed by GitHub
parent b63d829891
commit 75f6960782
3 changed files with 8 additions and 5 deletions
+3 -5
View File
@@ -81,14 +81,12 @@ test('Company - Supplier Parts', async ({ browser }) => {
await loadTab(page, 'Supplier Parts'); await loadTab(page, 'Supplier Parts');
await clearTableFilters(page); await clearTableFilters(page);
await page.getByText(/1 \- 25 \/ 7\d\d/).waitFor();
await page.getByText(/1 \- 25 \/ 77\d/).waitFor();
await setTableChoiceFilter(page, 'Primary', 'Yes'); await setTableChoiceFilter(page, 'Primary', 'Yes');
await page.getByText(/1 \- 25 \/ 31\d/).waitFor(); await page.getByText(/1 \- 25 \/ 3\d\d/).waitFor();
await clearTableFilters(page); await clearTableFilters(page);
await setTableChoiceFilter(page, 'Primary', 'No'); await setTableChoiceFilter(page, 'Primary', 'No');
await page.getByText(/1 \- 25 \/ 45\d/).waitFor(); await page.getByText(/1 \- 25 \/ 4\d\d/).waitFor();
}); });
@@ -503,6 +503,7 @@ test('Parts - Details - Upload image modal accepts pasted clipboard image', asyn
await page await page
.getByRole('tabpanel', { name: 'Part Details' }) .getByRole('tabpanel', { name: 'Part Details' })
.locator('img') .locator('img')
.first()
.hover(); .hover();
const uploadButton = page const uploadButton = page
@@ -550,10 +551,13 @@ test('Parts - Details - Upload image modal accepts pasted clipboard image', asyn
await page.getByRole('button', { name: 'Submit' }).click(); await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Image uploaded').waitFor(); await page.getByText('Image uploaded').waitFor();
await page.reload();
// Now remove the associated image // Now remove the associated image
await page await page
.getByRole('tabpanel', { name: 'Part Details' }) .getByRole('tabpanel', { name: 'Part Details' })
.locator('img') .locator('img')
.first()
.hover(); .hover();
await page await page
.getByRole('button', { name: 'action-button-delete-image' }) .getByRole('button', { name: 'action-button-delete-image' })
+1
View File
@@ -98,6 +98,7 @@ test('Login - Change Password', async ({ page }) => {
// Navigate to the 'change password' page // Navigate to the 'change password' page
await navigate(page, 'settings/user/account', { waitUntil: 'networkidle' }); await navigate(page, 'settings/user/account', { waitUntil: 'networkidle' });
await page.waitForTimeout(1000);
await openDetailAction(page, 'account', 'change-password'); await openDetailAction(page, 'account', 'change-password');
// First attempt with some errors // First attempt with some errors