Skip to content

Commit

Permalink
Merge pull request #125 from Progi1984/boCustomersPage
Browse files Browse the repository at this point in the history
Migrate `@pages/BO/customers` from Core
  • Loading branch information
Progi1984 authored Sep 6, 2024
2 parents a72aef0 + 8a287e8 commit 308f64a
Show file tree
Hide file tree
Showing 4 changed files with 719 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export {default as boCustomerGroupsPage} from '@pages/BO/shopParameters/customer
export {default as boCustomerGroupsCreatePage} from '@pages/BO/shopParameters/customerSettings/groups/create';
export {default as boCurrenciesCreatePage} from '@pages/BO/international/localization/currencies/create';
export {default as boCurrenciesPage} from '@pages/BO/international/localization/currencies';
export {default as boCustomersPage} from '@pages/BO/customers';
export {default as boDashboardPage} from '@pages/BO/dashboard';
export {default as boDesignPositionsPage} from '@pages/BO/design/positions/index';
export {default as boDesignPositionsHookModulePage} from '@pages/BO/design/positions/hookModule';
Expand Down
36 changes: 36 additions & 0 deletions src/interfaces/BO/customers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {BOBasePagePageInterface} from '@interfaces/BO';
import {type Page} from '@playwright/test';

export interface BOCustomersPageInterface extends BOBasePagePageInterface {
readonly pageTitle: string;
readonly successfulUpdateStatusMessage: string;

bulkSetStatus(page: Page, enable?: boolean): Promise<string>;
deleteCustomer(page: Page, row: number, allowRegistrationAfterDelete?: boolean): Promise<string>;
deleteCustomersBulkActions(page: Page, allowRegistrationAfterDelete?: boolean): Promise<string>;
exportDataToCsv(page: Page): Promise<string | null>;
filterCustomers(page: Page, filterType: string, filterBy: string, value?: string): Promise<void>;
filterCustomersByRegistration(page: Page, dateFrom: string, dateTo: string): Promise<void>;
filterCustomersSwitch(page: Page, filterBy: string, value: string): Promise<void>;
getAllRowsColumnContent(page: Page, column: string): Promise<string[]>;
getCustomerInCsvFormat(page: Page, row: number): Promise<string>;
getCustomerStatus(page: Page, row: number): Promise<boolean>;
getNewsletterStatus(page: Page, row: number): Promise<boolean>;
getNumberOfElementInGrid(page: Page): Promise<number>;
getPartnerOffersStatus(page: Page, row: number): Promise<boolean>;
getTextColumnFromTableCustomers(page: Page, row: number, column: string): Promise<string>;
getTextWhenTableIsEmpty(page: Page): Promise<string>;
goToAddNewCustomerPage(page: Page): Promise<void>;
goToEditCustomerPage(page: Page, row: number): Promise<void>;
goToViewCustomerPage(page: Page, row: number): Promise<void>;
paginationNext(page: Page): Promise<string>;
paginationPrevious(page: Page): Promise<string>;
resetAndGetNumberOfLines(page: Page): Promise<number>;
resetFilter(page: Page): Promise<void>;
selectPaginationLimit(page: Page, number: number): Promise<string>;
setCustomerStatus(page: Page, row: number, valueWanted?: boolean): Promise<string | null | false>;
setNewsletterStatus(page: Page, row: number, valueWanted?: boolean): Promise<string | null | false>;
setPartnerOffersStatus(page: Page, row: number, valueWanted?: boolean): Promise<string | null | false>;
setRequiredFields(page: Page, id: number, valueWanted?: boolean): Promise<string>;
sortTable(page: Page, sortBy: string, sortDirection: string): Promise<void>;
}
9 changes: 9 additions & 0 deletions src/pages/BO/customers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {type BOCustomersPageInterface} from '@interfaces/BO/customers';

/* eslint-disable global-require, @typescript-eslint/no-var-requires */
function requirePage(): BOCustomersPageInterface {
return require('@versions/develop/pages/BO/customers');
}
/* eslint-enable global-require, @typescript-eslint/no-var-requires */

export default requirePage();
Loading

0 comments on commit 308f64a

Please sign in to comment.