From 06884a7526ed5b9cb4160b7632d8372dad9d1ef8 Mon Sep 17 00:00:00 2001 From: Sachin Singla Date: Mon, 3 Apr 2023 14:46:31 +0530 Subject: [PATCH] automate windup 3722 --- cypress/e2e/models/pf4Reports.ts | 15 ++++++++++++++- cypress/e2e/tests/report.test.ts | 14 ++++++++++++++ cypress/e2e/types/constants.ts | 1 + cypress/e2e/views/pf4reports.view.ts | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/models/pf4Reports.ts b/cypress/e2e/models/pf4Reports.ts index 850e773..341e16d 100644 --- a/cypress/e2e/models/pf4Reports.ts +++ b/cypress/e2e/models/pf4Reports.ts @@ -3,12 +3,14 @@ import { clickByText, clickPf4ReportTab, clickReportTab, + inputText, navigateTo, } from "../../utils/utils"; -import { SEC, allApps, technologies } from "../types/constants"; +import { SEC, allApps, dependencies, technologies } from "../types/constants"; import { allIncidentsTables, fileName, reportStoryPoints } from "../views/analysis.view"; import { applications, + dependencySearchInput, incidentCounts, incidentLabels, incidentsLink, @@ -98,4 +100,15 @@ export class PF4Reports { .click(); } } + + validateDependency(appName: string, dependencyFile: string) : void { + clickByText(applications + " > a", appName); + clickPf4ReportTab(dependencies); + cy.wait(10*SEC); + inputText(dependencySearchInput, dependencyFile); + click("tr > td > button"); + cy.get("div.pf-c-description-list__text > a").then(($maven) => { + $maven.attr("target", "_self"); + }).click({force:true}); + } } diff --git a/cypress/e2e/tests/report.test.ts b/cypress/e2e/tests/report.test.ts index a46542d..6a26ade 100644 --- a/cypress/e2e/tests/report.test.ts +++ b/cypress/e2e/tests/report.test.ts @@ -1,6 +1,7 @@ import { getRandomApplicationData, login, trimAppNames } from "../../utils/utils"; import { Analysis } from "../models/analysis"; import { LegacyReport } from "../models/legacyReports"; +import { PF4Reports } from "../models/pf4Reports"; import { Projects } from "../models/projects"; import { completed } from "../types/constants"; @@ -13,6 +14,19 @@ describe(["tier2"], "Report Cases", function () { login(); }); + it(["bug"], "WINDUP-3722: Links to search.maven.org are broken", function () { + let projectData = getRandomApplicationData(this.projectData["Openjdk17"]); + const project = new Projects(projectData); + project.create(); + const analysis = new Analysis("Jakarta_nihil68"); + analysis.runAnalysis(); + analysis.verifyLatestAnalysisStatus(completed); + analysis.openReport(); + const pf4Report = new PF4Reports(); + pf4Report.validateDependency("customers-tomcat-0.0.1-SNAPSHOT.war", "antlr-2.7.7.jar"); + //pf4Report.validateDependency("camunda-bpm-spring-boot-starter-example-war-2.0.0.war", "activation-1.1.jar", "activation-1.1"); + }); + it("Sort Report with Name/Story Points", function () { let projectData = getRandomApplicationData(this.projectData["JakartaEE9"]); const project = new Projects(projectData); diff --git a/cypress/e2e/types/constants.ts b/cypress/e2e/types/constants.ts index a7a863c..a3c4412 100644 --- a/cypress/e2e/types/constants.ts +++ b/cypress/e2e/types/constants.ts @@ -83,3 +83,4 @@ export const systemLabels = "System labels"; //Report constants export const allApps = "All Applications"; export const technologies = "Technologies"; +export const dependencies = "Dependencies"; diff --git a/cypress/e2e/views/pf4reports.view.ts b/cypress/e2e/views/pf4reports.view.ts index d68fb7b..92e1b17 100644 --- a/cypress/e2e/views/pf4reports.view.ts +++ b/cypress/e2e/views/pf4reports.view.ts @@ -4,3 +4,4 @@ export const applications = "td[data-label='Name']"; export const reportTableFilterButtons = "button.pf-c-table__button > div > span"; export const incidentLabels = "span.pf-c-description-list__text"; export const incidentCounts = "div.pf-c-description-list__text"; +export const dependencySearchInput = "input[aria-label='Search input']"; \ No newline at end of file