Skip to content

Commit

Permalink
[RFR] [CR] [TA] Adapt source analysis test (#668)
Browse files Browse the repository at this point in the history
* Adapt source_analysis test

Signed-off-by: Alejandro Brugarolas <[email protected]>

* adapt source analysis test

Signed-off-by: Alejandro Brugarolas <[email protected]>

---------

Signed-off-by: Alejandro Brugarolas <[email protected]>
  • Loading branch information
abrugaro authored Aug 14, 2023
1 parent 18158a6 commit 29dcfd2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 35 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/models/migration/applicationinventory/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ export class Analysis extends Application {

openReport() {
this.selectApplicationRow();
cy.get(rightSideMenu, { timeout: 30 * SEC }).within(() => {
cy.get(rightSideMenu, { timeout: 15 * SEC }).within(() => {
clickTab("Reports");
cy.contains("a", "Report", { timeout: 30 * SEC })
cy.contains("button", "View analysis", { timeout: 15 * SEC })
.then(($a) => {
// Removing target from html so that report opens in same tab
$a.attr("target", "_self");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.

import {
login,
deleteAllBusinessServices,
getRandomApplicationData,
getRandomAnalysisData,
writeMavenSettingsFile,
Expand All @@ -36,12 +35,10 @@ import {
import * as data from "../../../../../utils/data_utils";
import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername";
import { CredentialsSourceControlKey } from "../../../../models/administration/credentials/credentialsSourceControlKey";
import { MavenConfiguration } from "../../../../models/administration/repositories/maven";
import { infoAlertMessage } from "../../../../views/common.view";
let source_credential;
let maven_credential;
const mavenConfiguration = new MavenConfiguration();
var applicationsList: Array<Analysis> = [];
let applicationsList: Array<Analysis> = [];

describe(["@tier1"], "Source Analysis", () => {
before("Login", function () {
Expand Down Expand Up @@ -98,8 +95,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.analyze();
checkSuccessAlert(infoAlertMessage, `Submitted for analysis`);
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Source + dependencies analysis on tackletest app", function () {
Expand All @@ -117,8 +112,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(source_credential.name, maven_credential.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Source + dependencies analysis on daytrader app", function () {
Expand All @@ -135,8 +128,6 @@ describe(["@tier1"], "Source Analysis", () => {
cy.wait(2000);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Analysis on daytrader app with maven credentials", function () {
Expand All @@ -154,8 +145,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(null, maven_credential.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Source Analysis on tackle testapp", function () {
Expand All @@ -173,8 +162,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(source_credential.name, null);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Analysis on tackle test app with ssh credentials", function () {
Expand All @@ -199,8 +186,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(scCredsKey.name, null);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Source Analysis on tackle testapp for svn repo type", function () {
Expand All @@ -218,8 +203,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(source_credential.name, null);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Analysis for known Open Source libraries on tackleTest app", function () {
Expand All @@ -237,8 +220,6 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(source_credential.name, maven_credential.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.openReport();
application.validateStoryPoints();
});

it("Automated tagging using Source Analysis on tackle testapp", function () {
Expand Down Expand Up @@ -294,13 +275,10 @@ describe(["@tier1"], "Source Analysis", () => {
cy.wait(2000);
application.analyze();
application.verifyAnalysisStatus(AnalysisStatuses.completed);
application.openReport();
application.validateStoryPoints();
});

after("Perform test data clean up", function () {
deleteByList(applicationsList);
deleteAllBusinessServices();
writeMavenSettingsFile(data.getRandomWord(5), data.getRandomWord(5));
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export const createEntitiesCheckbox = "#create-entities-checkbox";

//Fields related to application details page
export enum appDetailsView {
applicationTag = "span.pf-c-label__content",
applicationTag = "span.pf-v5-c-label__content",
closeDetailsPage = "button[aria-label='Close drawer panel']",
tagFilter = "#source-filter-value-select",
tagCategory = "div[class='pf-c-content'] > h4",
filterSourceMenu = "div.pf-c-select__menu",
tagCategory = "div[class='pf-v5-c-content'] > h4",
filterSourceMenu = "div.pf-v5-c-select__menu",
tagCategoryFilter = "#tagCategory-filter-value-select",
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/views/common.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const itemsPerPageMenu = "div.pf-c-options-menu";
export const itemsPerPageMenuOptions = "ul.pf-v5-c-menu__list";
export const expandRow = "button[aria-label=Details]";
export const successAlertMessage = ".pf-m-success";
export const infoAlertMessage = "div[aria-label='Info Alert']";
export const infoAlertMessage = ".pf-m-info";
export const duplicateNameWarning = "h4[class*='alert__title']";
export const appTable = "table[aria-label='main-table']";
export const expandableRow = ".pf-c-expandable-row";
Expand Down
10 changes: 4 additions & 6 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@
"storyPoints": 1,
"techTags": [
["HTTP", "Servlet"],
["MVC", "Spring MVC"],
["Observability", "Spring Boot Actuator"],
["Other", "Properties"],
["Persistence", "JPA entities"],
["Persistence", "Spring Data JPA"],
["Web", "Spring Web"]
["Processing", "Java EE Batch"],
["Java EE", "Java EE Batch"],
["Execute", "Java EE Batch"],
["Connect", "Servlet"]
]
},

Expand Down

0 comments on commit 29dcfd2

Please sign in to comment.