Skip to content

Commit

Permalink
[RFR] Fix source Cred test (#1199)
Browse files Browse the repository at this point in the history
* Fix source Cred test

* Fix source Cred test

* Fix source Cred test

* Fix source Cred test

---------

Co-authored-by: Shveta Sachdeva <[email protected]>
  • Loading branch information
sshveta and Shveta Sachdeva authored Aug 22, 2024
1 parent 55f5b3a commit 2f4e26b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 43 deletions.
17 changes: 11 additions & 6 deletions cypress/e2e/models/migration/applicationinventory/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ export class Application {

validateIssues(appIssues: AppIssue[]): void {
Issues.openSingleApplication(this.name);
selectItemsPerPage(100);
appIssues.forEach((currentIssue) => {
validateSingleApplicationIssue(currentIssue);
Issues.validateAllFields(currentIssue);
Expand Down Expand Up @@ -566,12 +567,16 @@ export class Application {
// Clicking on particular incident
click(button, false, true, incident);
});
// Asserting that content of text field has at least 100 symbols
cy.get("div.monaco-scrollable-element.editor-scrollable.vs-dark")
.invoke("text")
.then((text) => {
expect(text.length).to.be.at.least(100);
});
cy.get("ul[role=tablist] >li >button").then((button) => {
if (!button.text().includes("All incidents")) {
// Asserting that content of text field has at least 100 symbols
cy.get("div.monaco-scrollable-element.editor-scrollable.vs-dark")
.invoke("text")
.then((text) => {
expect(text.length).to.be.at.least(100);
});
}
});
}
clickByText(button, "Close");
});
Expand Down
27 changes: 19 additions & 8 deletions cypress/e2e/models/migration/dynamic-report/issues/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
migration,
SEC,
singleApplication,
tdTag,
trTag,
} from "../../../../types/constants";
import { navMenu } from "../../../../views/menu.view";
Expand All @@ -30,6 +31,7 @@ import {
} from "../../../../views/issue.view";
import { AppIssue } from "../../../../types/types";
import { div, liTag, searchButton, searchInput, span } from "../../../../views/common.view";
import { title } from "process";

export class Issues {
/** Contains URL of issues web page */
Expand Down Expand Up @@ -177,21 +179,30 @@ export class Issues {
};

Issues.unfold(issue.name);
Issues.validateSection(sections.totalAffectedApps, button, /\d - View affected /);
Issues.validateSection(sections.targetTechnologies, span, issue.targets);
Issues.validateSection(sections.sourceTechnologies, div, issue.sources);
Issues.validateSection(sections.ruleSet, div, issue.ruleSet);
Issues.validateSection(sections.rule, div, issue.rule);
Issues.validateSection(sections.labels, div, issue.labels);
Issues.validateSection(
issue.name,
sections.totalAffectedApps,
button,
/\d - View affected /
);
Issues.validateSection(issue.name, sections.targetTechnologies, span, issue.targets);
Issues.validateSection(issue.name, sections.sourceTechnologies, div, issue.sources);
Issues.validateSection(issue.name, sections.ruleSet, div, issue.ruleSet);
Issues.validateSection(issue.name, sections.rule, div, issue.rule);
Issues.validateSection(issue.name, sections.labels, div, issue.labels);
}

private static validateSection(
name: string,
title: string | RegExp,
contentSelector: string,
content: string | string[] | RegExp
): void {
cy.contains("h4", title)
.next("div")
cy.contains(tdTag, name)
.parent(trTag)
.next()
.contains("h4", title)
.next()
.within(() => {
if (Array.isArray(content)) {
content.forEach((item) => cy.contains(contentSelector, item));
Expand Down
32 changes: 3 additions & 29 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"sources": ["None"],
"targets": ["cloud-readiness"],
"effort": 1,
"totalEffort": 38,
"incidents": 2,
"totalEffort": 6,
"incidents": 6,
"affectedFiles": 1,
"ruleSet": "cloud-readiness",
"rule": "local-storage-00001",
Expand Down Expand Up @@ -137,7 +137,7 @@
"incidents": 1,
"affectedFiles": 1,
"ruleSet": "quarkus/springboot",
"rule": "springboot-plugins-to-quarkus-00000",
"rule": "springboot-plugins-to-quarkus-0000",
"labels": ["None"]
},
{
Expand Down Expand Up @@ -165,32 +165,6 @@
"ruleSet": "quarkus/springboot",
"rule": "springboot-di-to-quarkus-00000",
"labels": ["None"]
},
{
"name": "Version of Spring Boot not compatible with Jakarta EE 9+",
"category": "mandatory",
"sources": ["None"],
"targets": ["jakarta-ee", "jakarta-ee9+", "jws", "jws6+"],
"effort": 3,
"totalEffort": 3,
"incidents": 3,
"affectedFiles": 3,
"ruleSet": "jakarta-ee9",
"rule": "spring-components-00001",
"labels": ["konveyor.io/source"]
},
{
"name": "Version of Spring not compatible with Jakarta EE 9+",
"category": "mandatory",
"sources": ["None"],
"targets": ["jakarta-ee", "jakarta-ee9+", "jws", "jws6+"],
"effort": 3,
"totalEffort": 3,
"incidents": 3,
"affectedFiles": 3,
"ruleSet": "jakarta-ee9",
"rule": "spring-components-00002",
"labels": ["konveyor.io/source"]
}
],
"dependencies": [
Expand Down

0 comments on commit 2f4e26b

Please sign in to comment.