John Hill
Web UI Test Engineer,
Space Mission Control Software, KBR
NASA Ames Research Center
npx install playwright
npx playwright codegen
Synthetic tests aren’t very resilient, and they can easily fail when small UI changes are introduced, generating unnecessary alert noise. This means that whenever a minor application element such as a button is changed, the corresponding test must be, too."
dynatrace.com/news/blog/what-is-synthetic-monitoring/
Your Internal Network OR
Localhost
CDP
Synthetic User Monitor
"Internet"
const client = await page.target().createCDPSession();
await client.send('Network.enable');
await client.send('Network.emulateNetworkConditions', {
latency: 500
});
await page.route('**/*.png', route => {
route.fulfill({
body: './bing.png'
});
});
browserless
browserless:
image: browserless/chrome:latest
cpus: 2.0
mem_limit: 4g
github.com/browserless/chrome
Your Internal Network
connectOverCDP()
emulateNetworkConditions
0 latency
500ms
"3g"
test('Zeroed baseline', async ({page, browser}) => {
await console.time('htmlfloor');
await page.setContent(`
<div class="visible">Hello world</div>
<input type="checkbox" enabled class="enabled">
`);
await page.locator('.visible').isVisible();
await console.timeLog('htmlfloor');
});
const { influx } = require('./influxUtils');
test.describe('feature foo', () => {
test('my test', async ({ page }) => {
await page.goto('/');
await influx.write(
'test_mesurement',
{ tag1: 'tag 1 value' },
{ field1: 12, field2: 2.3 },
Date.now()
);
});
});
What it solves:
*Generate many, many
measurements!
** Tap into the huge k6 ecosystem to integrate and correlate with System Monitoring, Load Testing, etc
openmct
js-perf-toolkit
browserless/chrome
xk6-browser
First Load | Loaded Page | Session |
---|
from browserstack.com/speedlab
** asterisk
And lastly, many synthetic monitoring tools lack the context needed to explain why a specific failure happened or what the business implications might be, lengthening time to resolution and making it unnecessarily difficult to prioritize application performance issues."
dynatrace.com/news/blog/what-is-synthetic-monitoring/
***** Asterisk
performance.mark('first-google-ad');
### Some number of clicks or steps ###
performance.mark('click-on-first-ad');
performance.measure('first-ad-click-duration','first-google-ad','click-on-first-ad');
###returned object
PerformanceMeasure {
name: 'first-ad-click-duration',
entryType: 'measure',
startTime: 4727964.299999952,
duration: 12436.700000047684
}
First Load | Loaded Page | Session |
---|
First Load | Loaded Page | Session |
---|
(Chrome! Devtools!)
Load Testing Can't Properly Approximate Frontend Performance Regressions
Google found that when they increased the search results from 10 to 30, the load time increased by half a second and resulted in a 20% decrease in ad revenues."