Commit bd48bccae0 for woocommerce
commit bd48bccae0f3db117c5c1699fd0add962e41e1cd
Author: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Date: Fri Dec 5 11:38:46 2025 +0900
Fix analytics overview flaky tests (#62244)
* Add changelog
* Enhance analytics overview tests by adding response wait for user data during section movement actions.
* Refactor analytics overview tests to improve response handling for user data during section interactions.
diff --git a/plugins/woocommerce/changelog/wooplug-3385-flaky-test-should-allow-a-user-to-move-a-section-up b/plugins/woocommerce/changelog/wooplug-3385-flaky-test-should-allow-a-user-to-move-a-section-up
new file mode 100644
index 0000000000..505c0d7ef0
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooplug-3385-flaky-test-should-allow-a-user-to-move-a-section-up
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Fix analytics overview flaky tests
diff --git a/plugins/woocommerce/tests/e2e-pw/tests/analytics/analytics-overview.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/analytics/analytics-overview.spec.js
index 02045dd3f8..64535f49a1 100644
--- a/plugins/woocommerce/tests/e2e-pw/tests/analytics/analytics-overview.spec.js
+++ b/plugins/woocommerce/tests/e2e-pw/tests/analytics/analytics-overview.spec.js
@@ -226,6 +226,11 @@ test.describe(
await test.step( `Move first section down`, async () => {
await buttons_ellipsis.first().click();
await menuitem_moveDown.click();
+ await page.waitForResponse(
+ ( response ) =>
+ response.url().includes( '/users' ) &&
+ response.ok()
+ );
} );
await test.step( `Expect the second section to become first, and first becomes second.`, async () => {
@@ -250,6 +255,11 @@ test.describe(
await test.step( `Move second section up`, async () => {
await buttons_ellipsis.nth( 1 ).click();
await menuitem_moveUp.click();
+ await page.waitForResponse(
+ ( response ) =>
+ response.url().includes( '/users' ) &&
+ response.ok()
+ );
} );
await test.step( `Expect second section becomes first section, first becomes second`, async () => {
@@ -293,6 +303,10 @@ test.describe(
await test.step( `Add the Performance section back in.`, async () => {
await page.getByTitle( 'Add more sections' ).click();
await page.getByTitle( 'Add Performance section' ).click();
+ await page.waitForResponse(
+ ( response ) =>
+ response.url().includes( '/users' ) && response.ok()
+ );
} );
await test.step( `Expect the Performance section to be added back.`, async () => {