diff --git a/frontend/cypress/e2e/checkIn.cy.ts b/frontend/cypress/e2e/checkIn.cy.ts index 6024396ae2..2ee6eddf52 100644 --- a/frontend/cypress/e2e/checkIn.cy.ts +++ b/frontend/cypress/e2e/checkIn.cy.ts @@ -1,6 +1,6 @@ import * as users from '../fixtures/users.json'; import { onlyOn } from '@cypress/skip-test'; -import { uniqueSuffix } from '../support/utils'; +import { uniqueSuffix } from '../support/helper/utils'; import Chainable = Cypress.Chainable; describe('OKR Check-in e2e tests', () => { diff --git a/frontend/cypress/e2e/duplicated-scoring.cy.ts b/frontend/cypress/e2e/duplicated-scoring.cy.ts index 0d7382e78a..96087d3fb6 100644 --- a/frontend/cypress/e2e/duplicated-scoring.cy.ts +++ b/frontend/cypress/e2e/duplicated-scoring.cy.ts @@ -1,6 +1,6 @@ import * as users from '../fixtures/users.json'; import { onlyOn } from '@cypress/skip-test'; -import { filterByObjectiveName, getObjectiveColumns, selectFromThreeDotMenu } from '../support/objective-helper'; +import { filterByObjectiveName, getObjectiveColumns, selectFromThreeDotMenu } from '../support/helper/objective-helper'; describe('e2e test for scoring adjustment on objective duplicate', () => { beforeEach(() => { diff --git a/frontend/cypress/e2e/objective-backlog.cy.ts b/frontend/cypress/e2e/objective-backlog.cy.ts index 4035545209..897c8bf759 100644 --- a/frontend/cypress/e2e/objective-backlog.cy.ts +++ b/frontend/cypress/e2e/objective-backlog.cy.ts @@ -1,6 +1,6 @@ import * as users from '../fixtures/users.json'; -import CyOverviewPage from '../support/OverviewPage'; -import CyObjectiveFormPage from '../support/objectiveFormPage'; +import CyOverviewPage from '../support/helper/pom-helper/pages/overviewPage'; +import ObjectiveDialog from '../support/helper/pom-helper/dialogs/objectiveDialog'; describe('OKR Objective Backlog e2e tests', () => { let op = new CyOverviewPage(); @@ -31,7 +31,7 @@ describe('OKR Objective Backlog e2e tests', () => { op.getObjectiveByNameAndState('Move to another quarter on edit', 'draft').findByTestId('three-dot-menu').click(); op.selectFromThreeDotMenu('Objective bearbeiten'); - CyObjectiveFormPage.with().fillObjectiveTitle('This goes now to backlog').selectQuarter('Backlog').submit(); + ObjectiveDialog.with().fillObjectiveTitle('This goes now to backlog').selectQuarter('Backlog').submit(); cy.contains('This goes now to backlog').should('not.exist'); @@ -79,7 +79,7 @@ describe('OKR Objective Backlog e2e tests', () => { op.getObjectiveByNameAndState('This is possible for edit', 'draft').findByTestId('three-dot-menu').click(); op.selectFromThreeDotMenu('Objective bearbeiten'); - CyObjectiveFormPage.with().fillObjectiveTitle('My new title').submit(); + ObjectiveDialog.with().fillObjectiveTitle('My new title').submit(); op.getObjectiveByNameAndState('My new title', 'draft'); }); @@ -91,7 +91,7 @@ describe('OKR Objective Backlog e2e tests', () => { op.getObjectiveByNameAndState('This goes to other quarter later', 'draft').findByTestId('three-dot-menu').click(); op.selectFromThreeDotMenu('Objective bearbeiten'); - CyObjectiveFormPage.with().selectQuarter('GJ ForTests').submit(); + ObjectiveDialog.with().selectQuarter('GJ ForTests').submit(); op.visitGJForTests(); op.getObjectiveByNameAndState('This goes to other quarter later', 'draft'); @@ -104,7 +104,7 @@ describe('OKR Objective Backlog e2e tests', () => { op.getObjectiveByNameAndState('Ready for duplicate in backlog', 'draft').findByTestId('three-dot-menu').click(); op.selectFromThreeDotMenu('Objective duplizieren'); - CyObjectiveFormPage.with().fillObjectiveTitle('This is a new duplication in backlog').submit(); + ObjectiveDialog.with().fillObjectiveTitle('This is a new duplication in backlog').submit(); op.getObjectiveByNameAndState('Ready for duplicate in backlog', 'draft'); op.getObjectiveByNameAndState('This is a new duplication in backlog', 'draft'); @@ -118,7 +118,7 @@ describe('OKR Objective Backlog e2e tests', () => { .click(); op.selectFromThreeDotMenu('Objective duplizieren'); - CyObjectiveFormPage.with().fillObjectiveTitle('New duplication from backlog').selectQuarter('GJ ForTests').submit(); + ObjectiveDialog.with().fillObjectiveTitle('New duplication from backlog').selectQuarter('GJ ForTests').submit(); op.getObjectiveByNameAndState('Ready for duplicate to another quarter', 'draft').should('exist'); cy.contains('New duplication from backlog').should('not.exist'); @@ -134,7 +134,7 @@ describe('OKR Objective Backlog e2e tests', () => { .click(); op.selectFromThreeDotMenu('Objective duplizieren'); - CyObjectiveFormPage.with().selectQuarter('Backlog').submit(); + ObjectiveDialog.with().selectQuarter('Backlog').submit(); op.visitBacklogQuarter(); cy.contains('Possible to duplicate into backlog'); diff --git a/frontend/cypress/e2e/objective.cy.ts b/frontend/cypress/e2e/objective.cy.ts index 5fa3120b5b..27d7edc659 100644 --- a/frontend/cypress/e2e/objective.cy.ts +++ b/frontend/cypress/e2e/objective.cy.ts @@ -1,8 +1,8 @@ import * as users from '../fixtures/users.json'; import { onlyOn } from '@cypress/skip-test'; -import CyOverviewPage from '../support/OverviewPage'; -import CyObjectiveFormPage from '../support/objectiveFormPage'; -import CyConfirmComponentPage from '../support/confirmComponentPage'; +import CyOverviewPage from '../support/helper/pom-helper/pages/overviewPage'; +import ObjectiveDialog from '../support/helper/pom-helper/dialogs/objectiveDialog'; +import ConfirmDialog from '../support/helper/pom-helper/dialogs/confirmDialog'; describe('OKR Objective e2e tests', () => { let op = new CyOverviewPage(); @@ -19,7 +19,7 @@ describe('OKR Objective e2e tests', () => { op.getObjectiveByNameAndState('A objective in state draft', 'draft').findByTestId('three-dot-menu').click(); op.selectFromThreeDotMenu('Objective veröffentlichen'); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Objective veröffentlichen') .checkDescription('Soll dieses Objective veröffentlicht werden?') .submit(); @@ -88,7 +88,7 @@ describe('OKR Objective e2e tests', () => { op.selectFromThreeDotMenu('Objective wiedereröffnen'); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Objective wiedereröffnen') .checkDescription('Soll dieses Objective wiedereröffnet werden?') .submit(); @@ -105,7 +105,7 @@ describe('OKR Objective e2e tests', () => { .click(); op.selectFromThreeDotMenu('Objective als Draft speichern'); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Objective als Draft speichern') .checkDescription('Soll dieses Objective als Draft gespeichert werden?') .submit(); @@ -164,7 +164,7 @@ describe('OKR Objective e2e tests', () => { .click(); op.selectFromThreeDotMenu('Objective bearbeiten'); - CyObjectiveFormPage.with().selectQuarter('3').submit(); + ObjectiveDialog.with().selectQuarter('3').submit(); cy.contains('Move to another quarter on edit').should('not.exist'); diff --git a/frontend/cypress/e2e/scoring.cy.ts b/frontend/cypress/e2e/scoring.cy.ts index 1a22f91596..4a6b32f941 100644 --- a/frontend/cypress/e2e/scoring.cy.ts +++ b/frontend/cypress/e2e/scoring.cy.ts @@ -1,5 +1,5 @@ import * as users from '../fixtures/users.json'; -import { getPercentageMetric, getPercentageOrdinal } from 'cypress/support/scoringSupport'; +import { getPercentageMetric, getPercentageOrdinal } from 'cypress/support/helper/scoringSupport'; import { onlyOn } from '@cypress/skip-test'; describe('Scoring component e2e tests', () => { diff --git a/frontend/cypress/e2e/teammanagement.cy.ts b/frontend/cypress/e2e/teammanagement.cy.ts index df9051614e..a3c079b723 100644 --- a/frontend/cypress/e2e/teammanagement.cy.ts +++ b/frontend/cypress/e2e/teammanagement.cy.ts @@ -1,6 +1,6 @@ import * as users from '../fixtures/users.json'; -import { uniqueSuffix } from '../support/utils'; -import CyConfirmComponentPage from '../support/confirmComponentPage'; +import { uniqueSuffix } from '../support/helper/utils'; +import ConfirmDialog from '../support/helper/pom-helper/dialogs/confirmDialog'; describe('Team management tests', () => { const teamName = uniqueSuffix('New Team'); @@ -79,7 +79,7 @@ describe('Team management tests', () => { cy.getByTestId('remove-from-member-list').click(); // dialog - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Mitglied entfernen') .checkDescription(`Möchtest du Jaya Norris wirklich aus dem Team '${teamName}' entfernen?`) .submit(); @@ -97,7 +97,7 @@ describe('Team management tests', () => { cy.getByTestId('remove-from-member-list').click(); // cancel dialog - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Mitglied entfernen') .checkDescription(`Möchtest du Jaya Norris wirklich aus dem Team '${teamName}' entfernen?`) .cancel(); @@ -136,7 +136,7 @@ describe('Team management tests', () => { // cancel dialog => cancel - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Team löschen') .checkDescription( `Möchtest du das Team '${teamName}' wirklich löschen? Zugehörige Objectives werden dadurch in allen Quartalen ebenfalls gelöscht!`, @@ -147,7 +147,7 @@ describe('Team management tests', () => { cy.getByTestId('teamMoreButton').click(); cy.getByTestId('teamDeleteButton').click(); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Team löschen') .checkDescription( `Möchtest du das Team '${teamName}' wirklich löschen? Zugehörige Objectives werden dadurch in allen Quartalen ebenfalls gelöscht!`, @@ -412,7 +412,7 @@ describe('Team management tests', () => { navigateToUser('Findus Peterson'); cy.getByTestId('delete-team-member').click(); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Mitglied entfernen') .checkDescription(`Möchtest du Findus Peterson wirklich aus dem Team '/BBT' entfernen?`) .submit(); @@ -426,7 +426,7 @@ describe('Team management tests', () => { navigateToUser(nameEsha); cy.getByTestId('delete-team-member').eq(0).click(); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Mitglied entfernen') .checkDescription(`Möchtest du ${nameEsha} wirklich aus dem Team '/BBT' entfernen?`) .submit(); @@ -435,7 +435,7 @@ describe('Team management tests', () => { cy.getByTestId('delete-team-member').eq(0).click(); - CyConfirmComponentPage.with() + ConfirmDialog.with() .checkTitle('Mitglied entfernen') .checkDescription(`Möchtest du ${nameEsha} wirklich aus dem Team 'LoremIpsum' entfernen?`) .submit(); diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index b5da823c1b..2324fa3850 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -1,6 +1,6 @@ -import { validateScoring } from './scoringSupport'; +import { validateScoring } from './helper/scoringSupport'; import { keyCodeDefinitions } from 'cypress-real-events/keyCodeDefinitions'; -import { pressUntilContains, doUntilSelector } from './utils'; +import { pressUntilContains, doUntilSelector } from './helper/utils'; Cypress.Commands.add('loginAsUser', (user: any) => { cy.viewport(1920, 1080); diff --git a/frontend/cypress/support/objective-helper.ts b/frontend/cypress/support/helper/objective-helper.ts similarity index 100% rename from frontend/cypress/support/objective-helper.ts rename to frontend/cypress/support/helper/objective-helper.ts diff --git a/frontend/cypress/support/confirmComponentPage.ts b/frontend/cypress/support/helper/pom-helper/dialogs/confirmDialog.ts similarity index 80% rename from frontend/cypress/support/confirmComponentPage.ts rename to frontend/cypress/support/helper/pom-helper/dialogs/confirmDialog.ts index 96ee268702..e06b8209f5 100644 --- a/frontend/cypress/support/confirmComponentPage.ts +++ b/frontend/cypress/support/helper/pom-helper/dialogs/confirmDialog.ts @@ -1,6 +1,6 @@ -import BaseFormPage from './baseFormPage'; +import Dialog from './dialog'; -export default class CyConfirmComponentPage extends BaseFormPage { +export default class ConfirmDialog extends Dialog { checkTitle(title: string) { this.getPage().contains(title).should('exist'); return this; diff --git a/frontend/cypress/support/baseFormPage.ts b/frontend/cypress/support/helper/pom-helper/dialogs/dialog.ts similarity index 77% rename from frontend/cypress/support/baseFormPage.ts rename to frontend/cypress/support/helper/pom-helper/dialogs/dialog.ts index 197bab42a8..88772a2a0c 100644 --- a/frontend/cypress/support/baseFormPage.ts +++ b/frontend/cypress/support/helper/pom-helper/dialogs/dialog.ts @@ -1,6 +1,4 @@ -import { E } from '@angular/cdk/keycodes'; - -export default abstract class BaseFormPage { +export default abstract class Dialog { constructor() { this.init(); } @@ -32,7 +30,7 @@ export default abstract class BaseFormPage { abstract getPage(): Cypress.Chainable>; - static with(this: new () => T): T { + static with(this: new () => T): T { return new this(); } } diff --git a/frontend/cypress/support/keyresultFormPage.ts b/frontend/cypress/support/helper/pom-helper/dialogs/keyResultDialog.ts similarity index 83% rename from frontend/cypress/support/keyresultFormPage.ts rename to frontend/cypress/support/helper/pom-helper/dialogs/keyResultDialog.ts index 3a8807f402..14fb850191 100644 --- a/frontend/cypress/support/keyresultFormPage.ts +++ b/frontend/cypress/support/helper/pom-helper/dialogs/keyResultDialog.ts @@ -1,7 +1,7 @@ -import BaseFormPage from './baseFormPage'; -import { Unit } from '../../src/app/shared/types/enums/Unit'; +import Dialog from './dialog'; +import { Unit } from '../../../../../src/app/shared/types/enums/Unit'; -export default class CyKeyResultFormPage extends BaseFormPage { +export default class KeyResultDialog extends Dialog { fillKeyresultTitle(title: string) { this.fillInput('titleInput', title); return this; diff --git a/frontend/cypress/support/objectiveFormPage.ts b/frontend/cypress/support/helper/pom-helper/dialogs/objectiveDialog.ts similarity index 85% rename from frontend/cypress/support/objectiveFormPage.ts rename to frontend/cypress/support/helper/pom-helper/dialogs/objectiveDialog.ts index e67d58ad3e..ef952e5c13 100644 --- a/frontend/cypress/support/objectiveFormPage.ts +++ b/frontend/cypress/support/helper/pom-helper/dialogs/objectiveDialog.ts @@ -1,6 +1,6 @@ -import BaseFormPage from './baseFormPage'; +import Dialog from './dialog'; -export default class CyObjectiveFormPage extends BaseFormPage { +export default class ObjectiveDialog extends Dialog { fillObjectiveTitle(title: string) { this.fillInput('title', title); return this; diff --git a/frontend/cypress/support/OverviewPage.ts b/frontend/cypress/support/helper/pom-helper/pages/overviewPage.ts similarity index 86% rename from frontend/cypress/support/OverviewPage.ts rename to frontend/cypress/support/helper/pom-helper/pages/overviewPage.ts index d3d188abc2..25a45cbc33 100644 --- a/frontend/cypress/support/OverviewPage.ts +++ b/frontend/cypress/support/helper/pom-helper/pages/overviewPage.ts @@ -1,5 +1,5 @@ -import { getObjectivesByNameAndState } from './objective-helper'; -import CyObjectiveFormPage from './objectiveFormPage'; +import { getObjectivesByNameAndState } from '../../objective-helper'; +import ObjectiveDialog from '../dialogs/objectiveDialog'; export default class CyOverviewPage { visit() { @@ -29,10 +29,10 @@ export default class CyOverviewPage { addObjective(teamName?: string) { if (teamName) { this.getTeamByName(teamName).find('.add-objective').first().click(); - return new CyObjectiveFormPage(); + return new ObjectiveDialog(); } cy.getByTestId('add-objective').first().click(); - return new CyObjectiveFormPage(); + return new ObjectiveDialog(); } getTeamByName(teamName: string) { diff --git a/frontend/cypress/support/scoringSupport.ts b/frontend/cypress/support/helper/scoringSupport.ts similarity index 97% rename from frontend/cypress/support/scoringSupport.ts rename to frontend/cypress/support/helper/scoringSupport.ts index 3e907d3fff..e6a92fdd13 100644 --- a/frontend/cypress/support/scoringSupport.ts +++ b/frontend/cypress/support/helper/scoringSupport.ts @@ -1,4 +1,4 @@ -import { isLastCheckInNegative } from '../../src/app/shared/common'; +import { isLastCheckInNegative } from '../../../src/app/shared/common'; interface ScoringValue { failPercent: number; diff --git a/frontend/cypress/support/utils.ts b/frontend/cypress/support/helper/utils.ts similarity index 100% rename from frontend/cypress/support/utils.ts rename to frontend/cypress/support/helper/utils.ts