I’m considering a hybrid approach to browser testing and have used the k6 recorder to capture the user’s browser journey.
My hybrid scenario would look like this (separated here for clarity):
export const portfolioProtocolScenario = {
executor: 'ramping-vus',
startVUs: 0,
stages: [
{ duration: '10s', target: 50 },
{ duration: '10s', target: 50 },
{ duration: '10s', target: 0 },
],
exec: 'portfolioLoad',
tags: { my_custom_tag: 'protocol' },
};
export const portfolioBrowserScenario = {
exec: 'e2eBrowserTest',
executor: 'per-vu-iterations',
vus: 5,
iterations: 5,
startTime: '15s',
options: {
browser: {
type: 'chromium',
},
},
};
As you can see, I’m starting the protocol tests (recorded from the browser) first, and when it reaches peak load, I trigger the browser tests to measure web vitals.
My question is: should I include third-party services, css, js, google analytics, images, docs, etc., captured from the recording in the protocol test?
I’m unsure if it adds value since the browser tests will hit these items again. However, considering the maximum load is on the protocol tests, should I keep them there to ensure nothing goes wrong?