Skip to content

Commit 198a9cd

Browse files
PrestaEditclaude
andcommitted
Add getDefaultCustomerGroupOptions to BO customer create page
Expose the list of options of the customer form's default group dropdown so campaigns can assert which customer groups are displayed. Used by the PrestaShop core regression test for issue #28977. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 010cde4 commit 198a9cd

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/interfaces/BO/customers/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface BOCustomersCreatePageInterface extends BOBasePagePageInterface
99

1010
createEditB2BCustomer(page: Page, customerData: FakerCustomer): Promise<string>;
1111
createEditCustomer(page: Frame | Page, customerData: FakerCustomer, waitForNavigation?: boolean): Promise<string>;
12+
getDefaultCustomerGroupOptions(page: Frame | Page): Promise<string[]>;
1213
getRequiredInputErrorMessage(page: Frame | Page, input:string): Promise<string>;
1314
enableGuestAccount(page: Frame | Page, guestAccount: boolean): Promise<void>;
1415
isDefaultCustomerGroupDisabled(page: Frame | Page): Promise<boolean>;

src/versions/develop/pages/BO/customers/create.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ class BOCustomersCreatePage extends BOBasePage implements BOCustomersCreatePageI
184184
return this.elementVisible(page, `${this.defaultCustomerGroupSelect}[disabled]`, 2000);
185185
}
186186

187+
/**
188+
* Get the list of options available in the default customer group dropdown
189+
* @param page {Frame|Page} Browser tab
190+
* @return {Promise<string[]>}
191+
*/
192+
async getDefaultCustomerGroupOptions(page: Frame | Page): Promise<string[]> {
193+
return page.locator(`${this.defaultCustomerGroupSelect} option`).allTextContents();
194+
}
195+
187196
/**
188197
* Get required input error message
189198
* @param page {Frame|Page} Browser tab

0 commit comments

Comments
 (0)