Skip to content

Commit

Permalink
complete e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jan 10, 2025
1 parent 2264b6f commit ef01194
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ VALUES (1, 1, '[email protected]', 'Paco', 'Eggimann', FALSE),
(31, 1, '[email protected]', 'Findus', 'Peterson', FALSE),
(41, 1, '[email protected]', 'Paco', 'Egiman', FALSE),
(51, 1, '[email protected]', 'Robin', 'Papierer', FALSE),
(61, 1, '[email protected]', 'Jaya', 'Norris', TRUE);
(61, 1, '[email protected]', 'Jaya', 'Norris', TRUE),
(71, 1, '[email protected]', 'Just', 'Bl', FALSE);


CREATE ALIAS INIT_QUARTER_DATA FOR 'ch.puzzle.okr.util.quarter.generate.h2.QuarterFunction.initQuarterData';
CREATE ALIAS CURRENT_QUARTER_LABEL FOR 'ch.puzzle.okr.util.quarter.generate.h2.QuarterFunction.currentQuarterLabel';
Expand Down Expand Up @@ -72,7 +74,10 @@ VALUES (1, 1, 1, 4, TRUE),
(7, 1, 51, 6, TRUE),
-- [email protected]
(8, 1, 61, 5, TRUE),
(9, 1, 61, 6, FALSE);
(9, 1, 61, 6, FALSE),

(10, 1, 71, 6, true);


insert into objective (id, version, description, modified_on, progress, title, created_by_id, quarter_id, team_id, state,
modified_by_id, created_on)
Expand Down
17 changes: 14 additions & 3 deletions frontend/cypress/e2e/check-in.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDet
import CheckInDialog from '../support/helper/dom-helper/dialogs/checkInDialog';
import CheckInHistoryDialog from '../support/helper/dom-helper/dialogs/checkInHistoryDialog';
import ConfirmDialog from '../support/helper/dom-helper/dialogs/confirmDialog';
import FilterHelper from '../support/helper/dom-helper/filterHelper';

describe('okr check-in', () => {
let overviewPage = new CyOverviewPage();
Expand Down Expand Up @@ -39,13 +40,16 @@ describe('okr check-in', () => {
cy.contains('We bought a new house');
});

it('should create check-in metric and assert correct owner', () => {
it.only('should create check-in metric and assert correct owner', () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle('This keyresult is for the owner')
.withMetricValues(Unit.PERCENT, '21', '51')
.fillKeyResultDescription('This is my description')
.submit();

overviewPage.checkForToaster('Das Key Result wurde erfolgreich erstellt', 'success');

keyResultDetailPage
.visit('This keyresult is for the owner')
.createCheckIn()
Expand All @@ -56,12 +60,17 @@ describe('okr check-in', () => {
.fillCheckInInitiatives('We have to buy more PCs')
.submit();

keyResultDetailPage.showAllCheckIns()
keyResultDetailPage.checkForToaster('Das Check-in wurde erfolgreich erstellt', 'success')
.showAllCheckIns()
.checkOnDialog(() => cy.contains('Jaya Norris'))
.cancel();

cy.logout();
cy.loginAsUser(users.bl);

FilterHelper.do()
.toggleOption('Alle');

keyResultDetailPage
.visit('This keyresult is for the owner')
.showAllCheckIns()
Expand All @@ -70,8 +79,10 @@ describe('okr check-in', () => {
.setCheckInConfidence(7)
.submit();

keyResultDetailPage.checkForToaster('Das Check-in wurde erfolgreich aktualisiert', 'success');

CheckInHistoryDialog.do()
.checkOnDialog(() => cy.contains('Test'))
.checkOnDialog(() => cy.contains('Just Bl'))
.checkForAttribute('Confidence:', '7 / 10')
.cancel();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,22 @@ export default class CheckInDialog extends Dialog {
}

checkForDialogTextMetric() {
cy.contains('Very important keyresult');
cy.contains('Check-in erfassen');
cy.contains('Key Result');
cy.contains('Neuer Wert');
cy.contains('Confidence um Target Zone (42%) zu erreichen');
cy.contains('Confidence um Target Zone ');
cy.contains('Abbrechen');
return this;
}

checkForDialogTextOrdinal() {
cy.contains('A new ordinal keyresult for our company');
cy.contains('Check-in erfassen');
cy.contains('Key Result');
cy.contains('Fail:');
cy.contains('Commit / Target / Stretch noch nicht erreicht');
cy.contains('Commit:');
cy.contains('Target:');
cy.contains('Stretch:');
cy.contains('New car');
cy.contains('New house');
cy.contains('New pool');
cy.contains('Confidence um Target Zone zu erreichen');
cy.contains('Abbrechen');
return this;
Expand All @@ -82,7 +77,6 @@ export default class CheckInDialog extends Dialog {
override submit() {
cy.getByTestId('submit-check-in')
.click();
// return new CheckInHistoryDialog();
}

getPage(): Chainable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export abstract class PageObjectMapperBase {
cy.get('#toast-container')
.find(`.toast-${type}`)
.contains(content)
.should('exist');
.click();
return this;
}

Expand Down

0 comments on commit ef01194

Please sign in to comment.