From a7fb611665a809658a17b51b712aa065726d704e Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:01:12 +0200 Subject: [PATCH] [e2e tests] Fix create a simple product test flakiness (#45700) --- ...eate-product-block-editor-tests-category-link-strictness | 4 ++++ .../organization-tab-product-block-editor.spec.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/e2e-fix-create-product-block-editor-tests-category-link-strictness diff --git a/plugins/woocommerce/changelog/e2e-fix-create-product-block-editor-tests-category-link-strictness b/plugins/woocommerce/changelog/e2e-fix-create-product-block-editor-tests-category-link-strictness new file mode 100644 index 00000000000..ac8bd8bc780 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-create-product-block-editor-tests-category-link-strictness @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +E2E tests: fixed flaky product create test diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/organization-tab-product-block-editor.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/organization-tab-product-block-editor.spec.js index ca2de837905..c7f2643908a 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/organization-tab-product-block-editor.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/organization-tab-product-block-editor.spec.js @@ -30,7 +30,7 @@ test.describe( 'General tab', () => { 'The block product editor is not being tested' ); - test( 'can create a simple product with categories, tags and with passowrd required', async ( { + test( 'can create a simple product with categories, tags and with password required', async ( { page, } ) => { await page.goto( NEW_EDITOR_ADD_PRODUCT_URL ); @@ -143,8 +143,8 @@ test.describe( 'General tab', () => { ).toBeVisible(); await expect( - page.getByRole( 'link', { name: categoryName } ) - ).toBeVisible(); + await page.getByRole( 'link', { name: categoryName } ).count() + ).toBeGreaterThan( 0 ); await expect( page.getByRole( 'link', { name: tagName } )