Skip to content

Commit

Permalink
[RFR] Fix analysis and assessment metric tests (#825)
Browse files Browse the repository at this point in the history
* Fixing analysis_metrics.test.ts

Signed-off-by: Maayan Hadasi <[email protected]>

* Fixing assessment_metrics.test.ts

Signed-off-by: Maayan Hadasi <[email protected]>

---------

Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 authored Nov 22, 2023
1 parent 2884727 commit c46762e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cypress/e2e/tests/custom-metrics/analysis_metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe(["@tier2"], "Custom Metrics - Count the total number of initiated analy
metrics.getValue(metricName).then((counterValue) => {
counter = counterValue;
});
Application.open(true);
});

it("Perform analyses - Validate the tasks initiated counter increased", function () {
Expand All @@ -65,6 +66,7 @@ describe(["@tier2"], "Custom Metrics - Count the total number of initiated analy
counter++;
applicationList.push(bookServerApp);

Application.open(true);
const application = new Analysis(
getRandomApplicationData("uploadBinary"),
getRandomAnalysisData(this.analysisData["uploadbinary_analysis_on_acmeair"])
Expand Down
6 changes: 5 additions & 1 deletion cypress/e2e/tests/custom-metrics/assessment_metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ import {
import { Assessment } from "../../models/migration/applicationinventory/assessment";
import { Metrics } from "../../models/migration/custom-metrics/custom-metrics";
import { Stakeholders } from "../../models/migration/controls/stakeholders";
import { AssessmentQuestionnaire } from "../../models/administration/assessment_questionnaire/assessment_questionnaire";
import { Application } from "../../models/migration/applicationinventory/application";
const metrics = new Metrics();
const metricName = "konveyor_assessments_initiated_total";
let applicationList: Array<Assessment> = [];
let stakeholdersList: Array<Stakeholders> = [];
let counter: number;
const fileName = "Legacy Pathfinder";

describe(["@tier2"], "Custom Metrics - The total number of initiated assessments", function () {
before("Login and create test data", function () {
Expand All @@ -39,6 +42,7 @@ describe(["@tier2"], "Custom Metrics - The total number of initiated assessments

// Create 2 applications
applicationList = createMultipleApplications(2);
AssessmentQuestionnaire.enable(fileName);
});

beforeEach("Get the current counter value", function () {
Expand Down Expand Up @@ -73,7 +77,7 @@ describe(["@tier2"], "Custom Metrics - The total number of initiated assessments
it("Discard Assessment-Validate metrics assessment count doesn't change ", function () {
// Discard assessment of application
applicationList[0].verifyStatus("assessment", "Completed");
applicationList[0].discard_assessment();
applicationList[0].selectKebabMenuItem("Discard assessment(s)");

// Validate the assessment initiated count doesn't change
metrics.validateMetric(metricName, counter);
Expand Down

0 comments on commit c46762e

Please sign in to comment.