diff --git a/frontend/cypress/e2e/objective.cy.ts b/frontend/cypress/e2e/objective.cy.ts index f1f7299b4f..c25f065cbb 100644 --- a/frontend/cypress/e2e/objective.cy.ts +++ b/frontend/cypress/e2e/objective.cy.ts @@ -128,8 +128,9 @@ describe('OKR Objective e2e tests', () => { ofp.submitObjective(); op.addObjective(); - ofp.fillObjectiveTitle('We dont want to search for this'); - ofp.submitObjective(); + const ofp2 = new CyObjectiveFormPage(); + ofp2.fillObjectiveTitle('We dont want to search for this'); + ofp2.submitObjective(); cy.contains('Search after this objective'); cy.contains('We dont want to search for this'); diff --git a/frontend/cypress/support/objectiveFormPage.ts b/frontend/cypress/support/objectiveFormPage.ts index ca2b1d10fc..50e84bd7fd 100644 --- a/frontend/cypress/support/objectiveFormPage.ts +++ b/frontend/cypress/support/objectiveFormPage.ts @@ -1,45 +1,43 @@ -import {quarter} from "../../src/app/shared/testData"; +import { quarter } from '../../src/app/shared/testData'; export default class CyObjectiveFormPage { + init() { + cy.get('app-objective-form').should('exist'); + } - - // init() { - // cy.get("app-objective-form").should('exist'); - // } - - visit() { + visit() { cy.visit('/objective-form'); } fillObjectiveTitle(title: string) { - this.fillInput('title', title); + this.fillInput('title', title); } fillObjectiveDescription(description: string) { - this.fillInput('description', description); + this.fillInput('description', description); } selectQuarter(quarter: string) { - cy.get('select#quarter').select(quarter); + cy.get('select#quarter').select(quarter); } toggleCreateKeyResults() { - cy.getByTestId('keyResult-checkbox').find("[type='checkbox']").check(); + cy.getByTestId('keyResult-checkbox').find("[type='checkbox']").check(); } submitObjective() { cy.getByTestId('safe').click(); } - submitDraftObjective() { - cy.getByTestId('safe-draft').click(); - } + submitDraftObjective() { + cy.getByTestId('safe-draft').click(); + } cancelObjective() { cy.getByTestId('cancel').click(); } - private fillInput(testId:string, value: string) { + private fillInput(testId: string, value: string) { cy.getByTestId(testId).clear(); cy.getByTestId(testId).type(value); } -} \ No newline at end of file +}