From ca146b7761b98e4f3d7c876b6987dce2f3887e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 28 Aug 2023 13:48:34 +0200 Subject: [PATCH] refactor: separate dashboard schedule nav e2e tests --- frontend/app/PITFALLS.md | 14 ++++++++++++++ frontend/app/cypress/integration/dashboard.spec.ts | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/app/PITFALLS.md b/frontend/app/PITFALLS.md index 587d5101..c2cac8e3 100644 --- a/frontend/app/PITFALLS.md +++ b/frontend/app/PITFALLS.md @@ -42,3 +42,17 @@ The command `ionic cordova run ios` runs into the error `/platforms/ios/build/em - Either use the command: `ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"` - Or open the iOS project in Xcode and change build system in workspace settings to `Lagacy Build System`. Then the normal run command works also. + +## Cypress + +#### Problem + +The browser doesn't open or the tests don't connect to a browser + +#### Solution + +Delete the Cypress config file + +```shell +rm -rf ~/.config/Cypress +``` diff --git a/frontend/app/cypress/integration/dashboard.spec.ts b/frontend/app/cypress/integration/dashboard.spec.ts index 0506e27c..1a34638a 100644 --- a/frontend/app/cypress/integration/dashboard.spec.ts +++ b/frontend/app/cypress/integration/dashboard.spec.ts @@ -18,13 +18,15 @@ describe('dashboard', async function () { describe('schedule section', function () { - it('should lead to the schedule', function () { + it('should lead to the week overview', function () { cy.visit('/overview'); cy.get('.schedule') .contains('a', /Wochen.*übersicht/) .click(); cy.url().should('include', '/schedule/week-overview'); + }); + it('should lead to the calendar', function () { cy.visit('/overview'); cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click(); cy.url().should('include', '/schedule/calendar');