forked from sitespeedio/sitespeed.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspa.js
18 lines (18 loc) · 798 Bytes
/
spa.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module.exports = async function(context, commands) {
commands.meta.setTitle('Test Grafana SPA');
commands.meta.setDescription(
'Test the first page, click the timepicker and then choose <b>Last 30 days</b> and measure that page.'
);
await commands.measure.start(
'https://dashboard.sitespeed.io/d/000000064/drilldown?orgId=1',
'pageTimingMetricsDefault'
);
await commands.click.byClassName('toolbar-button css-1t4b87h-toolbar-button');
await commands.wait.byTime(3000);
await commands.measure.start('pageTimingMetrics30Days');
await commands.click.byXpathAndWait(
'/html/body/grafana-app/div/div/react-container/div/div[1]/div[3]/div/div[1]/div/div/div[1]/div[2]/div[1]/div[2]/div[11]'
);
await commands.wait.byTime(5000);
return commands.measure.stop();
};