blob: 7040681a3945cb7e8481ed08010366ea2cb57cf1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
describe('Clicking the map', function() {
before(function(){
cy.visit('/');
cy.contains('Go');
cy.get('[name=pc]').type(Cypress.env('postcode'));
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('#js-new-report-user-show').click();
cy.get('#js-new-report-show-sign-in').click();
cy.get('#form_username_sign_in').type('user@example.org');
cy.get('[name=password_sign_in]').type('password');
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');
});
});
describe('Clicking the "big green banner" on a map page', function() {
before(function() {
cy.visit('/');
cy.get('[name=pc]').type(Cypress.env('postcode'));
cy.get('[name=pc]').parents('form').submit();
cy.get('.big-green-banner').click();
});
it('begins a new report', function() {
cy.url().should('include', '/report/new');
cy.get('#form_title').should('be.visible');
});
});
|