From 55ad9a5e4be6d957874ed2e0a744e42c67d3c8e6 Mon Sep 17 00:00:00 2001 From: croor005 Date: Mon, 10 Aug 2020 09:41:41 -0700 Subject: [PATCH 1/2] Moving tests into a single file --- .github/workflows/End_To_End_Tests.yml | 2 +- .../{map_filter.spec.js => e2e_tests.spec.js} | 38 +++++++++++++++++ e2e/cypress/integration/email.spec.js | 42 ------------------- 3 files changed, 39 insertions(+), 43 deletions(-) rename e2e/cypress/integration/{map_filter.spec.js => e2e_tests.spec.js} (79%) delete mode 100644 e2e/cypress/integration/email.spec.js diff --git a/.github/workflows/End_To_End_Tests.yml b/.github/workflows/End_To_End_Tests.yml index ffb6550a9..0d3813fb7 100644 --- a/.github/workflows/End_To_End_Tests.yml +++ b/.github/workflows/End_To_End_Tests.yml @@ -12,7 +12,7 @@ jobs: with: #build: npm run build #start: npm start - spec: cypress/integration/map_filter.spec.js,cypress/integration/email.spec.js + spec: cypress/integration/e2e_tests.spec.js wait-on: http://dev.311-data.org/ record: true working-directory: e2e diff --git a/e2e/cypress/integration/map_filter.spec.js b/e2e/cypress/integration/e2e_tests.spec.js similarity index 79% rename from e2e/cypress/integration/map_filter.spec.js rename to e2e/cypress/integration/e2e_tests.spec.js index 6bff719c2..781af8c6c 100644 --- a/e2e/cypress/integration/map_filter.spec.js +++ b/e2e/cypress/integration/e2e_tests.spec.js @@ -102,4 +102,42 @@ describe('311 Data', () => { }) }) + const serverId = ''; + + const testEmail = `fake\@email.com` + + context('Contct Us', () => { + it('Contact Us: Sending Email', () => { + + cy.server() + cy.route({ + method:'POST', + url: Cypress.env('devApiUrl') +'/feedback', + response: [{"success": true}], + onResponse(xhr) { + expect(xhr.status).to.eq(200); + } + }).as('feedbackJSON') + + cy.visit('/') + cy.get('.navbar-end > :nth-child(4)').click() + cy.get('#contact-firstname').type('Test') + cy.get('#contact-lastname').type('User') + cy.get('#contact-email').type(testEmail) + cy.get('#contact-message').type('email test') + cy.get('#btn-contact-submit').click() + cy.wait('@feedbackJSON') + + cy.get('.contact-success-popup').should('exist') + }) + + it.skip('Contact Us: Checking email', () => { + cy.mailosaurGetMessage(serverId, { + sentTo: testEmail + }).then(email => { + expect(email.subject).to.equal('Thanks for your feedback'); + }) + }) + }) + }) diff --git a/e2e/cypress/integration/email.spec.js b/e2e/cypress/integration/email.spec.js deleted file mode 100644 index 726a66ad7..000000000 --- a/e2e/cypress/integration/email.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -describe('311 Data', () => { - - const serverId = ''; - - const testEmail = `fake\@email.com` - - context('Contct Us', () => { - it('Contact Us: Sending Email', () => { - - cy.server() - cy.route({ - method:'POST', - url: Cypress.env('devApiUrl') +'/feedback', - response: [{"success": true}], - onResponse(xhr) { - expect(xhr.status).to.eq(200); - } - }).as('feedbackJSON') - - cy.visit('/') - cy.get('.navbar-end > :nth-child(4)').click() - cy.get('#contact-firstname').type('Test') - cy.get('#contact-lastname').type('User') - cy.get('#contact-email').type(testEmail) - cy.get('#contact-message').type('email test') - cy.get('#btn-contact-submit').click() - cy.wait('@feedbackJSON') - - cy.get('.contact-success-popup').should('exist') - }) - - it.skip('Contact Us: Checking email', () => { - cy.mailosaurGetMessage(serverId, { - sentTo: testEmail - }).then(email => { - expect(email.subject).to.equal('Thanks for your feedback'); - }) - }) - }) - - -}) From 1f13c39cf61acdd2812633ec36d4a35c8da73f23 Mon Sep 17 00:00:00 2001 From: croor005 Date: Mon, 10 Aug 2020 09:42:57 -0700 Subject: [PATCH 2/2] typo! --- e2e/cypress/integration/e2e_tests.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/cypress/integration/e2e_tests.spec.js b/e2e/cypress/integration/e2e_tests.spec.js index 781af8c6c..2d055cc32 100644 --- a/e2e/cypress/integration/e2e_tests.spec.js +++ b/e2e/cypress/integration/e2e_tests.spec.js @@ -106,7 +106,7 @@ describe('311 Data', () => { const testEmail = `fake\@email.com` - context('Contct Us', () => { + context('Contact Us', () => { it('Contact Us: Sending Email', () => { cy.server()