Skip to content

Commit

Permalink
use new object for every form
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 8, 2024
1 parent e7cc87f commit c6dd70b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
5 changes: 3 additions & 2 deletions frontend/cypress/e2e/objective.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
30 changes: 14 additions & 16 deletions frontend/cypress/support/objectiveFormPage.ts
Original file line number Diff line number Diff line change
@@ -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);
}
}
}

0 comments on commit c6dd70b

Please sign in to comment.