From 49744446a1946f5d448e89da869fd5cca810f91a Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Wed, 18 Jan 2023 18:56:15 -0300 Subject: [PATCH 1/3] Make the selector a bit more strict to avoid collision --- .../tests/e2e-pw/tests/merchant/order-refund.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-refund.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-refund.spec.js index 1b84805f475..84685ba7300 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-refund.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-refund.spec.js @@ -233,7 +233,7 @@ test.describe( 'WooCommerce Orders > Refund and restock an order item', () => { // Update the order await page.click( 'button.save_order' ); - await expect( page.locator( 'div.notice-success' ) ).toContainText( + await expect( page.locator( 'div.updated.notice-success' ) ).toContainText( 'Order updated.' ); From 4fdc9e735bf42e141a498e25ec8e230a7fe1f6c3 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Fri, 27 Jan 2023 10:44:36 -0500 Subject: [PATCH 2/3] Made selector more robust --- .../tests/e2e-pw/tests/merchant/product-import-csv.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/product-import-csv.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/product-import-csv.spec.js index a897c667f32..9b17fff985a 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/product-import-csv.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/product-import-csv.spec.js @@ -171,7 +171,7 @@ test.describe.serial( 'Import Products from a CSV file', () => { // verify the error message if you go without providing CSV file await page.click( 'button[value="Continue"]' ); - await expect( page.locator( 'div.error' ) ).toContainText( + await expect( page.locator( 'div.error.inline' ) ).toContainText( errorMessage ); } ); From 3a13bc42c07752d5f738fd1f965295ea2f08e04a Mon Sep 17 00:00:00 2001 From: jamelreid Date: Fri, 27 Jan 2023 10:45:59 -0500 Subject: [PATCH 3/3] Added changelog --- plugins/woocommerce/changelog/e2e-strict-locator-tweak | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/e2e-strict-locator-tweak diff --git a/plugins/woocommerce/changelog/e2e-strict-locator-tweak b/plugins/woocommerce/changelog/e2e-strict-locator-tweak new file mode 100644 index 00000000000..e04b6968b04 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-strict-locator-tweak @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Made e2e selectors more robust