From 81827ddf8c95447995b27afc2a0dae96c5093855 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Tue, 24 Dec 2024 12:21:45 +0530 Subject: [PATCH] [RFR][TA] Automate cool store bug_MTA_4024 Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts modified: cypress/fixtures/analysis.json modified: cypress/fixtures/application.json modified: cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts --- .../analysis/affected_files.test.ts | 25 +++++++++++++++++++ cypress/fixtures/analysis.json | 22 ++++++++++++++++ cypress/fixtures/application.json | 4 +++ 3 files changed, 51 insertions(+) diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts index ea8dfd659..f1edb9c38 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/affected_files.test.ts @@ -64,6 +64,8 @@ describe(["@tier2"], "Affected files validation", () => { // Interceptors cy.intercept("POST", "/hub/application*").as("postApplication"); cy.intercept("GET", "/hub/application*").as("getApplication"); + + Application.open(true); }); it("Bug MTA-2006: Affected files validation with Source + dependencies analysis on daytrader app", function () { @@ -161,6 +163,29 @@ describe(["@tier2"], "Affected files validation", () => { ); }); + // Automates Bug https://issues.redhat.com/browse/MTA-4024 + it("Affected files validation with source+deps analysis on coolStore app", function () { + const application = new Analysis( + getRandomApplicationData("affected_files_on_coolStoreApp", { + sourceData: this.appData["cool-store-app"], + }), + getRandomAnalysisData(this.analysisData["affected_files_on_coolStore_deps"]) + ); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort(this.analysisData["affected_files_on_coolStore_deps"]["effort"]); + application.validateIssues(this.analysisData["affected_files_on_coolStore_deps"]["issues"]); + this.analysisData["affected_files_on_coolStore_deps"]["issues"].forEach( + (currentIssue: AppIssue) => { + application.validateAffected(currentIssue); + } + ); + }); + after("Perform test data clean up", function () { deleteByList(applicationsList); }); diff --git a/cypress/fixtures/analysis.json b/cypress/fixtures/analysis.json index 1929bfe61..f742796d2 100644 --- a/cypress/fixtures/analysis.json +++ b/cypress/fixtures/analysis.json @@ -1249,6 +1249,28 @@ ] }, + "affected_files_on_coolStore_deps": { + "source": "Source code + dependencies", + "target": ["Containerization", "Jakarta EE 9"], + "appName": "cool-store-app", + "effort": 114, + "issues": [ + { + "name": "Move to Jakarta EE Maven Artifacts - replace groupId javax.activation", + "category": "potential", + "sources": ["None"], + "targets": ["eap"], + "effort": 1, + "totalEffort": 1, + "incidents": 1, + "affectedFiles": 1, + "ruleSet": "eap7/weblogic/tests/data", + "rule": "maven-javax-to-jakarta-00002", + "labels": ["JakartaEE", "konveyor.io/source"] + } + ] + }, + "jws6_source+dep_analysis_on_tackletestapp": { "source": "Source code + dependencies", "target": ["JBoss Web Server 6"], diff --git a/cypress/fixtures/application.json b/cypress/fixtures/application.json index e04fed79d..4f73d91e4 100644 --- a/cypress/fixtures/application.json +++ b/cypress/fixtures/application.json @@ -79,5 +79,9 @@ "python-demo-app": { "repoType": "Git", "sourceRepo": "https://github.com/Shopify/sample-django-app" + }, + "cool-store-app": { + "repoType": "Git", + "sourceRepo": "https://github.com/konveyor-ecosystem/coolstore" } }