Skip to content

Commit

Permalink
Fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
nesrineabdmouleh committed Oct 5, 2023
1 parent 8f79478 commit 660d1f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/UI/campaigns/productV2/functional/18_seoTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe('BO - Catalog - Products : Seo tab', async () => {
await seoTab.setMetaTitle(page, editProductData.metaTitle!);
await seoTab.setMetaDescription(page, editProductData.metaDescription!);
await seoTab.setFriendlyUrl(page, editProductData.friendlyUrl!);
await createProductPage.clickOnSaveProductButton(page);

const errorMessage = await seoTab.getErrorMessageOfFriendlyUrl(page);
expect(errorMessage).to.eq('"lorem ipsum" is invalid - Language: English (English)');
Expand Down
11 changes: 10 additions & 1 deletion tests/UI/pages/BO/catalog/productsV2/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class CreateProduct extends BOBasePage {
// Modal : Switch Product Type
this.modalSwitchType = '#switch-product-type-modal';
this.modalSwitchTypeBtnChoice = (productType: string) => `${this.modalSwitchType} button.product-type-choice`
+ `[data-value="${productType}"]`;
+ `[data-value="${productType}"]`;
this.modalSwitchTypeBtnSubmit = `${this.modalSwitchType} .modal-footer button.btn-confirm-submit`;
this.modalConfirmType = '#modal-confirm-product-type';
this.modalConfirmTypeBtnSubmit = `${this.modalConfirmType} .modal-footer button.btn-confirm-submit`;
Expand Down Expand Up @@ -341,6 +341,15 @@ class CreateProduct extends BOBasePage {
await this.setValue(page, this.productNameInput(locale), name);
}

/**
* Click on save product button
* @param page {Page} Browser tab
* @returns {Promise<void>}
*/
async clickOnSaveProductButton(page: Page): Promise<void> {
await this.clickAndWaitForLoadState(page, this.saveProductButton);
}

/**
* Save product
* @param page {Page} Browser tab
Expand Down
3 changes: 0 additions & 3 deletions tests/UI/pages/BO/catalog/productsV2/add/seoTab.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Import pages
import BOBasePage from '@pages/BO/BObasePage';
import createProductPage from '@pages/BO/catalog/productsV2/add/index';

import type {Page} from 'playwright';

Expand Down Expand Up @@ -89,8 +88,6 @@ class SeoTab extends BOBasePage {
* @returns {Promise<string>}
*/
async getErrorMessageOfFriendlyUrl(page: Page): Promise<string> {
await this.clickAndWaitForLoadState(page, createProductPage.saveProductButton);

return this.getTextContent(page, this.alertText);
}

Expand Down

0 comments on commit 660d1f6

Please sign in to comment.