whats going on cypress

pull/490/head
hunterlong 2020-04-11 16:56:17 -07:00
parent 6b1e545339
commit e1d0d08de8
2 changed files with 21 additions and 4 deletions

View File

@ -32,4 +32,21 @@ context('Setup Process', () => {
})
})
it('should be able to Login', () => {
cy.visit('/login')
cy.get('#username').clear().type('admin')
cy.get('#password').clear().type('admin')
cy.get('button[type="submit"]').click()
cy.get('.navbar-brand').should('contain', 'Statping')
cy.getCookies()
cy.getCookies().should('have.length', 1)
cy.request(`/api`).then((response) => {
expect(response.body).to.have.property('admin', true)
expect(response.body).to.have.property('logged_in', true)
})
})
})

View File

@ -10,8 +10,8 @@
"backend-test": "newman run -e ../dev/postman_environment.json --delay-request 500 ../dev/postman.json",
"cypress:open": "cypress open",
"cypress:test": "cypress run --browser chrome --record --key $CYPRESS_KEY",
"test": "start-server-and-test start http://localhost:8888/api cypress:test",
"start": "statping -port 8888 > /dev/null 2>&1"
"test": "start-server-and-test start http://localhost:8080/api cypress:test",
"start": "statping -port 8080 > /dev/null 2>&1"
},
"dependencies": {
"@fortawesome/fontawesome-free-solid": "^5.1.0-3",