From 90b1b4c59552d83ae47ca51032d6e640a312dea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Wed, 8 Nov 2017 17:39:39 +0100 Subject: [PATCH] test(e2e): adjust tests and make them fail on CI --- test/e2e/run-e2e-test.js | 6 +++++- test/e2e/specs/the-example-app-spec.js | 13 +++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/e2e/run-e2e-test.js b/test/e2e/run-e2e-test.js index c2e35b0..6873122 100644 --- a/test/e2e/run-e2e-test.js +++ b/test/e2e/run-e2e-test.js @@ -23,8 +23,12 @@ server.listen(TEST_PORT, function () { CONTENTFUL_SPACE_ID, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN } }) - .then(() => { + .then((result) => { server.close() + if (result.failures > 0) { + process.exit(1) + return + } process.exit(0) }).catch(() => { server.close() diff --git a/test/e2e/specs/the-example-app-spec.js b/test/e2e/specs/the-example-app-spec.js index 47f5533..2487a57 100644 --- a/test/e2e/specs/the-example-app-spec.js +++ b/test/e2e/specs/the-example-app-spec.js @@ -32,18 +32,19 @@ describe('The Example App', () => { it('global elements', () => { cy.get('.header__upper') - .should('contain', 'What is this example app?') - .should('contain', 'View on Github') + .should('contain', 'Help') + .should('contain', 'GitHub') cy.get('.main__footer .footer__lower') .should('contain', 'Powered by Contentful') - .should('contain', 'View on Github') + .should('contain', 'GitHub') .should('contain', 'Imprint') + .should('contain', 'Contact us') }) it('about modal', () => { cy.get('section.modal .modal__wrapper').should('hidden') - cy.get('.header__upper .header__title').click() + cy.get('.header__upper-title a').click() cy.get('section.modal .modal__wrapper').should('visible') cy.get('section.modal .modal__title').should('contain', 'A referenceable example for developers using Contentful') cy.get('section.modal .modal__content').should('contain', 'This is The Example App, an application built to serve you as a reference while building your own applications using Contentful.') @@ -51,13 +52,13 @@ describe('The Example App', () => { // Close on background cy.get('section.modal .modal__overlay').click({force: true}) cy.get('section.modal .modal__wrapper').should('hidden') - cy.get('.header__upper .header__title').click() + cy.get('.header__upper-title a').click() cy.get('section.modal .modal__wrapper').should('visible') // Close on X cy.get('section.modal .modal__close-button').click() cy.get('section.modal .modal__wrapper').should('hidden') - cy.get('.header__upper .header__title').click() + cy.get('.header__upper-title a').click() cy.get('section.modal .modal__wrapper').should('visible') // Close on "Got this" button