forked from wazuh/wazuh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.lighthouserc.js
More file actions
100 lines (96 loc) · 2.92 KB
/
.lighthouserc.js
File metadata and controls
100 lines (96 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
const fs = require('fs');
const baseline = JSON.parse(fs.readFileSync('baselines/lighthouse_baseline.json', 'utf8'));
const baseUrl = 'http://localhost:5601';
module.exports = {
ci: {
collect: {
url: [
`${baseUrl}/app/home`,
`${baseUrl}/app/dashboards#/view/722b74f0-b882-11e8-a6d9-e546fe2bba5f`,
`${baseUrl}/app/data-explorer/discover`,
`${baseUrl}/app/visualize`,
], // Add more URLs as needed
startServerCommand: 'yarn start --no-base-path',
numberOfRuns: 1,
settings: {
chromePath: require('puppeteer').executablePath(),
chromeFlags: '--no-sandbox --disable-gpu --headless',
formFactor: 'desktop', // This will enforce the desktop view
viewport: {
width: 1280, // Optional: Set a specific width
height: 800, // Optional: Set a specific height
},
screenEmulation: {
// Disable mobile emulation
disabled: true,
},
},
},
assert: {
assertMatrix: [
{
matchingUrlPattern: '/app/home',
assertions: {
'first-contentful-paint': [
'warn',
{
maxNumericValue: baseline['/app/home']['first-contentful-paint'],
},
],
'speed-index': ['warn', { maxNumericValue: baseline['/app/home']['speed-index'] }],
},
},
{
matchingUrlPattern: '/app/data-explorer/discover',
assertions: {
'first-contentful-paint': [
'warn',
{
maxNumericValue: baseline['/app/data-explorer/discover']['first-contentful-paint'],
},
],
'speed-index': [
'warn',
{ maxNumericValue: baseline['/app/data-explorer/discover']['speed-index'] },
],
},
},
{
matchingUrlPattern: '/app/visualize',
assertions: {
'first-contentful-paint': [
'warn',
{
maxNumericValue: baseline['/app/visualize']['first-contentful-paint'],
},
],
'speed-index': ['warn', { maxNumericValue: baseline['/app/visualize']['speed-index'] }],
},
},
{
matchingUrlPattern: '/app/dashboards',
assertions: {
'first-contentful-paint': [
'warn',
{
maxNumericValue: baseline['/app/dashboards']['first-contentful-paint'],
},
],
'speed-index': [
'warn',
{ maxNumericValue: baseline['/app/dashboards']['speed-index'] },
],
},
},
],
},
},
upload: {
target: 'temporary-public-storage', // Required for GitHub integration
githubStatusCheck: false,
},
};