diff --git a/cypress/e2e/models/migration/migration-waves/migration-wave.ts b/cypress/e2e/models/migration/migration-waves/migration-wave.ts index 932847b3f..34978da68 100644 --- a/cypress/e2e/models/migration/migration-waves/migration-wave.ts +++ b/cypress/e2e/models/migration/migration-waves/migration-wave.ts @@ -6,6 +6,7 @@ import { inputText, selectItemsPerPage, selectUserPerspective, + submitForm, } from "../../../../utils/utils"; import { createNewButton, @@ -83,7 +84,7 @@ export class MigrationWave { public create() { MigrationWave.openNewForm(); this.fillForm(this); - clickJs(MigrationWaveView.submitButton); + submitForm(); this.setApplications(); } @@ -92,7 +93,7 @@ export class MigrationWave { this.expandActionsMenu(); cy.contains(editAction).click(); this.fillForm(updateValues); - clickJs(MigrationWaveView.submitButton); + submitForm(); } public delete() { @@ -123,7 +124,7 @@ export class MigrationWave { cy.get(MigrationWaveView.issueTypeSelectToggle).click(); cy.contains(issueType).click({ timeout: 10 * SEC, force: true }); - cy.get(submitButton).click(); + submitForm(); } public setApplications(toBeCanceled = false): void { @@ -151,7 +152,7 @@ export class MigrationWave { return; } - cy.get(MigrationWaveView.applicationsSubmitButton).click(); + clickJs(submitButton); } public clearApplications(): void { @@ -167,7 +168,7 @@ export class MigrationWave { cy.contains(manageApplications).click(); cy.get(itemsSelectInsideDialog).click(); cy.contains(button, selectNone).click(); - cy.get(MigrationWaveView.applicationsSubmitButton).click(); + clickJs(submitButton); this.applications = []; } diff --git a/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts b/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts index 1aa7a91de..bc5923e4f 100644 --- a/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts +++ b/cypress/e2e/tests/migration/migration-waves/field_validation.test.ts @@ -17,6 +17,7 @@ limitations under the License. import { checkSuccessAlert, + clickJs, deleteByList, generateRandomDateRange, login, @@ -51,19 +52,19 @@ describe(["@tier1"], "Migration Waves Validations", () => { it("Name validations", function () { const invalidMessage = "Name is invalid. The name must be between 3 and 120 characters"; MigrationWave.openNewForm(); - cy.get(MigrationWaveView.submitButton).should("be.disabled"); + cy.get(commonView.submitButton).should("be.disabled"); validateTooShortInput(MigrationWaveView.nameInput, "body", invalidMessage); validateTooLongInput(MigrationWaveView.nameInput, 121, null, invalidMessage); - cy.get(MigrationWaveView.submitButton).should("be.disabled"); - cy.get(cancelButton).click(); + cy.get(commonView.submitButton).should("be.disabled"); + clickJs(cancelButton); }); it("Dates Validations", function () { MigrationWave.openNewForm(); MigrationWave.fillName(data.getRandomWord(5)); - cy.get(MigrationWaveView.submitButton).should("be.disabled"); + cy.get(commonView.submitButton).should("be.disabled"); const now = new Date(); const options = { year: "numeric", month: "long", day: "numeric" } as const; @@ -94,8 +95,8 @@ describe(["@tier1"], "Migration Waves Validations", () => { ); cy.get(`button[aria-label="${dayAfterTomorrowLabel}"]`).should("be.enabled").click(); - cy.get(MigrationWaveView.submitButton).should("be.enabled"); - cy.get(cancelButton).click(); + cy.get(commonView.submitButton).should("be.enabled"); + clickJs(cancelButton); }); it("Duplicate Migration wave name validation", function () { const migrationWavesList: MigrationWave[] = []; diff --git a/cypress/e2e/views/migration-wave.view.ts b/cypress/e2e/views/migration-wave.view.ts index 634c07dd9..e3949cf2e 100644 --- a/cypress/e2e/views/migration-wave.view.ts +++ b/cypress/e2e/views/migration-wave.view.ts @@ -4,7 +4,6 @@ export enum MigrationWaveView { generalDatePicker = ".pf-v5-c-date-picker", calendarButton = "[aria-label='Toggle date picker']", submitButton = "#migration-wave-form-submit", - applicationsSubmitButton = "#wave-form-submit", nameInput = "#name", startDateInput = "input[aria-label='startDateStr']", endDateInput = "input[aria-label='endDateStr']",