Skip to content

Commit

Permalink
chore: add login assertion logic to startScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Oct 9, 2023
1 parent fb876d9 commit d63662d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cypress/helpers/startScreen.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
import { EXTENDED_TIMEOUT } from '../support/util.js'

export const goToStartPage = (skipEval) => {
cy.intercept('GET', '**/system/info**', (req) => {
expect(req.url).to.equal('http://localhost:8080/api/system/info')
}).as('systemInfoRequest')

cy.visit('/', EXTENDED_TIMEOUT).log(Cypress.env('dhis2BaseUrl'))

cy.wait('@systemInfoRequest').its('response.statusCode').should('eq', 200)

const cypressEnv = Cypress.env()

expect(cypressEnv.dhis2BaseUrl).to.eq('http://localhost:8080')
expect(cypressEnv.dhis2InstanceVersion).be.oneOf(['2.40.1', '2.38.4.3'])
expect(cypressEnv.dhis2Password).to.eq('district')
expect(cypressEnv.dhis2Username).to.eq('admin')

cy.log(`dhis2BaseUrl: ${cypressEnv.dhis2BaseUrl}`)
cy.log(`dhis2InstanceVersion: ${cypressEnv.dhis2InstanceVersion}`)
cy.log(`dhis2Password: ${cypressEnv.dhis2Password}`)
cy.log(`dhis2Username: ${cypressEnv.dhis2Username}`)

if (!skipEval) {
expectStartScreenToBeVisible()
}
Expand Down

0 comments on commit d63662d

Please sign in to comment.