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] Fix Review tests #751

Merged
merged 2 commits into from
Oct 18, 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 @@ -64,6 +64,7 @@ import {
doesExistSelector,
doesExistText,
clickTab,
clickItemInKebabMenu,
} from "../../../../utils/utils";
import { applicationData, RbacValidationRules } from "../../../types/types";
import { kebabButton, rightSideMenu, sourceDropdown } from "../../../views/analysis.view";
Expand Down Expand Up @@ -258,8 +259,7 @@ export class Application {

delete(cancel = false): void {
cy.wait(2000);
performRowActionByIcon(this.name, kebabMenu);
clickByText(button, deleteAction);
clickItemInKebabMenu(this.name, "Delete");
if (cancel) {
cancelForm();
} else {
Expand Down
12 changes: 4 additions & 8 deletions cypress/e2e/models/migration/applicationinventory/assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
performRowActionByIcon,
checkSuccessAlert,
clickJs,
clickItemInKebabMenu,
} from "../../../../utils/utils";
import * as data from "../../../../utils/data_utils";
import {
Expand Down Expand Up @@ -228,11 +229,6 @@ export class Assessment extends Application {
super.delete();
}

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

take_questionnaire(): void {
clickByText(button, "Take");
}
Expand All @@ -251,7 +247,7 @@ export class Assessment extends Application {
Assessment.open();
selectItemsPerPage(100);
this.selectApplication();
this.click_assess_button();
clickItemInKebabMenu(this.name, "Assess");
cy.wait(6000);
this.take_questionnaire();
cy.wait(SEC);
Expand All @@ -267,7 +263,7 @@ export class Assessment extends Application {
Assessment.open();
selectItemsPerPage(100);
this.selectApplication();
clickByText(button, review);
clickItemInKebabMenu(this.name, "Review");
cy.wait(8 * SEC);
this.selectMigrationAction(risk);
this.selectEffortEstimate(risk);
Expand All @@ -279,6 +275,7 @@ export class Assessment extends Application {

// Method to verify the status of Assessment and Review
verifyStatus(column, status): void {
Assessment.open();
let columnSelector: string;

if (column === "assessment") columnSelector = assessmentColumnSelector;
Expand All @@ -287,7 +284,6 @@ export class Assessment extends Application {
selectItemsPerPage(100);
cy.get(tdTag)
.contains(this.name)
.parent(tdTag)
.parent(trTag)
.within(() => {
cy.get(columnSelector).contains(status, { timeout: 15000 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe(["@tier2"], "Operations after application import", () => {
before("Login and create test data", function () {
login();

// Navigate to stakeholders control tab and create new stakeholder
const stakeholder = new Stakeholders(data.getEmail(), data.getFullName());
stakeholder.create();
cy.wait(2000);
Expand All @@ -56,8 +55,8 @@ describe(["@tier2"], "Operations after application import", () => {
exists("Gateway");
});

it(
"Perform application assessment after a successful application import",
it.skip(
"Bug MTA-1425:Perform application assessment after a successful application import",
{ tags: "@dc" },
function () {
const application = new Assessment(appdata);
Expand All @@ -70,7 +69,7 @@ describe(["@tier2"], "Operations after application import", () => {
);

it("Perform application review after a successful application import", function () {
// Automates https://polarion.engineering.redhat.com/polarion/redirect/project/MTAPathfinder/workitem?id=MTA-295
// Automates Polarion TC MTA-295
const application = new Assessment(appdata);

// Perform application review
Expand Down
6 changes: 6 additions & 0 deletions cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
createEntitiesCheckbox,
sideKebabMenuImports,
appImportForm,
kebabMenu,
} from "../e2e/views/applicationinventory.view";
import {
closeSuccessNotification,
Expand Down Expand Up @@ -903,6 +904,11 @@ export function performRowActionByIcon(itemName: string, action: string): void {
});
}

export function clickItemInKebabMenu(rowItem, itemName: string): void {
performRowActionByIcon(rowItem, kebabMenu);
cy.get(commonView.actionMenuItem).contains(itemName).click();
}

export function createMultipleJiraConnections(
numberOfJiras: number,
jiraCredential: JiraCredentials,
Expand Down