diff --git a/frontend/cypress/integration/0_setup_spec.js b/frontend/cypress/integration/0_setup_spec.js index ef5a2931..4a0afd91 100644 --- a/frontend/cypress/integration/0_setup_spec.js +++ b/frontend/cypress/integration/0_setup_spec.js @@ -27,8 +27,25 @@ context('Setup Process', () => { it('should be completely setup', () => { cy.request(`/api`).then((response) => { - expect(response.body).to.have.property('setup', true) - expect(response.body).to.have.property('domain', 'http://localhost:8888') + expect(response.body).to.have.property('setup', true) + expect(response.body).to.have.property('domain', 'http://localhost:8888') + }) + }) + + 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) }) }) diff --git a/frontend/package.json b/frontend/package.json index a68e85d8..f331948c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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",