Updated k6 tests based on feedback

This commit is contained in:
Tam Mullen 2021-08-06 12:46:53 +01:00
parent e501fa443b
commit 080f966b93
4 changed files with 4 additions and 28 deletions

View File

@ -38,7 +38,7 @@ export const product_url = __ENV.P_URL || 'beanie';
export const product_id = __ENV.P_ID || '13';
export const product_search_term = __ENV.P_TERM || 'beanie';
export const coupon_code = 'testing';
export const coupon_code = __ENV.P_COUPON || 'testing';
export const add_product_title = 'Test Product';
export const add_product_regular_price = '12';

View File

@ -67,7 +67,7 @@ export {
commonRequestHeaders,
commonGetRequestHeaders,
commonAPIGetRequestHeaders,
contentTypeRequestHeader,
contentTypeRequestHeader,
commonPostRequestHeaders,
commonNonStandardHeaders,
};

View File

@ -153,8 +153,8 @@ export function homeWCAdmin() {
);
response = http.get(
`${base_url}/wp-json/wc-analytics/products?page=1&per_page=1&low_in_stock=true&` +
`status=publish&_fields%5B0%5D=id&_locale=user`,
`${base_url}/wp-json/wc-analytics/products/low-in-stock?page=1&per_page=1&` +
`low_in_stock=true&status=publish&_fields%5B0%5D=id&_locale=user`,
{
headers: requestHeaders,
}

View File

@ -1,24 +0,0 @@
import { cart } from '../requests/shopper/cart.js';
import { checkoutGuest } from '../requests/shopper/checkout-guest.js';
export let options = {
scenarios: {
checkoutFlowSpike: {
executor: 'ramping-arrival-rate',
startRate: 1,
timeUnit: '1s',
preAllocatedVUs: 1,
maxVUs: 4,
stages: [
{ target: 3, duration: '30s' },
{ target: 0, duration: '30s' },
],
exec: 'checkoutGuestFlow',
},
},
};
export function checkoutGuestFlow() {
cart();
checkoutGuest();
}