Update orders and product k6 tests to be more robust
This commit is contained in:
parent
74c72274a7
commit
579d491ca2
|
@ -55,8 +55,8 @@ export function orders() {
|
|||
);
|
||||
api_x_wp_nonce = findBetween(
|
||||
response.body,
|
||||
'wp-json\\/","nonce":"',
|
||||
'",'
|
||||
'wp.apiFetch.createNonceMiddleware( "',
|
||||
'" )'
|
||||
);
|
||||
|
||||
// Create request header with nonce value for use in subsequent requests.
|
||||
|
|
|
@ -5,7 +5,7 @@ import { randomIntBetween } from "https://jslib.k6.io/k6-utils/1.1.0/index.js";
|
|||
import {
|
||||
base_url,
|
||||
product_url,
|
||||
product_id,
|
||||
product_sku,
|
||||
think_time_min,
|
||||
think_time_max,
|
||||
} from "../../config.js";
|
||||
|
@ -36,8 +36,8 @@ export function singleProduct() {
|
|||
productPageTrend.add(response.timings.duration);
|
||||
check(response, {
|
||||
"is status 200": (r) => r.status === 200,
|
||||
"body contains: product ID": (response) =>
|
||||
response.body.includes(`id="product-${product_id}`),
|
||||
"body contains: product SKU": (response) =>
|
||||
response.body.includes(`class="sku">${product_sku}`),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue