Skip to content

Commit

Permalink
Prevent E2E tests from failing randomly due to getting product block …
Browse files Browse the repository at this point in the history
…attribute locators before they are rendered.
  • Loading branch information
eason9487 committed Aug 20, 2024
1 parent cc158ab commit 68b14e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/e2e/utils/product-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ export function getProductBlockEditorUtils( page ) {
},

async getAvailableProductAttributesWithTestValues() {
// Avoiding tests may start to get locators before they are rendered,
// leading to random failures.
await this.getProductAttributesHeading().waitFor();
return getAvailableProductAttributesWithTestValues(
page,
this.getDateAndTimeFields
Expand Down

0 comments on commit 68b14e4

Please sign in to comment.