From 16cf8878a1ea028115cdcb8936de4819cbb222af Mon Sep 17 00:00:00 2001 From: Ellie Re'em Date: Tue, 27 Aug 2024 16:27:44 +0100 Subject: [PATCH] fix: checkUrl should check pathname not full url --- cypress/support/commands.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 708e7a869..e53517cd1 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -209,8 +209,10 @@ Cypress.Commands.add('checkLink', (href, text) => { Cypress.Commands.add('checkPageUrl', (url, locale = 'en') => { const localePart = locale === 'en' ? '' : `${locale}/`; - const pageUrl = `${Cypress.config('baseUrl')}/${localePart}${url}`; - cy.url().should('be.equal', pageUrl); + const pageUrl = `/${localePart}${url}`; + cy.location().should((loc) => { + expect(loc.pathname).to.eq(pageUrl); + }); }); // CUSTOM COMMANDS THAT NEED FIREBASE ACCESS