Skip to content

Commit

Permalink
debug: normalise base URL to fix trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
adeldhis2 committed Dec 4, 2024
1 parent 2f50370 commit ba2fadf
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions cypress/helpers/startScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,22 @@ const logPageState = () => {
}

export const goToStartPage = (skipEval) => {
cy.visit('', EXTENDED_TIMEOUT).then(() => {
cy.log(`Visiting the base URL: ${Cypress.env('dhis2BaseUrl')}`)
cy.task('log', `Visiting the base URL: ${Cypress.env('dhis2BaseUrl')}`)
console.log(`Visiting the base URL: ${Cypress.env('dhis2BaseUrl')}`)
logPageState()
const processedUrl = Cypress.env('dhis2BaseUrl').replace(/\/$/, '')
cy.log(`dhis2BaseUrl: ${Cypress.env('dhis2BaseUrl')}`)
cy.log(`Visiting URL: ${processedUrl}`)

if (!skipEval) {
expectStartScreenToBeVisible()
}
})
cy.visit(processedUrl, EXTENDED_TIMEOUT)
.then(() => {
cy.log(`Visited URL: ${processedUrl}`)
logPageState()

if (!skipEval) {
expectStartScreenToBeVisible()
}
})
.catch((error) => {
cy.log(`Error visiting URL: ${error.message}`)
})
}

export const expectStartScreenToBeVisible = () => {
Expand Down

0 comments on commit ba2fadf

Please sign in to comment.