From 1364adb69073c1c86b7ace380d7d362af6d132ea Mon Sep 17 00:00:00 2001 From: Ivan Stojadinov Date: Tue, 27 Aug 2024 15:56:14 +0200 Subject: [PATCH] [e2e tests] External sites - update products/block-editor folder (#50960) * Include products/block-editor into default-pressable set of tests * Wait for `Block: Product attributes` before proceeding * Add changefile(s) from automation for the following project(s): woocommerce * Put comment on why to wait for the element * Fix issue caught by Lint - @woocommerce/plugin-woocommerce * Fix linting error --------- Co-authored-by: github-actions --- .../50960-e2e-external-sites-update-products-block-editor | 4 ++++ .../e2e-pw/envs/default-pressable/playwright.config.js | 1 + .../block-editor/product-attributes-block-editor.spec.js | 7 +++++++ 3 files changed, 12 insertions(+) create mode 100644 plugins/woocommerce/changelog/50960-e2e-external-sites-update-products-block-editor diff --git a/plugins/woocommerce/changelog/50960-e2e-external-sites-update-products-block-editor b/plugins/woocommerce/changelog/50960-e2e-external-sites-update-products-block-editor new file mode 100644 index 00000000000..81ca7834934 --- /dev/null +++ b/plugins/woocommerce/changelog/50960-e2e-external-sites-update-products-block-editor @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update `products/block-editor` e2e tests, so they are passing against Pressable env. \ No newline at end of file diff --git a/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js b/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js index 71593d34372..eacb762a3ac 100644 --- a/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js +++ b/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js @@ -10,6 +10,7 @@ config = { testMatch: [ '**/basic.spec.js', '**/activate-and-setup/**/*.spec.js', + '**/merchant/products/block-editor/**/*.spec.js', ], grepInvert: /@skip-on-default-pressable/, }, diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/product-attributes-block-editor.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/product-attributes-block-editor.spec.js index df494986a71..b80922b34f1 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/product-attributes-block-editor.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/product-attributes-block-editor.spec.js @@ -373,6 +373,13 @@ test( await expect( async () => { await page.reload(); + // Waiting for the "Block: Product attributes" will ensure + // that test will pass against the Pressable environment + await expect( + page.locator( + `[aria-label="Block: Product attributes"]` + ) + ).toBeVisible(); await page.getByRole( 'button', { name: 'Edit' } ).click(); await expect( page.locator(