Skip to content

Commit

Permalink
Merge pull request #390 from jolelievre/stabilize-ui-tests
Browse files Browse the repository at this point in the history
Stabilize UI tests
  • Loading branch information
Progi1984 authored Feb 5, 2025
2 parents ffe6617 + ea6c971 commit 19c8f0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# ui-testing-library
# ui-testing-library

## Development usage

To deploy the modifications locally while developing you need a shop installed locally,
you can replace the tests UI library tools by running this command:

```shell
MAKECMDGOALS=/path/to/my/shop make test
```

This will override the UI testing library, you can then rerun the UI test campaign to check your modifications.
4 changes: 3 additions & 1 deletion src/versions/develop/pages/BO/orders/view/blockProducts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class BOProductBlockProductsPage extends ViewOrderBasePage implements BOProductB

// Products table
this.orderProductsTable = '#orderProductsTable';
this.orderProductsRowTable = (row: number) => `${this.orderProductsTable} tbody tr:nth-child(${row})`;
this.orderProductsRowTable = (row: number) => `${this.orderProductsTable} tbody tr.cellProduct:nth-child(${row})`;
this.orderProductsTableNameColumn = (row: number) => `${this.orderProductsRowTable(row)} td.cellProductName`;
this.orderProductsTableProductName = (row: number) => `${this.orderProductsTableNameColumn(row)} p.productName`;
this.orderProductsTableProductReference = (row: number) => `${this.orderProductsTableNameColumn(row)} p.productReference`;
Expand Down Expand Up @@ -365,6 +365,8 @@ class BOProductBlockProductsPage extends ViewOrderBasePage implements BOProductB

await page.locator(this.modalConfirmNewPriceSubmitButton).click();

// Wait for the edit row to be hidden, and the update to have been done asynchronously
await this.waitForHiddenSelector(page, this.orderProductsEditRowTable);
if (await this.elementVisible(page, this.orderProductsLoading, 1000)) {
await this.waitForHiddenSelector(page, this.orderProductsLoading);
}
Expand Down

0 comments on commit 19c8f0e

Please sign in to comment.