From dd79e4bf97cbe89795cd944ae8eb7e8e028f6c73 Mon Sep 17 00:00:00 2001 From: Ivan Stojadinov Date: Tue, 27 Aug 2024 18:01:41 +0200 Subject: [PATCH] [e2e tests] External sites - update products/add-variable-product folder (#50942) * Include add-variable-product/**/*.spec.js for Pressable env * Use unique identifier for the Update button * Add changefile(s) from automation for the following project(s): woocommerce * Add changefile(s) from automation for the following project(s): woocommerce * Remove @local tag * Use getBy* instead of locator * Use `locator( '#publishing-action' )` * Fix lint issues --------- Co-authored-by: github-actions --- .../50942-e2e-external-sites-update-add-variable-product | 4 ++++ .../tests/e2e-pw/envs/default-pressable/playwright.config.js | 1 + .../add-variable-product/create-product-attributes.spec.js | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/50942-e2e-external-sites-update-add-variable-product diff --git a/plugins/woocommerce/changelog/50942-e2e-external-sites-update-add-variable-product b/plugins/woocommerce/changelog/50942-e2e-external-sites-update-add-variable-product new file mode 100644 index 00000000000..a76d030d603 --- /dev/null +++ b/plugins/woocommerce/changelog/50942-e2e-external-sites-update-add-variable-product @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update `add-variable-product` 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 eacb762a3ac..fe57da38ed9 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 @@ -9,6 +9,7 @@ config = { use: { ...devices[ 'Desktop Chrome' ] }, testMatch: [ '**/basic.spec.js', + '**/merchant/products/add-variable-product/**/*.spec.js', '**/activate-and-setup/**/*.spec.js', '**/merchant/products/block-editor/**/*.spec.js', ], diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/add-variable-product/create-product-attributes.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/add-variable-product/create-product-attributes.spec.js index 94225f9c4bd..77db0953f5c 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/add-variable-product/create-product-attributes.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/add-variable-product/create-product-attributes.spec.js @@ -133,7 +133,10 @@ test.describe( 'Add product attributes', { tag: '@gutenberg' }, () => { 'options=woocommerce_task_list_reminder_bar_hidden' ) ); - await page.getByRole( 'button', { name: 'Update' } ).click(); + await page + .locator( '#publishing-action' ) + .getByRole( 'button', { name: 'Update' } ) + .click(); const response = await finalRequestResolution; expect( response.ok() ).toBeTruthy();