From 4259eabe9a9b0d3aa847ff112a8ddaf5d81420b0 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Mon, 12 Aug 2024 17:30:33 +0530 Subject: [PATCH 1/5] Fix JF for Tests related to application-archetype association (#1189) Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts modified: cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts Signed-off-by: yael-spinner --- .../assessment/archetype_association.test.ts | 4 ++-- .../applicationinventory/assessment/miscellaneous.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts index 6f798dc37..188ed415c 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts @@ -77,7 +77,7 @@ describe(["@tier2"], "Tests related to application-archetype association ", () = archetype.verifyStatus("assessment", "Not started"); archetype.perform_assessment("low", stakeholders); // 'Archetype risk' field shows unassessed until all required questionnaires have been taken. - archetype.validateAssessmentField("unassessed"); + archetype.validateAssessmentField("Unassessed"); archetype.clickAssessButton(); cy.contains("tr", legacyPathfinder).find("button.retake-button").should("have.length", 1); @@ -146,7 +146,7 @@ describe(["@tier2"], "Tests related to application-archetype association ", () = application2.verifyStatus("assessment", "Not started"); archetypeList[0].perform_assessment("low", stakeholders); application2.verifyStatus("assessment", "In-progress"); - application2.validateAssessmentField("unassessed"); + application2.validateAssessmentField("Unassessed"); archetypeList[1].perform_assessment("medium", stakeholders); application2.verifyStatus("assessment", "Completed"); diff --git a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts index e53faec44..b0141e560 100644 --- a/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts @@ -125,7 +125,7 @@ describe(["@tier3"], "Tests related to application assessment and review", () => `Success! Assessment discarded for ${applicationList[0].name}.`, true ); - applicationList[0].validateAssessmentField("unassessed"); + applicationList[0].validateAssessmentField("Unassessed"); archetypeList[0].perform_assessment("low", stakeholderList); }); @@ -316,14 +316,14 @@ describe(["@tier3"], "Tests related to application assessment and review", () => applications[0].perform_assessment("low", stakeholderList); AssessmentQuestionnaire.disable(legacyPathfinder); applications[0].verifyStatus("assessment", "Not started"); - applications[0].validateAssessmentField("unassessed"); + applications[0].validateAssessmentField("Unassessed"); applications[0].deleteAssessments(); applications[0].verifyStatus("assessment", "Not started"); AssessmentQuestionnaire.enable(legacyPathfinder); archetypes[0].perform_assessment("low", stakeholderList); AssessmentQuestionnaire.disable(legacyPathfinder); - archetypes[0].validateAssessmentField("unassessed"); + archetypes[0].validateAssessmentField("Unassessed"); archetypes[0].deleteAssessments(); AssessmentQuestionnaire.enable(legacyPathfinder); From 3323e55a801a34d127da6638600df6f542c7bb59 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Mon, 12 Aug 2024 17:33:14 +0530 Subject: [PATCH 2/5] Fix Source analysis (#1188) Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts Signed-off-by: yael-spinner --- .../applicationinventory/analysis/source_analysis.test.ts | 1 + 1 file changed, 1 insertion(+) 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 864f75083..dce65bd0e 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts @@ -236,6 +236,7 @@ describe(["@tier1"], "Source Analysis", () => { }), getRandomAnalysisData(this.analysisData["analysis_on_example-1-app"]) ); + cy.wait(2 * SEC); Application.open(); application.create(); applicationsList.push(application); From daadbc177a5cd24a0f7029e62ce55b1d7e6d9b2d Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Mon, 12 Aug 2024 17:09:49 -0500 Subject: [PATCH 3/5] Add bug ID to archetype questionnaire feature test (#1190) Signed-off-by: Nandini Chandra Signed-off-by: yael-spinner --- .../tests/migration/archetypes/questionnaire_features.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts index 10411403d..fec9faf19 100644 --- a/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts +++ b/cypress/e2e/tests/migration/archetypes/questionnaire_features.test.ts @@ -86,7 +86,7 @@ describe(["@tier3"], "Tests for archetype questionnaire features", () => { archetype.discard("Discard assessment(s)"); }); - it("Bug: MTA-3417 Archetypes: 1) Test auto answer feature of questionnaires; 2) Save assessment", function () { + it("Bug MTA-3417: Archetypes: 1) Test auto answer feature of questionnaires; 2) Save assessment", function () { //Automates Polarion MTA-388: Auto answer archetype.clickAssessButton(); Assessment.take_questionnaire(cloudReadinessQuestionnaire); From e0583eca0d58868ca3a929ff5c87e796cc7e2d6f Mon Sep 17 00:00:00 2001 From: midays <92722851+midays@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:42:27 +0300 Subject: [PATCH 4/5] [RFR] Automate TC 582 (#1185) * Automate TC 582 Signed-off-by: midays * try with commented application creation Signed-off-by: midays * added before each clause Signed-off-by: midays * change clause type and name Signed-off-by: midays * change navTav selector Signed-off-by: midays * revert changes Signed-off-by: midays * revert changes Signed-off-by: midays * final changes passed Signed-off-by: midays * fix applicationList variable initialization Signed-off-by: midays * remove comment Signed-off-by: midays --------- Signed-off-by: midays Signed-off-by: yael-spinner --- .../applications/language_discovery.test.ts | 60 +++++++++++++++---- cypress/fixtures/application.json | 4 ++ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/applications/language_discovery.test.ts b/cypress/e2e/tests/migration/applicationinventory/applications/language_discovery.test.ts index f4e15b3ae..dabc58af6 100644 --- a/cypress/e2e/tests/migration/applicationinventory/applications/language_discovery.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/applications/language_discovery.test.ts @@ -15,16 +15,24 @@ limitations under the License. */ /// -import { login, getRandomApplicationData, sidedrawerTab } from "../../../../../utils/utils"; +import { + login, + getRandomApplicationData, + sidedrawerTab, + deleteByList, +} from "../../../../../utils/utils"; import { Application } from "../../../../models/migration/applicationinventory/application"; import { SEC } from "../../../../types/constants"; import { labelTagText } from "../../../../views/applicationinventory.view"; -let application: Application; +let applicationList: Application[] = []; describe(["@tier2"], "Test if application language is discovered and tagged correctly", () => { before("Login", function () { login(); + }); + + beforeEach("Load Data", function () { cy.fixture("application").then(function (appData) { this.appData = appData; }); @@ -38,36 +46,62 @@ describe(["@tier2"], "Test if application language is discovered and tagged corr Tooling: ["Maven"], Framework: ["Quarkus"], }; - application = new Application( + const application = new Application( getRandomApplicationData("Java_language_maven_tooling_quarkus_framework", { sourceData: this.appData["Java_language_maven_tooling_quarkus_framework"], }) ); application.create(); + applicationList.push(application); cy.wait(2 * SEC); sidedrawerTab("Java_language_maven_tooling_quarkus_framework", "Tags"); cy.contains("No tags available", { timeout: 60 * SEC }).should("not.exist"); assertTagsInSection(sectionsTags); }); + it("Application written in java and typescript with Maven and NodeJS tooling ", function () { + // Automates Polarion MTA-582 + const sectionsTags = { + Language: ["Java", "TypeScript"], + Tooling: ["Maven", "NodeJs", "Node.js"], + }; + const application = new Application( + getRandomApplicationData("Java_TS_language_maven_nodeJS_tooling", { + sourceData: this.appData["Java_TS_language_maven_nodeJS_tooling"], + }) + ); + application.create(); + applicationList.push(application); + cy.wait(2 * SEC); + sidedrawerTab("Java_TS_language_maven_nodeJS_tooling", "Tags"); + cy.contains("No tags available", { timeout: 60 * SEC }).should("not.exist"); + assertTagsInSection(sectionsTags); + }); + + afterEach("Persist session", function () { + Application.open(true); + }); + after("Perform test data clean up", function () { - application.delete(); + deleteByList(applicationList); }); function assertTagsInSection(sectionsTags: { Language: string[]; - Tooling: string[]; - Framework: string[]; + Tooling?: string[]; + Framework?: string[]; }): void { Cypress._.forEach(sectionsTags, (tags, section) => { - cy.contains("h4", section) - .parentsUntil("section") - .next() - .within(() => { - tags.forEach((tag) => { - cy.contains(labelTagText, tag).should("have.length", 1); + if (section) { + cy.contains("h4", section) + .parentsUntil("section") + .next() + .within(() => { + tags.forEach((tag) => { + cy.contains(labelTagText, tag).should("have.length", 1); + }); }); - }); + } }); } }); diff --git a/cypress/fixtures/application.json b/cypress/fixtures/application.json index 9930a8232..063bef508 100644 --- a/cypress/fixtures/application.json +++ b/cypress/fixtures/application.json @@ -68,6 +68,10 @@ "repoType": "Git", "sourceRepo": "https://github.com/quarkusio/quarkus-super-heroes" }, + "Java_TS_language_maven_nodeJS_tooling": { + "repoType": "Git", + "sourceRepo": "https://github.com/pkaul/maven-typescript-example" + }, "java-example-app": { "repoType": "Git", "sourceRepo": "https://github.com/ibraginsky/book-server" From dc78acfc8c3bcb28d70db5f08350ea69c8d5ea67 Mon Sep 17 00:00:00 2001 From: yael-spinner Date: Wed, 30 Oct 2024 15:20:16 +0200 Subject: [PATCH 5/5] Adding test case to verify selected analysis mode Signed-off-by: yael-spinner --- .../analysis/analysis_default_mode.test.ts | 478 ++++++++++++++++++ 1 file changed, 478 insertions(+) create mode 100644 cypress/e2e/tests/migration/applicationinventory/analysis/analysis_default_mode.test.ts diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/analysis_default_mode.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/analysis_default_mode.test.ts new file mode 100644 index 000000000..ee72dd37e --- /dev/null +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/analysis_default_mode.test.ts @@ -0,0 +1,478 @@ +/* +Copyright © 2021 the Konveyor Contributors (https://konveyor.io/) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +/// + +import { + login, + getRandomApplicationData, + getRandomAnalysisData, + writeMavenSettingsFile, + resetURL, +} from "../../../../../utils/utils"; +import * as data from "../../../../../utils/data_utils"; +import { Analysis } from "../../../../models/migration/applicationinventory/analysis"; +import { AnalysisStatuses, CredentialType, UserCredentials } from "../../../../types/constants"; +//import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername"; +import { CredentialsMaven } from "../../../../models/administration/credentials/credentialsMaven"; +import { MavenConfiguration } from "../../../../models/administration/repositories/maven"; +//let source_credential: CredentialsSourceControlUsername; +let maven_credential: CredentialsMaven; +const mavenConfiguration = new MavenConfiguration(); +let application: Analysis; + +describe(["@tier1"], "Binary Analysis", () => { + before("Login", function () { + login(); + + // Clears artifact repository + mavenConfiguration.clearRepository(); + + //Create source and maven credentials required for analysis + // source_credential = new CredentialsSourceControlUsername( + // data.getRandomCredentialsData( + // CredentialType.sourceControl, + // UserCredentials.usernamePassword, + // true + // ) + // ); + // source_credential.create(); + + maven_credential = new CredentialsMaven( + data.getRandomCredentialsData(CredentialType.maven, "None", true) + ); + maven_credential.create(); + }); + + beforeEach("Load data", function () { + cy.fixture("application").then(function (appData) { + this.appData = appData; + }); + cy.fixture("analysis").then(function (analysisData) { + this.analysisData = analysisData; + }); + + cy.intercept("GET", "/hub/application*").as("getApplication"); + }); + + it("Binary Analysis", function () { + // For binary analysis application must have group,artifcat and version. + application = new Analysis( + getRandomApplicationData("tackletestApp_binary", { + binaryData: this.appData["tackle-testapp-binary"], + }), + getRandomAnalysisData(this.analysisData["binary_analysis_on_tackletestapp"]) + ); + application.create(); + cy.wait("@getApplication"); + cy.wait(2000); + // Both source and maven credentials required for binary. + //application.manageCredentials(source_credential.name, maven_credential.name); + application.analyze(); + application.verifyAnalysisStatus(AnalysisStatuses.completed); + application.verifyEffort(this.analysisData["binary_analysis_on_tackletestapp"]["effort"]); + }); + + afterEach("Persist session", function () { + resetURL(); + }); + + after("Perform test data clean up", function () { + // application.delete(); + // source_credential.delete(); + // maven_credential.delete(); + + // writeMavenSettingsFile(data.getRandomWord(5), data.getRandomWord(5)); + }); +}); + + +/* +Copyright © 2021 the Konveyor Contributors (https://konveyor.io/) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +/// + +import { + deleteByList, +} from "../../../../../utils/utils"; +import { + SEC, +} from "../../../../types/constants"; +import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername"; +import { CredentialsSourceControlKey } from "../../../../models/administration/credentials/credentialsSourceControlKey"; +import { Application } from "../../../../models/migration/applicationinventory/application"; +import { AppIssue } from "../../../../types/types"; +let applicationsList: Array = []; + +describe(["@tier1"], "Source Analysis", () => { + before("Login", function () { + login(); + + // Create Maven credentials + maven_credential = new CredentialsMaven( + data.getRandomCredentialsData(CredentialType.maven, null, true) + ); + maven_credential.create(); + }); + + beforeEach("Load data", function () { + cy.fixture("application").then(function (appData) { + this.appData = appData; + }); + cy.fixture("analysis").then(function (analysisData) { + this.analysisData = analysisData; + }); + + // Interceptors + cy.intercept("POST", "/hub/application*").as("postApplication"); + cy.intercept("GET", "/hub/application*").as("getApplication"); + Application.open(true); + }); + + it("Source + dependencies analysis on tackletest app", function () { + // Source code analysis require both source and maven credentials + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source+dependencies", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData(this.analysisData["source+dep_analysis_on_tackletestapp"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort( + this.analysisData["source+dep_analysis_on_tackletestapp"]["effort"] + ); + }); + + it("Source + dependencies analysis on daytrader app", function () { + // Automate bug https://issues.redhat.com/browse/TACKLE-721 + const application = new Analysis( + getRandomApplicationData("dayTraderApp_Source+dependencies", { + sourceData: this.appData["daytrader-app"], + }), + getRandomAnalysisData(this.analysisData["source+dep_analysis_on_daytrader-app"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + }); + + it("Analysis on daytrader app with maven credentials", function () { + // Automate bug https://issues.redhat.com/browse/TACKLE-751 + const application = new Analysis( + getRandomApplicationData("dayTraderApp_MavenCreds", { + sourceData: this.appData["daytrader-app"], + }), + getRandomAnalysisData(this.analysisData["source+dep_analysis_on_daytrader-app"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.manageCredentials(null, maven_credential.name); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + }); + + it("Source Analysis on tackle testapp", function () { + // For tackle test app source credentials are required. + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData(this.analysisData["analysis_for_enableTagging"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + }); + + it("Analysis on tackle test app with ssh credentials", function () { + // Automate bug https://issues.redhat.com/browse/TACKLE-707 + const scCredsKey = new CredentialsSourceControlKey( + data.getRandomCredentialsData( + CredentialType.sourceControl, + UserCredentials.sourcePrivateKey + ) + ); + scCredsKey.create(); + const application = new Analysis( + getRandomApplicationData("tackleTestApp_sshCreds", { + sourceData: this.appData["tackle-testapp-ssh"], + }), + getRandomAnalysisData(this.analysisData["analysis_for_enableTagging"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.manageCredentials(scCredsKey.name, null); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + }); + + it("Analysis for known Open Source libraries on tackleTest app", function () { + // Source code analysis require both source and maven credentials + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source+knownLibraries", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData(this.analysisData["analysis_for_openSourceLibraries"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + }); + + it("Automated tagging using Source Analysis on tackle testapp", function () { + // Automates Polarion MTA-208 + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source_autoTagging", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData(this.analysisData["analysis_for_enableTagging"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.applicationDetailsTab("Tags"); + application.tagAndCategoryExists( + this.analysisData["analysis_for_enableTagging"]["techTags"] + ); + application.closeApplicationDetails(); + }); + + it("Bug MTA-3418: Disable Automated tagging using Source Analysis on tackle testapp", function () { + // Automates Polarion MTA-307 + const application = new Analysis( + getRandomApplicationData("bookserverApp_Disable_autoTagging", { + sourceData: this.appData["bookserver-app"], + }), + getRandomAnalysisData(this.analysisData["analysis_for_disableTagging"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort(this.analysisData["analysis_for_disableTagging"]["effort"]); + application.applicationDetailsTab("Tags"); + cy.get("h2", { timeout: 5 * SEC }).should("contain", "No tags available"); + }); + + it("Analysis for Konveyor example1 application", function () { + // Automates https://github.com/konveyor/example-applications/tree/main/example-1 + const application = new Analysis( + getRandomApplicationData("Example 1", { + sourceData: this.appData["konveyor-exampleapp"], + }), + getRandomAnalysisData(this.analysisData["analysis_on_example-1-app"]) + ); + cy.wait(2 * SEC); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + // Polarion TC 406 + application.verifyEffort(this.analysisData["analysis_on_example-1-app"]["effort"]); + }); + + it("Bug MTA-2916: JWS6 target Source + deps analysis on tackletest app", function () { + // Source code analysis require both source and maven credentials + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source+dependencies_jws6", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData(this.analysisData["jws6_source+dep_analysis_on_tackletestapp"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort( + this.analysisData["jws6_source+dep_analysis_on_tackletestapp"]["effort"] + ); + }); + + it("Bug MTA-2916: Openjdk17 Source + dependencies analysis on tackletest app", function () { + const application = new Analysis( + getRandomApplicationData("tackleTestApp_Source+dependencies_openjdk17", { + sourceData: this.appData["tackle-testapp-git"], + }), + getRandomAnalysisData( + this.analysisData["openJDK17_source+dep_analysis_on_tackletestapp"] + ) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort( + this.analysisData["openJDK17_source+dep_analysis_on_tackletestapp"]["effort"] + ); + }); + + it("Bug MTA-2916: OpenJDK21 Source + dependencies analysis on daytrader app", function () { + const application = new Analysis( + getRandomApplicationData("dayTraderApp_Source+dependencies_openjdk21", { + sourceData: this.appData["daytrader-app"], + }), + getRandomAnalysisData(this.analysisData["openJDK21_source+dep_analysis_on_dayTrader"]) + ); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort( + this.analysisData["openJDK21_source+dep_analysis_on_dayTrader"]["effort"] + ); + }); + + // Automates customer bug MTA-1785 + it("JDK<11 Source + dependencies analysis on tackle app public", function () { + const application = new Analysis( + getRandomApplicationData("tackle testapp public jdk 9", { + sourceData: this.appData["tackle-testapp-public-jdk9"], + }), + getRandomAnalysisData(this.analysisData["jdk9_source_dep_analysis_on_tackletestapp"]) + ); + Application.open(); + application.create(); + application.manageCredentials(null, maven_credential.name); + applicationsList.push(application); + cy.wait("@getApplication"); + cy.wait(2 * SEC); + application.analyze(); + application.verifyAnalysisStatus(AnalysisStatuses.completed); + }); + + // Automates bug MTA-3422 + it("4 targets source analysis on tackle app public", function () { + const application = new Analysis( + getRandomApplicationData("tackle-public-4-targets", { + sourceData: this.appData["tackle-testapp-public"], + }), + getRandomAnalysisData(this.analysisData["tackle-testapp-public-4-targets"]) + ); + cy.wait(2 * SEC); + Application.open(); + application.create(); + applicationsList.push(application); + cy.wait(5 * SEC); + application.analyze(); + application.verifyAnalysisStatus("Completed"); + application.verifyEffort(this.analysisData["tackle-testapp-public-4-targets"]["effort"]); + }); + + // Automates customer bug MTA-2973 + it("Bug MTA-3163: 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"]) + ), + ]; + + // 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]); + cy.wait(5 * SEC); + applicationList[0].analyze(); + applicationList[0].verifyAnalysisStatus("Completed"); + applicationList[0].validateIssues( + this.analysisData["tackle-testapp-public-customRule"]["issues"] + ); + this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( + (currentIssue: AppIssue) => { + applicationList[0].validateAffected(currentIssue); + } + ); + + // Analysis application without maven credential + cy.wait(2 * SEC); + Application.open(); + applicationList[1].create(); + applicationsList.push(applicationList[0]); + cy.wait(5 * SEC); + applicationList[1].analyze(); + applicationList[1].verifyAnalysisStatus("Completed"); + applicationList[1].validateIssues( + this.analysisData["tackle-testapp-public-customRule"]["issues"] + ); + this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( + (currentIssue: AppIssue) => { + applicationList[1].validateAffected(currentIssue); + } + ); + }); + + after("Perform test data clean up", function () { + deleteByList(applicationsList); + writeMavenSettingsFile(data.getRandomWord(5), data.getRandomWord(5)); + }); +});