Skip to content

Commit fc56d7a

Browse files
Incorporating changes from 9891
1 parent 4717684 commit fc56d7a

File tree

1 file changed

+42
-84
lines changed

1 file changed

+42
-84
lines changed

cypress/e2e/ui/Services/Requests/service_requests.cy.js

Lines changed: 42 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -226,24 +226,17 @@ describe('Automate Service Requests form operations: Services > Requests', () =>
226226
[FIELD_CONFIG_KEYS.ID]: 'reasonText',
227227
},
228228
]);
229-
// TODO: Replace with validateFormFooterButtons once #9689 is merged
230-
cy.contains(`#main-content button[type="submit"]`, APPLY_BUTTON_TEXT)
231-
.should('be.visible')
232-
.and('be.enabled');
233-
cy.contains(`#main-content button[type="button"]`, RESET_BUTTON_TEXT)
234-
.should('be.visible')
235-
.and('be.enabled');
236-
// cy.validateFormFooterButtons([
237-
// {
238-
// [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: APPLY_BUTTON_TEXT,
239-
// [BUTTON_CONFIG_KEYS.BUTTON_TYPE]: 'submit',
240-
// [BUTTON_CONFIG_KEYS.BUTTON_WRAPPER_CLASS]: 'custom-button-wrapper',
241-
// },
242-
// {
243-
// [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: RESET_BUTTON_TEXT,
244-
// [BUTTON_CONFIG_KEYS.BUTTON_WRAPPER_CLASS]: 'custom-button-wrapper',
245-
// },
246-
// ]);
229+
cy.validateFormFooterButtons([
230+
{
231+
[BUTTON_CONFIG_KEYS.BUTTON_TEXT]: APPLY_BUTTON_TEXT,
232+
[BUTTON_CONFIG_KEYS.BUTTON_TYPE]: 'submit',
233+
[BUTTON_CONFIG_KEYS.BUTTON_WRAPPER_CLASS]: 'custom-button-wrapper',
234+
},
235+
{
236+
[BUTTON_CONFIG_KEYS.BUTTON_TEXT]: RESET_BUTTON_TEXT,
237+
[BUTTON_CONFIG_KEYS.BUTTON_WRAPPER_CLASS]: 'custom-button-wrapper',
238+
},
239+
]);
247240
// TODO: Replace with verify_gtl_no_records_text once #9691 is merged
248241
cy.contains('#miq-gtl-view .no-records-found', 'No records found');
249242
// cy.verify_gtl_no_records_text();
@@ -291,15 +284,10 @@ describe('Automate Service Requests form operations: Services > Requests', () =>
291284
cy.getFormInputFieldByIdAndType({ inputId: 'reasonText' }).type(
292285
'Testing'
293286
);
294-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
295-
cy.contains(
296-
`#main-content button[type="button"]`,
297-
RESET_BUTTON_TEXT
298-
).click();
299-
// cy.getFormFooterButtonByTypeWithText({
300-
// buttonText: RESET_BUTTON_TEXT,
301-
// buttonWrapperClass: 'custom-button-wrapper',
302-
// }).click();
287+
cy.getFormFooterButtonByTypeWithText({
288+
buttonText: RESET_BUTTON_TEXT,
289+
buttonWrapperClass: 'custom-button-wrapper',
290+
}).click();
303291
cy.getFormSelectFieldById({ selectId: 'selectedUser' }).should(
304292
'have.value',
305293
SELECT_OPTION_ALL
@@ -344,84 +332,54 @@ describe('Automate Service Requests form operations: Services > Requests', () =>
344332
inputId: 'approvalStates-approved',
345333
inputType: 'checkbox',
346334
}).should('not.be.checked');
347-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
348-
cy.contains(
349-
`#main-content button[type="submit"]`,
350-
APPLY_BUTTON_TEXT
351-
).click();
352-
// cy.getFormFooterButtonByTypeWithText({
353-
// buttonText: APPLY_BUTTON_TEXT,
354-
// buttonWrapperClass: 'custom-button-wrapper',
355-
// buttonType: 'submit',
356-
// }).click();
335+
cy.getFormFooterButtonByTypeWithText({
336+
buttonText: APPLY_BUTTON_TEXT,
337+
buttonWrapperClass: 'custom-button-wrapper',
338+
buttonType: 'submit',
339+
}).click();
357340
// TODO: Replace with verify_gtl_no_records_text once #9691 is merged
358341
cy.contains('#miq-gtl-view .no-records-found', 'No records found');
359342
// cy.verify_gtl_no_records_text();
360-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
361-
cy.contains(
362-
`#main-content button[type="button"]`,
363-
RESET_BUTTON_TEXT
364-
).click();
365-
// cy.getFormFooterButtonByTypeWithText({
366-
// buttonText: RESET_BUTTON_TEXT,
367-
// buttonWrapperClass: 'custom-button-wrapper',
368-
// }).click();
343+
cy.getFormFooterButtonByTypeWithText({
344+
buttonText: RESET_BUTTON_TEXT,
345+
buttonWrapperClass: 'custom-button-wrapper',
346+
}).click();
369347
cy.gtlGetRows([0]).then((data) => {
370348
expect(data.length).to.equal(1);
371349
});
372350
// Filter data with type
373351
cy.getFormSelectFieldById({ selectId: 'types' }).select(
374352
TYPE_VM_PROVISION
375353
);
376-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
377-
cy.contains(
378-
`#main-content button[type="submit"]`,
379-
APPLY_BUTTON_TEXT
380-
).click();
381-
// cy.getFormFooterButtonByTypeWithText({
382-
// buttonText: APPLY_BUTTON_TEXT,
383-
// buttonWrapperClass: 'custom-button-wrapper',
384-
// buttonType: 'submit',
385-
// }).click();
354+
cy.getFormFooterButtonByTypeWithText({
355+
buttonText: APPLY_BUTTON_TEXT,
356+
buttonWrapperClass: 'custom-button-wrapper',
357+
buttonType: 'submit',
358+
}).click();
386359
// TODO: Replace with verify_gtl_no_records_text once #9691 is merged
387360
cy.contains('#miq-gtl-view .no-records-found', 'No records found');
388361
// cy.verify_gtl_no_records_text();
389-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
390-
cy.contains(
391-
`#main-content button[type="button"]`,
392-
RESET_BUTTON_TEXT
393-
).click();
394-
// cy.getFormFooterButtonByTypeWithText({
395-
// buttonText: RESET_BUTTON_TEXT,
396-
// buttonWrapperClass: 'custom-button-wrapper',
397-
// }).click();
362+
cy.getFormFooterButtonByTypeWithText({
363+
buttonText: RESET_BUTTON_TEXT,
364+
buttonWrapperClass: 'custom-button-wrapper',
365+
}).click();
398366
cy.gtlGetRows([0]).then((data) => {
399367
expect(data.length).to.equal(1);
400368
});
401369
// Filter data with
402370
cy.getFormInputFieldByIdAndType({ inputId: 'reasonText' }).type('r@ndOm');
403-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
404-
cy.contains(
405-
`#main-content button[type="submit"]`,
406-
APPLY_BUTTON_TEXT
407-
).click();
408-
// cy.getFormFooterButtonByTypeWithText({
409-
// buttonText: APPLY_BUTTON_TEXT,
410-
// buttonWrapperClass: 'custom-button-wrapper',
411-
// buttonType: 'submit',
412-
// }).click();
371+
cy.getFormFooterButtonByTypeWithText({
372+
buttonText: APPLY_BUTTON_TEXT,
373+
buttonWrapperClass: 'custom-button-wrapper',
374+
buttonType: 'submit',
375+
}).click();
413376
// TODO: Replace with verify_gtl_no_records_text once #9691 is merged
414377
cy.contains('#miq-gtl-view .no-records-found', 'No records found');
415378
// cy.verify_gtl_no_records_text();
416-
// TODO: Replace with getFormFooterButtonByTypeWithText once #9689 is merged
417-
cy.contains(
418-
`#main-content button[type="button"]`,
419-
RESET_BUTTON_TEXT
420-
).click();
421-
// cy.getFormFooterButtonByTypeWithText({
422-
// buttonText: RESET_BUTTON_TEXT,
423-
// buttonWrapperClass: 'custom-button-wrapper',
424-
// }).click();
379+
cy.getFormFooterButtonByTypeWithText({
380+
buttonText: RESET_BUTTON_TEXT,
381+
buttonWrapperClass: 'custom-button-wrapper',
382+
}).click();
425383
cy.gtlGetRows([0]).then((data) => {
426384
expect(data.length).to.equal(1);
427385
});

0 commit comments

Comments
 (0)