From f31beaa9041bc9f49b835b94b3618332f9e84078 Mon Sep 17 00:00:00 2001 From: uid11 Date: Wed, 23 Oct 2024 16:37:10 +0300 Subject: [PATCH] FI-1432 feat: support waitings before retries --- src/Page.ts | 3 ++- src/actions/pages/assertPage.ts | 2 +- src/actions/pages/navigateToPage.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Page.ts b/src/Page.ts index 9c072029..3c60f64a 100644 --- a/src/Page.ts +++ b/src/Page.ts @@ -80,8 +80,9 @@ export abstract class Page { * Asserts that we are on the expected page by `isMatch` flage. * `isMatch` equals `true`, if url matches the page with given parameters, and `false` otherwise. */ - assertPage(isMatch: boolean): AsyncVoid { + assertPage(isMatch: boolean, documentUrl: Url): AsyncVoid { assertValueIsTrue(isMatch, `the document url matches the page "${this.constructor.name}"`, { + documentUrl, page: this, }); } diff --git a/src/actions/pages/assertPage.ts b/src/actions/pages/assertPage.ts index db9903b8..9e1999c6 100644 --- a/src/actions/pages/assertPage.ts +++ b/src/actions/pages/assertPage.ts @@ -34,7 +34,7 @@ export const assertPage = async ( LogEventType.InternalAction, ); - await page.assertPage(isMatch); + await page.assertPage(isMatch, documentUrl); await page.afterAssertPage?.(); diff --git a/src/actions/pages/navigateToPage.ts b/src/actions/pages/navigateToPage.ts index 02f02b7c..06aa1159 100644 --- a/src/actions/pages/navigateToPage.ts +++ b/src/actions/pages/navigateToPage.ts @@ -46,7 +46,7 @@ export const navigateToPage = async ( const documentUrl = await getDocumentUrl(); const isMatch = route.isMatchUrl(documentUrl); - await page.assertPage(isMatch); + await page.assertPage(isMatch, documentUrl); await page.afterAssertPage?.();