Skip to content

Commit

Permalink
Fix Report Tab test (#836)
Browse files Browse the repository at this point in the history
Signed-off-by: Shveta Sachdeva <[email protected]>
Co-authored-by: Shveta Sachdeva <[email protected]>
  • Loading branch information
sshveta and Shveta Sachdeva authored Nov 27, 2023
1 parent cf2ddd3 commit e48eddb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/models/migration/reports/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
import { selectItemsPerPage } from "../../../../utils/utils";
import { applicationName, button, risk } from "../../../types/constants";
import {
adoptionCandidateDistributionTitle,
applicationConfidenceandRiskTitle,
articleButton,
articleCard,
articleExpandedContent,
Expand Down Expand Up @@ -49,9 +49,9 @@ export function expandArticle(name: string): void {

export function verifyApplicationRisk(riskType: string, appName: string): void {
// Verifies particular application's risk type
selectItemsPerPageInReports(100, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(100, applicationConfidenceandRiskTitle);
cy.wait(4000);
cy.get(adoptionCandidateDistributionTitle)
cy.get(applicationConfidenceandRiskTitle)
.closest(articleItem)
.find("tbody > tr")
.each(($ele) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe(["@tier2"], "Application risks tests", () => {
let riskType = ["low", "medium", "high"];

before("Login and Create Test Data", function () {
// Perform login
login();

stakeholdersList = createMultipleStakeholders(1);
Expand All @@ -52,8 +51,7 @@ describe(["@tier2"], "Application risks tests", () => {
}
});

it.skip("Bug MTA-1345: Application risk validation", function () {
// Navigate to reports page
it("Bug MTA-1746: Application risk validation", function () {
selectUserPerspective(migration);
clickByText(navMenu, reports);
cy.wait(3 * SEC);
Expand All @@ -64,7 +62,6 @@ describe(["@tier2"], "Application risks tests", () => {
});

after("Perform test data clean up", function () {
// Delete the stakeholders and applications created before the tests
deleteByList(stakeholdersList);
deleteByList(applicationsList);
});
Expand Down
9 changes: 4 additions & 5 deletions cypress/e2e/tests/migration/reports/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
tdTag,
} from "../../../types/constants";
import {
adoptionCandidateDistributionTitle,
applicationConfidenceandRiskTitle,
articleBody,
articleCard,
identiFiedRisksTitle,
Expand All @@ -61,7 +61,6 @@ let stakeholdersList: Array<Stakeholders> = [];
let invalidSearchInput = String(data.getRandomNumber());

describe.skip(["@tier2"], "Reports filter validations", () => {
/*
before("Login and create test data", function () {
// Perform login
login();
Expand All @@ -76,7 +75,7 @@ describe.skip(["@tier2"], "Reports filter validations", () => {
// Perform application review
applicationsList[0].perform_review("high");
applicationsList[0].verifyStatus("review", "Completed");
});*/
});

it("Bug MTA-1345: Name field validations", function () {
// Navigate to reports
Expand All @@ -91,10 +90,10 @@ describe.skip(["@tier2"], "Reports filter validations", () => {
cy.wait(3 * SEC);

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

// Wait for DOM to render table and sibling elements
cy.get(adoptionCandidateDistributionTitle)
cy.get(applicationConfidenceandRiskTitle)
.closest(articleCard)
.find(articleBody)
.should("not.have.class", "pf-v5-c-empty-state")
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/tests/migration/reports/pagination.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { Stakeholders } from "../../../models/migration/controls/stakeholders";
import * as commonView from "../../../views/common.view";
import {
adoptionCandidateDistributionTitle,
applicationConfidenceandRiskTitle,
identiFiedRisksTitle,
} from "../../../views/reports.view";

Expand Down Expand Up @@ -69,7 +69,7 @@ describe.skip(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

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

// 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.skip(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

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

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

// Select 20 items per page
selectItemsPerPageInReports(20, adoptionCandidateDistributionTitle);
selectItemsPerPageInReports(20, applicationConfidenceandRiskTitle);
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.skip(["@tier3"], "Reports pagination validations", () => {
cy.wait(3 * SEC);

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

// Go to page number 2
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/views/reports.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

export const adoptionCandidateDistributionTitle = 'h3:contains("Adoption candidate distribution")';
export const applicationConfidenceandRiskTitle = 'h3:contains("Application confidence and risk")';
export const articleItem = "div.pf-v5-l-stack__item";
export const articleCard = "div.pf-v5-c-card";
export const articleHeader = "div.pf-v5-c-card__header";
Expand Down

0 comments on commit e48eddb

Please sign in to comment.