diff --git a/playwright-tests/pages/BasePage.ts b/playwright-tests/pages/BasePage.ts index e538ee34..d2d03356 100644 --- a/playwright-tests/pages/BasePage.ts +++ b/playwright-tests/pages/BasePage.ts @@ -116,12 +116,22 @@ export class BasePage { } async validateURL(issPageValue: string) { + let pass = false; + let currentUrl = this.page.url(); + pass = currentUrl.includes(issPageValue); + const isBailout = currentUrl.includes('bailout-page'); + if(!pass && !isBailout) { + await this.waitForURLToChange(currentUrl); + currentUrl = this.page.url(); + pass = currentUrl.includes(issPageValue); + } + expect(pass).toBeTruthy(); + } + + async waitForURLToChange(startingUrl: string) { await expect(async () => { const currentUrl = this.page.url(); - expect(currentUrl).toContain(issPageValue); - }).toPass({ - intervals: [1_000], - timeout: 15_000 - }); + expect(currentUrl).not.toEqual(startingUrl); + }).toPass({ timeout: 180_000 }); } } \ No newline at end of file