test(e2e): adjust tests and make them fail on CI

This commit is contained in:
Benedikt Rötsch
2017-11-08 17:39:39 +01:00
committed by Benedikt Rötsch
parent 13a49aa2ad
commit 767a1e8a46
2 changed files with 12 additions and 7 deletions

View File

@@ -23,8 +23,12 @@ server.listen(TEST_PORT, function () {
CONTENTFUL_SPACE_ID, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN CONTENTFUL_SPACE_ID, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN
} }
}) })
.then(() => { .then((result) => {
server.close() server.close()
if (result.failures > 0) {
process.exit(1)
return
}
process.exit(0) process.exit(0)
}).catch(() => { }).catch(() => {
server.close() server.close()

View File

@@ -32,18 +32,19 @@ describe('The Example App', () => {
it('global elements', () => { it('global elements', () => {
cy.get('.header__upper') cy.get('.header__upper')
.should('contain', 'What is this example app?') .should('contain', 'Help')
.should('contain', 'View on Github') .should('contain', 'GitHub')
cy.get('.main__footer .footer__lower') cy.get('.main__footer .footer__lower')
.should('contain', 'Powered by Contentful') .should('contain', 'Powered by Contentful')
.should('contain', 'View on Github') .should('contain', 'GitHub')
.should('contain', 'Imprint') .should('contain', 'Imprint')
.should('contain', 'Contact us')
}) })
it('about modal', () => { it('about modal', () => {
cy.get('section.modal .modal__wrapper').should('hidden') 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__wrapper').should('visible')
cy.get('section.modal .modal__title').should('contain', 'A referenceable example for developers using Contentful') 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.') 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 // Close on background
cy.get('section.modal .modal__overlay').click({force: true}) cy.get('section.modal .modal__overlay').click({force: true})
cy.get('section.modal .modal__wrapper').should('hidden') 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__wrapper').should('visible')
// Close on X // Close on X
cy.get('section.modal .modal__close-button').click() cy.get('section.modal .modal__close-button').click()
cy.get('section.modal .modal__wrapper').should('hidden') 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__wrapper').should('visible')
// Close on "Got this" button // Close on "Got this" button