Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] added missing import in reports.ts #694

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ export class Assessment extends Application {
}

click_assess_button(): void {
click(assessAppButton);
performRowActionByIcon(this.name, kebabMenu);
cy.get(commonView.actionMenuItem).contains("Assess").click();
}

perform_assessment(
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/models/migration/reports/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ limitations under the License.
import { selectItemsPerPage } from "../../../../utils/utils";
import { applicationName, button, risk } from "../../../types/constants";
import {
adoptionCandidateDistributionTitle,
articleButton,
articleCard,
articleExpandedContent,
articleHeader,
articleItem,
} from "../../../views/reports.view";

export function selectItemsPerPageinReports(items: number, articleTitle: string): void {
export function selectItemsPerPageInReports(items: number, articleTitle: string): void {
cy.get(articleTitle)
.closest(articleItem)
.within(() => {
Expand All @@ -46,17 +47,17 @@ export function expandArticle(name: string): void {
});
}

export function verifyApplicationRisk(risktype: string, appName: string): void {
export function verifyApplicationRisk(riskType: string, appName: string): void {
// Verifies particular application's risk type
selectItemsPerPageinReports(100, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(100, adoptionCandidateDistributionTitle);
cy.wait(4000);
cy.get(adoptionCandidateDistributionTitle)
.closest(articleItem)
.find("tbody > tr")
.each(($ele) => {
if ($ele.find(`td[data-label="${applicationName}"]`).text() == appName) {
expect($ele.find(`td[data-label="${risk}"]`).text().toLowerCase()).to.equal(
risktype
riskType
);
}
});
Expand Down
14 changes: 7 additions & 7 deletions cypress/e2e/tests/migration/reports/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import * as data from "../../../../utils/data_utils";
import {
expandArticle,
closeArticle,
selectItemsPerPageinReports,
selectItemsPerPageInReports,
} from "../../../models/migration/reports/reports";
import { Stakeholders } from "../../../models/migration/controls/stakeholders";

Expand Down Expand Up @@ -90,7 +90,7 @@ describe(["@tier2"], "Reports filter validations", () => {
cy.wait(3 * SEC);

// Check element filtered for table Adoption Candidate Distribution
selectItemsPerPageinReports(100, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(100, adoptionCandidateDistributionTitle);

// Wait for DOM to render table and sibling elements
cy.get(adoptionCandidateDistributionTitle)
Expand All @@ -104,7 +104,7 @@ describe(["@tier2"], "Reports filter validations", () => {
expandArticle(identiFiedRisks);
cy.wait(2 * SEC);

selectItemsPerPageinReports(100, identiFiedRisksTitle);
selectItemsPerPageInReports(100, identiFiedRisksTitle);

let applicationsData = getTableColumnData("Application(s)");
cy.wrap(applicationsData).each((application) => {
Expand Down Expand Up @@ -151,7 +151,7 @@ describe(["@tier2"], "Reports filter validations", () => {
expandArticle(identiFiedRisks);
cy.wait(2 * SEC);

selectItemsPerPageinReports(100, identiFiedRisksTitle);
selectItemsPerPageInReports(100, identiFiedRisksTitle);

applySearchFilter(name, validSearchInput, true, 1);
cy.wait(3 * SEC);
Expand Down Expand Up @@ -197,7 +197,7 @@ describe(["@tier2"], "Reports filter validations", () => {
expandArticle(identiFiedRisks);
cy.wait(2 * SEC);

selectItemsPerPageinReports(100, identiFiedRisksTitle);
selectItemsPerPageInReports(100, identiFiedRisksTitle);

// Get a category of assessment questions and apply it as search filter
let categoryString = "Application details";
Expand Down Expand Up @@ -247,7 +247,7 @@ describe(["@tier2"], "Reports filter validations", () => {
expandArticle(identiFiedRisks);
cy.wait(2 * SEC);

selectItemsPerPageinReports(100, identiFiedRisksTitle);
selectItemsPerPageInReports(100, identiFiedRisksTitle);

// Get a question from assessment question's list and apply it as search filter
let questionString = "How is the application tested?";
Expand Down Expand Up @@ -296,7 +296,7 @@ describe(["@tier2"], "Reports filter validations", () => {
expandArticle(identiFiedRisks);
cy.wait(2 * SEC);

selectItemsPerPageinReports(100, identiFiedRisksTitle);
selectItemsPerPageInReports(100, identiFiedRisksTitle);

// select an answer input from existing answers and apply it as search filter
let answerString = "Not tracked";
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/tests/migration/reports/pagination.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { migration, reports, SEC } from "../../../types/constants";
import { Assessment } from "../../../models/migration/applicationinventory/assessment";
import {
expandArticle,
selectItemsPerPageinReports,
selectItemsPerPageInReports,
} from "../../../models/migration/reports/reports";
import { Stakeholders } from "../../../models/migration/controls/stakeholders";
import * as commonView from "../../../views/common.view";
Expand Down Expand Up @@ -69,7 +69,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

// select 10 items per page
selectItemsPerPageinReports(10, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(10, adoptionCandidateDistributionTitle);

// Verify next buttons are enabled as there are more than 11 rows present
cy.get(commonView.nextPageButton).each(($nextBtn) => {
Expand Down Expand Up @@ -106,7 +106,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

// Select 10 items per page
selectItemsPerPageinReports(10, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(10, adoptionCandidateDistributionTitle);
cy.wait(2 * SEC);

// Verify that only 10 items are displayed
Expand All @@ -115,7 +115,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
});

// Select 20 items per page
selectItemsPerPageinReports(20, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(20, adoptionCandidateDistributionTitle);
cy.wait(2 * SEC);

// Verify that items less than or equal to 20 and greater than 10 are displayed
Expand All @@ -131,7 +131,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

// Select 10 items per page
selectItemsPerPageinReports(10, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(10, adoptionCandidateDistributionTitle);
cy.wait(2 * SEC);

// Go to page number 2
Expand All @@ -154,7 +154,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

// select 10 items per page
selectItemsPerPageinReports(10, identiFiedRisksTitle);
selectItemsPerPageInReports(10, identiFiedRisksTitle);

// Verify next buttons are enabled as there are more than 11 rows present
cy.get(commonView.nextPageButton).eq(2).should("not.be.disabled");
Expand Down Expand Up @@ -192,7 +192,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(2 * SEC);

// Select 10 items per page
selectItemsPerPageinReports(10, identiFiedRisksTitle);
selectItemsPerPageInReports(10, identiFiedRisksTitle);
cy.wait(2 * SEC);

// Verify that only 10 items are displayed
Expand All @@ -201,7 +201,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
});

// Select 20 items per page
selectItemsPerPageinReports(20, identiFiedRisksTitle);
selectItemsPerPageInReports(20, identiFiedRisksTitle);
cy.wait(2 * SEC);

// Verify that items less than or equal to 20 and greater than 10 are displayed
Expand All @@ -221,7 +221,7 @@ describe(["@tier3"], "Reports pagination validations", () => {
cy.wait(2 * SEC);

// Select 10 items per page
selectItemsPerPageinReports(10, identiFiedRisksTitle);
selectItemsPerPageInReports(10, identiFiedRisksTitle);
cy.wait(2 * SEC);

// Go to page number 2
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const southboundHelper = "div[id=southbound-dependencies-helper]";
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 kebabMenu = "button[aria-label='kebab dropdown toggle']";
export const topKebabMenu = "div > button[aria-label='Actions']";
export const kebabMenuItem = "a.pf-v5-c-dropdown__menu-item";

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/views/common.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const selectFilter = "div.pf-m-toggle-group.pf-m-filter-group.pf-m-show";
export const itemsSelectInsideDialog = "div[role='dialog'] button[aria-label='Select']";
export const nameHelperBusiness = "#business-service-name-helper";
export const nameHelperStakeholderGroup = "#-helper";
export const actionMenuItem = "span.pf-v5-c-menu__item-text";
export const kebabMenuItem = "a.pf-c-dropdown__menu-item";
export const commonTable = "table[aria-label='main-table']";
export const dropdownClearSelection = "pf-v5-c-select__toggle-clear";