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?.();