From 435d7b698a91bfefca29860335266567415205c5 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Thu, 22 Aug 2024 15:53:18 +0530 Subject: [PATCH] [TA] Automates bug MTA-3440 Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/e2e/models/migration/applicationinventory/analysis.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json modified: cypress/e2e/models/migration/applicationinventory/analysis.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json modified: cypress/e2e/models/migration/applicationinventory/analysis.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json modified: cypress/e2e/models/migration/applicationinventory/analysis.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json modified: cypress/e2e/models/migration/applicationinventory/analysis.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts modified: cypress/fixtures/analysis.json --- .../applicationinventory/analysis.ts | 2 +- .../source_analysis_without_creds.test.ts | 33 ++++++++++++++++++- cypress/fixtures/analysis.json | 7 +++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/models/migration/applicationinventory/analysis.ts b/cypress/e2e/models/migration/applicationinventory/analysis.ts index b2a251aa1..977c24ea8 100644 --- a/cypress/e2e/models/migration/applicationinventory/analysis.ts +++ b/cypress/e2e/models/migration/applicationinventory/analysis.ts @@ -387,7 +387,7 @@ export class Analysis extends Application { }); } - private static verifyStatus(element: Cypress.Chainable, status: string) { + public static verifyStatus(element: Cypress.Chainable, status: string) { element .find("div > div:nth-child(2)", { timeout: 3600000, log: false }) // 1h .should("not.have.text", AnalysisStatuses.notStarted) diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts index 72c13ef42..757c4d1ae 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis_without_creds.test.ts @@ -21,13 +21,15 @@ import { getRandomAnalysisData, deleteByList, checkSuccessAlert, + waitUntilSpinnerIsGone, } from "../../../../../utils/utils"; import { Analysis } from "../../../../models/migration/applicationinventory/analysis"; import { infoAlertMessage } from "../../../../views/common.view"; import { AppIssue } from "../../../../types/types"; import { Application } from "../../../../models/migration/applicationinventory/application"; import { TaskManager } from "../../../../models/migration/task-manager/task-manager"; -import { TaskKind, TaskStatus } from "../../../../types/constants"; +import { TaskKind, TaskStatus, tdTag, trTag } from "../../../../types/constants"; +import { analysisColumn } from "../../../../views/analysis.view"; let applicationsList: Array = []; let application: Analysis; @@ -84,6 +86,35 @@ describe(["@tier1"], "Source Analysis without credentials", () => { ); }); + // Automates Bug https://issues.redhat.com/browse/MTA-3440 + it("Source analysis on bookserver app with EAP8 target", function () { + const Application = new Analysis( + getRandomApplicationData("eap8-bookserverApp", { + sourceData: this.appData["bookserver-app"], + }), + getRandomAnalysisData(this.analysisData["EAP8_bookserverapp"]) + ); + Analysis.open(); + waitUntilSpinnerIsGone; + Application.create(); + applicationsList.push(Application); + cy.wait("@getApplication"); + cy.wait(2000); + Application.analyze(); + checkSuccessAlert(infoAlertMessage, `Submitted for analysis`); + cy.get(tdTag, { log: false }) + .contains(Application.name) + .closest(trTag, { log: false }) + .within(() => { + Analysis.verifyStatus( + cy + .get(analysisColumn, { log: false }) + .should("not.have.text", "Completed with Errors"), + "Completed" + ); + }); + }); + after("Perform test data clean up", function () { cy.wait(2000); Application.open(true); diff --git a/cypress/fixtures/analysis.json b/cypress/fixtures/analysis.json index 2ff8c7fda..7d7bfeacc 100644 --- a/cypress/fixtures/analysis.json +++ b/cypress/fixtures/analysis.json @@ -7,7 +7,7 @@ "source_analysis_on_bookserverapp": { "source": "Source code", "target": ["Containerization", "Linux", "Quarkus"], - "appName": "book-server", + "appName": "bookserver-app", "tags": ["EJB XML", "Java EE Batch", "EJB XML"], "issues": [ { @@ -1220,5 +1220,10 @@ "labels": ["None"] } ] + }, + "EAP8_bookserverapp": { + "appName": "bookserver-app", + "source": "Source code", + "target": ["Application server migration to"] } }