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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly : Fixed campaigns/productV2/functional/22_* #34240

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions tests/UI/pages/BO/catalog/productsV2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class Products extends BOBasePage {

private readonly modalBulkActionsProductsProgressBarDone: string;

private readonly modalBulkActionsProductsStopProcessButton: (action: string) => string;

private readonly modalBulkActionsProductsCloseButton: (action: string) => string;

private readonly productGridTable: string;
Expand Down Expand Up @@ -241,6 +243,8 @@ class Products extends BOBasePage {
this.modalBulkActionsProductsProgressFooter = (action: string) => `${this.modalBulkActionsProductsProgress(action)} `
+ 'div.modal-footer';
this.modalBulkActionsProductsProgressBarDone = '#modal_progressbar_done';
this.modalBulkActionsProductsStopProcessButton = (action: string) => `${this.modalBulkActionsProductsProgressFooter(action)} `
+ 'button.stop-processing';
this.modalBulkActionsProductsCloseButton = (action: string) => `${this.modalBulkActionsProductsProgressFooter(action)} `
+ 'button.close-modal-button';

Expand Down Expand Up @@ -464,15 +468,14 @@ class Products extends BOBasePage {
* @returns {Promise<string>}
*/
async bulkActionsProduct(page: Page, action: string): Promise<string> {
const modalDialogBulkActionButton = this.modalDialogBulkActionButton(
(action === 'enable' || action === 'disable') ? `${action}_selection` : `bulk_${action}`,
);
const modalBulkActionsProgressSuccessMessage = this.modalBulkActionsProgressSuccessMessage(
(action === 'enable' || action === 'disable') ? `${action}_selection` : `bulk_${action}`,
);
const actionSelector: string = (action === 'enable' || action === 'disable') ? `${action}_selection` : `bulk_${action}`;

const modalDialogBulkActionButton = this.modalDialogBulkActionButton(actionSelector);
const modalBulkActionsProgressSuccessMessage = this.modalBulkActionsProgressSuccessMessage(actionSelector);

await this.waitForSelectorAndClick(page, modalDialogBulkActionButton);
await this.waitForVisibleSelector(page, this.modalBulkActionsProductsProgressBarDone);
await page.waitForTimeout(2000);
await this.waitForHiddenSelector(page, this.modalBulkActionsProductsStopProcessButton(actionSelector), 5000);

return this.getTextContent(page, modalBulkActionsProgressSuccessMessage, true);
}
Expand Down