aboutsummaryrefslogtreecommitdiffstats
path: root/.cypress/cypress/integration/simple_spec.js
diff options
context:
space:
mode:
Diffstat (limited to '.cypress/cypress/integration/simple_spec.js')
-rw-r--r--.cypress/cypress/integration/simple_spec.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/.cypress/cypress/integration/simple_spec.js b/.cypress/cypress/integration/simple_spec.js
index fe0867c76..30f2a0218 100644
--- a/.cypress/cypress/integration/simple_spec.js
+++ b/.cypress/cypress/integration/simple_spec.js
@@ -1,17 +1,22 @@
-describe('My First Test', function() {
- it('Visits the home page', function() {
+describe('Clicking the map', function() {
+ before(function(){
cy.visit('/');
cy.contains('Go');
cy.get('[name=pc]').type('BS10 5EE');
- cy.get('#postcodeForm').submit();
+ cy.get('[name=pc]').parents('form').submit();
+ });
+
+ it('allows me to report a new problem', function() {
cy.url().should('include', '/around');
cy.get('#map_box').click(200, 200);
cy.get('[name=title]').type('Title');
cy.get('[name=detail]').type('Detail');
cy.get('[name=username]').type('user@example.org');
cy.get('[name=password_sign_in]').type('password');
- cy.get('form').submit();
- cy.get('form').submit();
+ cy.get('[name=password_sign_in]').parents('form').submit();
+ cy.get('#map_sidebar').should('contain', 'check and confirm your details');
+ cy.get('#map_sidebar').parents('form').submit();
+ cy.get('body').should('contain', 'Thank you for reporting this issue');
});
});
@@ -19,7 +24,7 @@ describe('Clicking the "big green banner" on a map page', function() {
before(function() {
cy.visit('/');
cy.get('[name=pc]').type('BS10 5EE');
- cy.get('#postcodeForm').submit();
+ cy.get('[name=pc]').parents('form').submit();
cy.get('.big-green-banner').click();
});