-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from nesrineabdmouleh/adapt173
Migrate 173 selectors to run sanity tests
- Loading branch information
Showing
7 changed files
with
111 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/versions/1.7.3/pages/BO/catalog/products/create/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Import pages | ||
import type {BOProductsCreatePageInterface} from '@interfaces/BO/catalog/products/create'; | ||
import {CreateProduct} from '@versions/1.7.5/pages/BO/catalog/products/create'; | ||
import {type Page} from '@playwright/test'; | ||
|
||
/** | ||
* Bo create product page, contains functions that can be used on the page | ||
* @class | ||
* @extends CreateProduct | ||
*/ | ||
class BOCreateProductVersion extends CreateProduct implements BOProductsCreatePageInterface { | ||
/** | ||
* @constructs | ||
* Setting up texts and selectors to use on create products page | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
this.deleteProductButton = '#product_form_delete_btn'; | ||
} | ||
|
||
/** | ||
* Delete product | ||
* @param page {Page} Browser tab | ||
* @returns {Promise<string>} | ||
*/ | ||
async deleteProduct(page: Page): Promise<string> { | ||
await this.clickAndWaitForURL(page, this.deleteProductButton); | ||
|
||
return this.getAlertSuccessBlockParagraphContent(page); | ||
} | ||
} | ||
|
||
const createProduct = new BOCreateProductVersion(); | ||
export {createProduct, BOCreateProductVersion as CreateProduct}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Import pages | ||
import type {BOProductsPageInterface} from '@interfaces/BO/catalog/products'; | ||
import {ProductsPage} from '@versions/1.7.5/pages/BO/catalog/products'; | ||
|
||
/** | ||
* Bo products page, contains functions that can be used on the page | ||
* @class | ||
* @extends ProductsPage | ||
*/ | ||
class BOProductsVersion extends ProductsPage implements BOProductsPageInterface { | ||
/** | ||
* @constructs | ||
* Setting up texts and selectors to use on products page | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
// Products list | ||
this.productsListTableColumnName = (row: number) => `${this.productsListTableRow(row)} td:nth-child(3) a`; | ||
this.productsListTableColumnReference = (row: number) => `${this.productsListTableRow(row)} td:nth-child(4)`; | ||
this.productsListTableColumnCategory = (row: number) => `${this.productsListTableRow(row)} td:nth-child(5)`; | ||
this.productsListTableColumnPriceTExc = (row: number) => `${this.productsListTableRow(row)} td:nth-child(6) a`; | ||
this.productsListTableColumnPriceATI = (row: number) => `${this.productsListTableRow(row)} td:nth-child(7)`; | ||
this.productsListTableColumnStatus = (row: number) => `${this.productsListTableRow(row)} td:nth-child(8)`; | ||
this.productListTableDropDownList = (row: number) => `${this.productsListTableRow(row)} td div.btn-group-action ` | ||
+ 'a.dropdown-toggle'; | ||
|
||
// Bulk actions | ||
this.selectAllProductsCheckbox = '#bulk_action_select_all'; | ||
} | ||
} | ||
|
||
const productsPage = new BOProductsVersion(); | ||
export {productsPage, BOProductsVersion as ProductsPage}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters