Skip to content

Commit

Permalink
turn on stylistic rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 authored and kcinay055679 committed Dec 20, 2024
1 parent 6f8ee73 commit 516ae11
Show file tree
Hide file tree
Showing 120 changed files with 2,799 additions and 3,937 deletions.
315 changes: 145 additions & 170 deletions frontend/cypress/e2e/check-in.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,162 +7,139 @@ 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";

describe("OKR Check-in e2e tests",
() => {
describe("tests via click",
() => {
let overviewPage = new CyOverviewPage();
let keyresultDetailPage = new KeyResultDetailPage();
describe("OKR Check-in e2e tests", () => {
describe("tests via click", () => {
let overviewPage = new CyOverviewPage();
let keyresultDetailPage = new KeyResultDetailPage();

beforeEach(() => {
overviewPage = new CyOverviewPage();
keyresultDetailPage = new KeyResultDetailPage();
cy.loginAsUser(users.gl);
});
beforeEach(() => {
overviewPage = new CyOverviewPage();
keyresultDetailPage = new KeyResultDetailPage();
cy.loginAsUser(users.gl);
});

it("Create checkin metric",
() => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("Very important keyresult")
.withMetricValues(Unit.PERCENT,
"21",
"51")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("Very important keyresult")
.createCheckIn()
.checkForDialogTextMetric()
.fillMetricCheckInValue("30")
.setCheckInConfidence(6)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();
cy.contains("30%");
cy.contains("6/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
cy.contains("We bought a new house");
});
it("Create checkin metric", () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("Very important keyresult")
.withMetricValues(Unit.PERCENT, "21", "51")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("Very important keyresult")
.createCheckIn()
.checkForDialogTextMetric()
.fillMetricCheckInValue("30")
.setCheckInConfidence(6)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();
cy.contains("30%");
cy.contains("6/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
cy.contains("We bought a new house");
});

it("Create checkin metric with confidence 0",
() => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("Very important keyresult")
.withMetricValues(Unit.PERCENT,
"21",
"51")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("Very important keyresult")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(0)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();
it("Create checkin metric with confidence 0", () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("Very important keyresult")
.withMetricValues(Unit.PERCENT, "21", "51")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("Very important keyresult")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(0)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();

cy.contains("30%");
cy.contains("6/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
cy.contains("We bought a new house");
});
cy.contains("30%");
cy.contains("6/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
cy.contains("We bought a new house");
});

it("Create checkin metric with value below baseline",
() => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("This will not be good")
.withMetricValues(Unit.PERCENT,
"21",
"52")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("This will not be good")
.createCheckIn()
.fillMetricCheckInValue("5")
.setCheckInConfidence(5)
.submit();
it("Create checkin metric with value below baseline", () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("This will not be good")
.withMetricValues(Unit.PERCENT, "21", "52")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("This will not be good")
.createCheckIn()
.fillMetricCheckInValue("5")
.setCheckInConfidence(5)
.submit();

cy.contains("5%");
cy.contains("!");
cy.contains("5/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
});
cy.contains("5%");
cy.contains("!");
cy.contains("5/10");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
});

it("Create checkin ordinal",
() => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("A new ordinal keyresult for our company")
.withOrdinalValues("New house",
"New car",
"New pool")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("A new ordinal keyresult for our company")
.createCheckIn()
.checkForDialogTextOrdinal()
.selectOrdinalCheckInZone("commit")
.setCheckInConfidence(6)
.fillCheckInCommentary("There is a new car")
.fillCheckInInitiatives("Buy a new pool")
.submit();
it("Create checkin ordinal", () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("A new ordinal keyresult for our company")
.withOrdinalValues("New house", "New car", "New pool")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("A new ordinal keyresult for our company")
.createCheckIn()
.checkForDialogTextOrdinal()
.selectOrdinalCheckInZone("commit")
.setCheckInConfidence(6)
.fillCheckInCommentary("There is a new car")
.fillCheckInInitiatives("Buy a new pool")
.submit();

cy.contains("6/10");
cy.contains("There is a new car");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
});
cy.contains("6/10");
cy.contains("There is a new car");
cy.contains("Letztes Check-in (" + getCurrentDate() + ")");
});

it("Should generate checkin list",
() => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("This will give a checkin list")
.withMetricValues(Unit.PERCENT,
"21",
"52")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("This will give a checkin list")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(5)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();
keyresultDetailPage
.createCheckIn()
.fillMetricCheckInValue("50")
.setCheckInConfidence(6)
.fillCheckInCommentary("This was a good idea")
.fillCheckInInitiatives("Will be difficult")
.submit();
keyresultDetailPage
.showAllCheckins()
.checkForAttribute("Confidence:",
"5 / 10")
.checkForAttribute("Confidence:",
"6 / 10")
.checkForAttribute("Veränderungen:",
"We bought a new house")
.checkForAttribute("Veränderungen:",
"This was a good idea")
.checkForAttribute("Massnahmen:",
"We have to buy more PCs")
.checkForAttribute("Massnahmen:",
"Will be difficult");
it("Should generate checkin list", () => {
overviewPage
.addKeyResult()
.fillKeyResultTitle("This will give a checkin list")
.withMetricValues(Unit.PERCENT, "21", "52")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("This will give a checkin list")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(5)
.fillCheckInCommentary("We bought a new house")
.fillCheckInInitiatives("We have to buy more PCs")
.submit();
keyresultDetailPage
.createCheckIn()
.fillMetricCheckInValue("50")
.setCheckInConfidence(6)
.fillCheckInCommentary("This was a good idea")
.fillCheckInInitiatives("Will be difficult")
.submit();
keyresultDetailPage
.showAllCheckins()
.checkForAttribute("Confidence:", "5 / 10")
.checkForAttribute("Confidence:", "6 / 10")
.checkForAttribute("Veränderungen:", "We bought a new house")
.checkForAttribute("Veränderungen:", "This was a good idea")
.checkForAttribute("Massnahmen:", "We have to buy more PCs")
.checkForAttribute("Massnahmen:", "Will be difficult");

cy.contains("Check-in History");
cy.contains(getCurrentDate());
cy.contains("Wert: 30%");
cy.contains("Wert: 50%");
});
cy.contains("Check-in History");
cy.contains(getCurrentDate());
cy.contains("Wert: 30%");
cy.contains("Wert: 50%");
});

it('Edit metric checkin', () => {
overviewPage
Expand Down Expand Up @@ -222,27 +199,25 @@ describe("OKR Check-in e2e tests",
.close();
keyresultDetailPage.close();

overviewPage
.addKeyResult()
.fillKeyResultTitle("There is another kr with fte")
.withMetricValues(Unit.FTE,
"10",
"300")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("There is another kr with fte")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(5)
.fillCheckInCommentary("Here we are")
.fillCheckInInitiatives("A cat would be great")
.submit();
cy.contains("Aktuell: 30 FTE");
keyresultDetailPage.showAllCheckins();
cy.contains("Check-in History");
cy.contains("Wert: 30 FTE");
});
overviewPage
.addKeyResult()
.fillKeyResultTitle("There is another kr with fte")
.withMetricValues(Unit.FTE, "10", "300")
.fillKeyResultDescription("This is my description")
.submit();
keyresultDetailPage
.visit("There is another kr with fte")
.createCheckIn()
.fillMetricCheckInValue("30")
.setCheckInConfidence(5)
.fillCheckInCommentary("Here we are")
.fillCheckInInitiatives("A cat would be great")
.submit();
cy.contains("Aktuell: 30 FTE");
keyresultDetailPage.showAllCheckins();
cy.contains("Check-in History");
cy.contains("Wert: 30 FTE");
});

it('Edit ordinal checkin', () => {
overviewPage
Expand Down Expand Up @@ -296,9 +271,8 @@ describe("OKR Check-in e2e tests",
.checkDescription('Dein Objective befindet sich noch im DRAFT Status. Möchtest du das Check-in trotzdem erfassen?');
});

it("Should only display last value div if last checkin is present",
() => {
const objectiveName = uniqueSuffix("new objective");
it("Should only display last value div if last checkin is present", () => {
const objectiveName = uniqueSuffix("new objective");

overviewPage.addObjective()
.fillObjectiveTitle(objectiveName)
Expand Down Expand Up @@ -328,6 +302,7 @@ describe("OKR Check-in e2e tests",
.contains('10%');
});
});
});

function getCurrentDate () {
const today = new Date();
Expand Down
Loading

0 comments on commit 516ae11

Please sign in to comment.