Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
nachandr committed Aug 14, 2023
2 parents b7308c5 + 29dcfd2 commit 4aa21ee
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 40 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 @@ -36,6 +36,7 @@ import {
kebabMenu,
northdependenciesDropdownBtn,
southdependenciesDropdownBtn,
copyAssessmentModal,
} from "../../../views/applicationinventory.view";
import * as commonView from "../../../views/common.view";
import {
Expand Down Expand Up @@ -480,13 +481,13 @@ export class Assessment extends Application {
cy.wait(500);
clickByText(button, action);
});
cy.get("div.pf-c-modal-box").within(() => {
cy.get(copyAssessmentModal).within(() => {
selectItemsPerPage(items);
});
}

selectItemsPerPage(items: number): void {
cy.get("div.pf-c-modal-box").within(() => {
cy.get(copyAssessmentModal).within(() => {
selectItemsPerPage(items);
});
}
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));
});
});
15 changes: 9 additions & 6 deletions cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export const csvFileName = "File name";
export const FileName = "File Name";
export const closeForm = "button[aria-label='close']";
export const copy = "button[aria-label='Copy']";
export const copyAssessmentTableTd = ".pf-m-compact> tbody > tr > td";
export const copyAssessmentTableTr = ".pf-m-compact> tbody > tr";
export const cyclicDependenciesErrorMsg = "cyclic dependencies are not allowed";
export const northdependenciesDropdownBtn = "button[aria-label='northbound-dependencies-toggle']";
export const southdependenciesDropdownBtn = "button[aria-label='southbound-dependencies-toggle']";
Expand All @@ -43,7 +41,6 @@ export const selectBox = "input[type=checkbox]";
export const tags = "span";
export const user = "User";
export const kebabMenu = "td[class='pf-v5-c-table__td pf-v5-c-table__action'] > button";
export const copyAssessmentPagination = "#bulk-copy-assessment-review-pagination-top";

//Fields related to analysis - source mode
export const sourceRepository = "input[name=sourceRepository]";
Expand All @@ -61,10 +58,16 @@ 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",
}

// Fields related to copy assessment modal
export const copyAssessmentTableTd = ".pf-m-compact> tbody > tr > td";
export const copyAssessmentTableTr = ".pf-m-compact> tbody > tr";
export const copyAssessmentPagination = "#bulk-copy-assessment-review-pagination-top";
export const copyAssessmentModal = "div.pf-v5-c-modal-box";
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 4aa21ee

Please sign in to comment.