Skip to content

Commit 65c1378

Browse files
authored
Merge pull request #237 from Progi1984/boProductsCreateTabDetailsPage
Migrate `@pages/BO/catalog/products/add/pricingTab` from Core
2 parents be9615e + 12e94b6 commit 65c1378

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

src/data/types/product.ts

+21
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,25 @@ type ProductFilterMinMax = {
175175
max: number
176176
}
177177

178+
type ProductPricingCatalogPriceRule = {
179+
id: string
180+
name: string
181+
currency: string
182+
country: string
183+
group: string
184+
store: string
185+
discount: string
186+
fromQuantity: number
187+
}
188+
189+
type ProductPricingSummary = {
190+
priceTaxExcludedValue: string
191+
priceTaxIncludedValue: string
192+
marginValue: string
193+
marginRateValue: string
194+
wholesalePriceValue: string
195+
}
196+
178197
type ProductHeaderSummary = {
179198
imageUrl: string
180199
reference: string
@@ -274,6 +293,8 @@ export type {
274293
ProductPackItem,
275294
ProductPackInformation,
276295
ProductPackOptions,
296+
ProductPricingSummary,
297+
ProductPricingCatalogPriceRule,
277298
ProductReviewCreator,
278299
ProductSpecificPrice,
279300
ProductStockMovement,

src/interfaces/BO/catalog/products/create/tabPricing.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {BOBasePagePageInterface} from '@interfaces/BO';
33
import type {Page} from '@playwright/test';
44

55
import FakerProduct from '@data/faker/product';
6-
import type {ProductSpecificPrice} from '@data/types/product';
6+
import type {ProductPricingCatalogPriceRule, ProductPricingSummary, ProductSpecificPrice} from '@data/types/product';
77

88
export interface BOProductsCreateTabPricingPageInterface extends BOBasePagePageInterface {
99
addEcoTax(page: Page, ecoTax: number): Promise<void>
@@ -13,8 +13,8 @@ export interface BOProductsCreateTabPricingPageInterface extends BOBasePagePageI
1313
clickOnManageCatalogPriceRuleLink(page: Page): Promise<Page>
1414
clickOnShowCatalogPriceRuleButton(page: Page): Promise<void>;
1515
deleteSpecificPrice(page: Page, row: number): Promise<string|null>;
16-
getCatalogPriceRuleData(page: Page, row: number) :Promise<object>
17-
getSummary(page: Page): Promise<object>;
16+
getCatalogPriceRuleData(page: Page, row: number) :Promise<ProductPricingCatalogPriceRule>
17+
getSummary(page: Page): Promise<ProductPricingSummary>;
1818
getUnitPriceValue(page: Page): Promise<string>;
1919
getValue(page: Page, inputName: string): Promise<string>
2020
setCostPrice(page: Page, costPrice: number): Promise<void>;

src/versions/develop/pages/BO/catalog/products/create/tabPricing.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import BOBasePage from '@pages/BO/BOBasePage';
22

33
import FakerProduct from '@data/faker/product';
4-
import type {ProductSpecificPrice} from '@data/types/product';
4+
import type {ProductPricingCatalogPriceRule, ProductPricingSummary, ProductSpecificPrice} from '@data/types/product';
55
import type {BOProductsCreateTabPricingPageInterface} from '@interfaces/BO/catalog/products/create/tabPricing';
66

77
import type {Page} from 'playwright';
@@ -265,18 +265,18 @@ class PricingTab extends BOBasePage implements BOProductsCreateTabPricingPageInt
265265
}
266266

267267
/**
268-
* Get summary
269-
* @param page {Page} Browser tab
270-
* @returns {Promise<object>}
271-
*/
272-
async getSummary(page: Page): Promise<object> {
268+
* Get summary
269+
* @param page {Page} Browser tab
270+
* @returns {Promise<ProductPricingSummary>}
271+
*/
272+
async getSummary(page: Page): Promise<ProductPricingSummary> {
273273
await this.waitForSelectorAndClick(page, this.pricingTabLink);
274274
return {
275275
priceTaxExcludedValue: await this.getTextContent(page, this.priceTaxExcludedValue),
276276
priceTaxIncludedValue: await this.getTextContent(page, this.priceTaxIncludedValue),
277277
marginValue: await this.getTextContent(page, this.marginValue),
278278
marginRateValue: await this.getTextContent(page, this.marginRateValue),
279-
WholesalePriceValue: await this.getTextContent(page, this.wholeSalePriceValue),
279+
wholesalePriceValue: await this.getTextContent(page, this.wholeSalePriceValue),
280280
};
281281
}
282282

@@ -404,7 +404,7 @@ class PricingTab extends BOBasePage implements BOProductsCreateTabPricingPageInt
404404
* @param page {Page} Browser tab
405405
* @param row {number} Row of catalog price rule
406406
*/
407-
async getCatalogPriceRuleData(page: Page, row: number) :Promise<object> {
407+
async getCatalogPriceRuleData(page: Page, row: number): Promise<ProductPricingCatalogPriceRule> {
408408
return {
409409
id: await this.getTextContent(page, this.catalogPriceRuleRowColumn(row, 'catalog-price-rule-id')),
410410
name: await this.getTextContent(page, this.catalogPriceRuleRowColumn(row, 'name')),

0 commit comments

Comments
 (0)