From 82e3eb6701f3ff6836d4f2e39fba500f0b5ee669 Mon Sep 17 00:00:00 2001 From: "Jorge A. Torres" Date: Thu, 13 Apr 2023 15:22:52 -0500 Subject: [PATCH 1/3] Correct checks in `merchant/add-order.js` perf test --- .../tests/performance/requests/merchant/add-order.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js index 308130aa726..dacf0519c5f 100644 --- a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js +++ b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js @@ -57,9 +57,9 @@ let admin_update_order_assert; if ( cot_status === true ) { admin_new_order_base = 'admin.php?page=wc-orders&action=new'; admin_update_order_base = 'admin.php?page=wc-orders&action=edit'; - admin_new_order_assert = 'post_status" type="hidden" value="auto-draft'; + admin_new_order_assert = 'post_status" type="hidden" value="pending'; admin_open_order_assert = 'post_status" type="hidden" value="pending'; - admin_created_order_assert = 'changed from auto-draft to'; + admin_created_order_assert = 'Order updated.'; admin_update_order_assert = 'changed from Pending payment to Completed'; } else { admin_new_order_base = 'post-new.php?post_type=shop_order'; From 79b05ad71c6140b4022704c053d1e223e6a8eecf Mon Sep 17 00:00:00 2001 From: "Jorge A. Torres" Date: Thu, 13 Apr 2023 15:23:30 -0500 Subject: [PATCH 2/3] Do not override `admin_update_order_base` in `merchant/add-order.js` perf test to prevent duplicate order IDs --- .../tests/performance/requests/merchant/add-order.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js index dacf0519c5f..a39788bae2b 100644 --- a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js +++ b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js @@ -50,6 +50,7 @@ let admin_created_order_assert; let admin_open_order_base; let admin_open_order_assert; let admin_update_order_base; +let admin_update_order; let admin_update_order_id; let admin_update_order_params; let admin_update_order_assert; @@ -375,14 +376,15 @@ export function addOrder() { ] ); if ( cot_status === true ) { - admin_update_order_base = `${ admin_update_order_base }&id=${ hpos_post_id }`; + admin_update_order = `${ admin_update_order_base }&id=${ hpos_post_id }`; admin_update_order_params = cotOrderParams.toString(); } else { + admin_update_order = admin_update_order_base; admin_update_order_params = orderParams.toString(); } response = http.post( - `${ base_url }/wp-admin/${ admin_update_order_base }`, + `${ base_url }/wp-admin/${ admin_update_order }`, admin_update_order_params.toString(), { headers: requestHeaders, From 580d717ec2b935709caf5b74ca2321ca3bde8acd Mon Sep 17 00:00:00 2001 From: "Jorge A. Torres" Date: Thu, 13 Apr 2023 15:31:18 -0500 Subject: [PATCH 3/3] Add changelog --- plugins/woocommerce/changelog/fix-k6-order-id-hpos | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/fix-k6-order-id-hpos diff --git a/plugins/woocommerce/changelog/fix-k6-order-id-hpos b/plugins/woocommerce/changelog/fix-k6-order-id-hpos new file mode 100644 index 00000000000..ff1317d7e37 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-k6-order-id-hpos @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Correct URL and assertion in merchant/add-order perf test.