Skip to content

Commit

Permalink
Add close dialog method, remove unused method from objective form pag…
Browse files Browse the repository at this point in the history
…e and start implementing keyresult form page
  • Loading branch information
RandomTannenbaum committed Nov 8, 2024
1 parent 72de293 commit 68a2a5c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
4 changes: 4 additions & 0 deletions frontend/cypress/support/baseFormPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default abstract class BaseFormPage {
cy.getByTestId('cancel').click();
}

close() {
cy.getByTestId('close-dialog').click();
}

protected fillInput(testId: string, value: string) {
cy.getByTestId(testId).clear();
cy.getByTestId(testId).type(value);
Expand Down
35 changes: 35 additions & 0 deletions frontend/cypress/support/keyresultFormPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import BaseFormPage from './baseFormPage';
import {Unit} from "../../src/app/shared/types/enums/Unit";

export default class CyKeyResultFormPage extends BaseFormPage {
init() {
cy.get('app-objective-form').should('exist');
}

fillKeyresultTitle(title: string) {
this.fillInput('titleInput', title);
return this;
}

fillKeyresultDescription(description: string) {
this.fillInput('descriptionInput', description);
return this;
}

withMetricValues(unit: Unit, baseline: string, stretchGoal: string) {
cy.getByTestId('unit').select(unit);
this.fillInput('baseline', baseline);
this.fillInput('stretchGoal', stretchGoal);
}

withOrdinalValues(commitZone: string, targetZone: string, stretchGoal: string) {
cy.getByTestId('ordinalTab').click();
this.fillInput('commitZone', commitZone);
this.fillInput('targetZone', targetZone);
this.fillInput('stretchZone', stretchGoal);
}

saveAndNew() {
cy.getByTestId('saveAndNew').click();
}
}
4 changes: 0 additions & 4 deletions frontend/cypress/support/objectiveFormPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ export default class CyObjectiveFormPage extends BaseFormPage {
cy.get('app-objective-form').should('exist');
}

visit() {
cy.visit('/objective-form');
}

fillObjectiveTitle(title: string) {
this.fillInput('title', title);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row">
<h2 class="col d-flex justify-content-between align-items-center my-2">
{{ title }}
<button mat-dialog-close mat-icon-button>
<button mat-dialog-close mat-icon-button [attr.data-testId]="'close-dialog'">
<mat-icon class="text-secondary">close</mat-icon>
</button>
</h2>
Expand Down

0 comments on commit 68a2a5c

Please sign in to comment.