From 696c3ffecdf4888bc78fa4141967d234b4daa86d Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Mon, 16 Dec 2024 16:13:09 +0530 Subject: [PATCH] [RFR] Fix source analysis custom rule test case Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts --- .../analysis/source_analysis.test.ts | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts index cb07d2688..98fe1cdd6 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts @@ -368,47 +368,48 @@ describe(["@tier1"], "Source Analysis", () => { // Automates customer bug MTA-2973 it("Source analysis on tackle app public with custom rule", function () { - const applicationList = [ - new Analysis( - getRandomApplicationData("tackle-public-customRule", { - sourceData: this.appData["tackle-testapp-public"], - }), - getRandomAnalysisData(this.analysisData["tackle-testapp-public-customRule"]) - ), - ]; - + for (let i = 0; i < 2; i++) { + applicationsList.push( + new Analysis( + getRandomApplicationData("tackle-public-customRule", { + sourceData: this.appData["tackle-testapp-public"], + }), + getRandomAnalysisData(this.analysisData["tackle-testapp-public-customRule"]) + ) + ); + } // Analysis application with maven credential cy.wait(2 * SEC); Application.open(); - applicationList[0].create(); - applicationList[0].manageCredentials(null, maven_credential.name); - applicationsList.push(applicationList[0]); + applicationsList[0].create(); + applicationsList[0].manageCredentials(null, maven_credential.name); + applicationsList.push(applicationsList[0]); cy.wait(5 * SEC); - applicationList[0].analyze(); - applicationList[0].verifyAnalysisStatus("Completed"); - applicationList[0].validateIssues( + applicationsList[0].analyze(); + applicationsList[0].verifyAnalysisStatus("Completed"); + applicationsList[0].validateIssues( this.analysisData["tackle-testapp-public-customRule"]["issues"] ); this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( (currentIssue: AppIssue) => { - applicationList[0].validateAffected(currentIssue); + applicationsList[0].validateAffected(currentIssue); } ); // Analysis application without maven credential cy.wait(2 * SEC); Application.open(); - applicationList[1].create(); - applicationsList.push(applicationList[0]); + applicationsList[1].create(); + applicationsList.push(applicationsList[0]); cy.wait(5 * SEC); - applicationList[1].analyze(); - applicationList[1].verifyAnalysisStatus("Completed"); - applicationList[1].validateIssues( + applicationsList[1].analyze(); + applicationsList[1].verifyAnalysisStatus("Completed"); + applicationsList[1].validateIssues( this.analysisData["tackle-testapp-public-customRule"]["issues"] ); this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( (currentIssue: AppIssue) => { - applicationList[1].validateAffected(currentIssue); + applicationsList[1].validateAffected(currentIssue); } ); });