fix UI test
This commit is contained in:
@@ -44,12 +44,12 @@ test('New offers for another user', async ({ page }) => {
|
|||||||
// Wait for export data prompt alert to be ready before clicking
|
// Wait for export data prompt alert to be ready before clicking
|
||||||
await page.waitForFunction(() => {
|
await page.waitForFunction(() => {
|
||||||
const buttons = document.querySelectorAll('div[role="alert"] button');
|
const buttons = document.querySelectorAll('div[role="alert"] button');
|
||||||
return Array.from(buttons).some(button => button.textContent?.includes('No, Not Now'));
|
return Array.from(buttons).some(button => button.textContent?.includes('No, Not Yet'));
|
||||||
}, { timeout: 5000 });
|
}, { timeout: 5000 });
|
||||||
// Use a more robust approach to click the button
|
// Use a more robust approach to click the button
|
||||||
await page.waitForFunction(() => {
|
await page.waitForFunction(() => {
|
||||||
const buttons = document.querySelectorAll('div[role="alert"] button');
|
const buttons = document.querySelectorAll('div[role="alert"] button');
|
||||||
const noButton = Array.from(buttons).find(button => button.textContent?.includes('No, Not Now'));
|
const noButton = Array.from(buttons).find(button => button.textContent?.includes('No, Not Yet'));
|
||||||
if (noButton) {
|
if (noButton) {
|
||||||
(noButton as HTMLElement).click();
|
(noButton as HTMLElement).click();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user