Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/interfaces/BO/shipping/carriers/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export interface BOCarriersCreatePageInterface extends BOBasePagePageInterface {
readonly pageTitleEdit: string;

createEditCarrier(page: Page, carrierData: FakerCarrier): Promise<string>;
getBillingSelection(page: Page): Promise<string>;
}
21 changes: 21 additions & 0 deletions src/versions/develop/pages/BO/shipping/carriers/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,27 @@ class BOCarriersCreatePage extends BOBasePage implements BOCarriersCreatePageInt

/* Methods */

/**
* Get the billing option currently selected in the shipping locations and costs tab
* @param page {Page} Browser tab
* @return {Promise<string>}
*/
async getBillingSelection(page: Page): Promise<string> {
await page.locator(this.tabShippingSettings).click();

if (await page.locator(this.billingConfigRadioButton).isChecked()) {
return 'Based on the shop configuration';
}
if (await page.locator(this.billingPriceRadioButton).isChecked()) {
return 'According to total price';
}
if (await page.locator(this.billingWeightButton).isChecked()) {
return 'According to total weight';
}

return '';
}

/**
* Fill carrier form in create or edit page and save
* @param page {Page} Browser tab
Expand Down
Loading