Commit 6d4d86cded0 for woocommerce
commit 6d4d86cded00f455bb042a1b3f5b97c5bdbd4dbb
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Mon Aug 3 16:05:36 2026 +0300
e2e tests: Await webhook cleanup in webhooks.spec.ts (#67337)
diff --git a/plugins/woocommerce/changelog/testops-255-await-webhooks-cleanup b/plugins/woocommerce/changelog/testops-255-await-webhooks-cleanup
new file mode 100644
index 00000000000..32fbdc57c19
--- /dev/null
+++ b/plugins/woocommerce/changelog/testops-255-await-webhooks-cleanup
@@ -0,0 +1,3 @@
+Significance: patch
+Type: dev
+Comment: Await the webhook cleanup request in the E2E webhooks spec so afterAll cannot finish before the deletions complete. Test-only change, no production impact.
diff --git a/plugins/woocommerce/tests/e2e/tests/settings/webhooks.spec.ts b/plugins/woocommerce/tests/e2e/tests/settings/webhooks.spec.ts
index 5a627ddbccd..e606744250c 100644
--- a/plugins/woocommerce/tests/e2e/tests/settings/webhooks.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/settings/webhooks.spec.ts
@@ -13,13 +13,16 @@ test.describe( 'Manage webhooks', () => {
test.use( { storageState: ADMIN_STATE_PATH } );
test.afterAll( async ( { restApi } ) => {
- await restApi.get( `${ WC_API_PATH }/webhooks` ).then( ( response ) => {
- const ids = response.data.map( ( webhook ) => webhook.id );
+ const response = await restApi.get( `${ WC_API_PATH }/webhooks`, {
+ per_page: 100,
+ } );
+ const ids = response.data.map( ( webhook ) => webhook.id );
- restApi.post( `${ WC_API_PATH }/webhooks/batch`, {
+ if ( ids.length ) {
+ await restApi.post( `${ WC_API_PATH }/webhooks/batch`, {
delete: ids,
} );
- } );
+ }
} );
const WEBHOOKS_SCREEN_URI =