diff --git a/cypress/integration/app.spec.ts b/cypress/integration/app.spec.ts index 3d5ffcda..1a282dd1 100644 --- a/cypress/integration/app.spec.ts +++ b/cypress/integration/app.spec.ts @@ -17,5 +17,12 @@ describe('App', () => { cy.visit('/'); cy.title().should('equal', 'StApps'); - }) + }); + + it('should have a proper working navigation', () => { + cy.visit('/'); + + cy.contains('Settings').click(); + cy.get('ion-title').contains('Einstellungen'); + }); }); diff --git a/cypress/integration/settings.spec.ts b/cypress/integration/settings.spec.ts index 700ebe82..7474678c 100644 --- a/cypress/integration/settings.spec.ts +++ b/cypress/integration/settings.spec.ts @@ -17,5 +17,5 @@ describe('Settings Page', () => { cy.visit('/settings'); cy.get('ion-title').contains('Einstellungen'); - }) + }); }); diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 7dd192e2..950eb177 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -17,6 +17,14 @@ // import './commands'; Cypress.on('window:before:load', window => { // Fake that user is using its browser in german language - Object.defineProperty(window.navigator, 'language', { value: 'de-DE' }); - Object.defineProperty(window.navigator, 'languages', [{ value: 'de-DE' }]); + Object.defineProperty(window.navigator, 'language', {value: 'de-DE'}); + Object.defineProperty(window.navigator, 'languages', [{value: 'de-DE'}]); + + // Fail tests on console error + cy.stub(window.console, 'error').callsFake(message => { + // log out to the terminal + cy.now('task', 'error', message); + // log to Command Log and fail the test + throw new Error(message); + }); });