diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-05-18 12:44:26 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-05-19 22:23:18 +0100 |
commit | 36bdf3a8c6ce406d23453b9bb840cf94ca57a820 (patch) | |
tree | 595fb4420ade49cb5f6b82f00ed7cb7eb6abaa97 | |
parent | 1b988948aee3f4decff3252669c672149ebb1aef (diff) |
[Borsetshire] Add front end tests.
-rw-r--r-- | .cypress/cypress/integration/borsetshire.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/borsetshire.js b/.cypress/cypress/integration/borsetshire.js new file mode 100644 index 000000000..c2a2710fb --- /dev/null +++ b/.cypress/cypress/integration/borsetshire.js @@ -0,0 +1,21 @@ +it('loads the right front page', function() { + cy.visit('http://borsetshire.localhost:3001/'); + cy.contains('Borsetshire'); +}); + +it('logs in without fuss', function() { + cy.contains('Sign in').click(); + cy.contains('Customer service').click(); + cy.url().should('include', '/reports'); + + cy.visit('http://borsetshire.localhost:3001/auth'); + cy.contains('Inspector').click(); + cy.url().should('include', '/my/planned'); + + cy.visit('http://borsetshire.localhost:3001/auth'); + cy.get('[name=username]').type('super@example.org'); + cy.contains('Sign in with a password').click(); + cy.get('[name=password_sign_in]').type('password'); + cy.get('[name=sign_in_by_password]').last().click(); + cy.url().should('include', '/admin'); +}); |