|
1 | 1 | import BOBasePage from '@pages/BO/BOBasePage';
|
2 |
| -import createProductPage from '@pages/BO/catalog/products/create'; |
| 2 | +import boProductsCreatePage from '@pages/BO/catalog/products/create'; |
3 | 3 |
|
4 | 4 | // Import data
|
5 | 5 | import type FakerProduct from '@data/faker/product';
|
@@ -176,6 +176,7 @@ class DetailsTab extends BOBasePage implements BOProductsCreateTabDetailsPageInt
|
176 | 176 | async setProductDetails(page: Page, productData: FakerProduct): Promise<void> {
|
177 | 177 | await this.waitForSelectorAndClick(page, this.detailsTabLink);
|
178 | 178 | await this.setValue(page, this.productReferenceInput, productData.reference);
|
| 179 | + await this.setCondition(page, productData); |
179 | 180 | }
|
180 | 181 |
|
181 | 182 | /**
|
@@ -225,7 +226,7 @@ class DetailsTab extends BOBasePage implements BOProductsCreateTabDetailsPageInt
|
225 | 226 | * @returns {Promise<string>}
|
226 | 227 | */
|
227 | 228 | async getErrorMessageInReferencesForm(page: Page, inputNumber: number): Promise<string> {
|
228 |
| - await createProductPage.clickOnSaveProductButton(page); |
| 229 | + await boProductsCreatePage.clickOnSaveProductButton(page); |
229 | 230 |
|
230 | 231 | return this.getTextContent(page, this.referenceFormErrorMessage(inputNumber));
|
231 | 232 | }
|
@@ -361,7 +362,9 @@ class DetailsTab extends BOBasePage implements BOProductsCreateTabDetailsPageInt
|
361 | 362 | */
|
362 | 363 | async setCondition(page: Page, productData: FakerProduct): Promise<void> {
|
363 | 364 | await this.setChecked(page, this.displayCondition(productData.displayCondition ? 1 : 0));
|
364 |
| - await this.selectByVisibleText(page, this.productConditionSelect, productData.condition); |
| 365 | + if (productData.displayCondition === true) { |
| 366 | + await this.selectByVisibleText(page, this.productConditionSelect, productData.condition); |
| 367 | + } |
365 | 368 | }
|
366 | 369 |
|
367 | 370 | /**
|
|
0 commit comments