-
-
Notifications
You must be signed in to change notification settings - Fork 140
256 lines (256 loc) · 12.6 KB
/
Copy pathlinux-chrome.yml
File metadata and controls
256 lines (256 loc) · 12.6 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: Linux browsers Chrome
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
basic:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: block
allowed-endpoints: >
accounts.google.com:443
android.clients.google.com:443
api.github.com:443
azure.archive.ubuntu.com:80
clients2.google.com:80
dl-ssl.google.com:443
dl.google.com:80
esm.ubuntu.com:443
files.pythonhosted.org:443
github.com:443
motd.ubuntu.com:443
msedgedriver.microsoft.com:443
mtalk.google.com:5228
nodejs.org:443
packages.microsoft.com:443
pypi.org:443
registry.npmjs.org:443
release-assets.githubusercontent.com:443
results-receiver.actions.githubusercontent.com:443
storage.googleapis.com:443
www.google.com:443
www.sitespeed.io:443
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Use Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24.x'
cache: 'npm'
- name: Install latest Chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
google-chrome --version
- name: Install Browsertime
run: npm ci
- name: Install dependencies
run: |
sudo apt-get install net-tools -y
python -m pip install virtualenv
sudo modprobe ifb numifbs=1
- name: Start local HTTP server
run: (npm run start-server&)
- name: Test Chrome with CPU throttle and preURL
run: ./bin/browsertime.js -b chrome --skipHar -n 1 --preURL http://127.0.0.1:3000/simple/ -r header:value --chrome.CPUThrottlingRate 2 --chrome.cdp.performance --xvfb --chrome.enableChromeDriverLog --chrome.collectConsoleLog http://127.0.0.1:3000/dimple/
- name: Test pre/post scripts
run: ./bin/browsertime.js -b chrome test/data/navigationscript/measure.cjs -n 1 --preScript test/data/prepostscripts/preSample.cjs --postScript test/data/prepostscripts/postSample.cjs --xvfb
- name: Test Chrome with emulated mobile
run: ./bin/browsertime.js -b chrome --chrome.mobileEmulation.deviceName 'iPhone 6' http://127.0.0.1:3000/simple/ --xvfb
- name: Test Chrome with web driver nagivation
run: ./bin/browsertime.js -b chrome -n 1 http://127.0.0.1:3000/simple/ --webdriverPageload --xvfb
- name: Test navigate to the same URL twice
run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwice.cjs -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
- name: Test navigate to the same URL twice by clicking on a link
run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwiceWithClick.cjs -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
- name: Test using alias for one URL
run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ --urlAlias my_url --xvfb
- name: Test using alias for multiple URLs
run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ http://127.0.0.1:3000/dimple/ --urlAlias startPage --urlAlias documentation --xvfb
- name: Run test with pre-test functionality
run: ./bin/browsertime.js -b chrome --preWarmServer --xvfb http://127.0.0.1:3000/simple/
- name: Test Chrome CDP and trace commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/chrome.cjs
scripting:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: block
allowed-endpoints: >
accounts.google.com:443
android.clients.google.com:443
api.github.com:443
azure.archive.ubuntu.com:80
clients2.google.com:80
dl-ssl.google.com:443
dl.google.com:80
esm.ubuntu.com:443
files.pythonhosted.org:443
github.com:443
motd.ubuntu.com:443
msedgedriver.microsoft.com:443
mtalk.google.com:5228
nodejs.org:443
packages.microsoft.com:443
pypi.org:443
registry.npmjs.org:443
release-assets.githubusercontent.com:443
results-receiver.actions.githubusercontent.com:443
storage.googleapis.com:443
www.google.com:443
www.sitespeed.io:443
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Use Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24.x'
cache: 'npm'
- name: Install latest Chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
google-chrome --version
- name: Install Browsertime
run: npm ci
- name: Install dependencies
run: |
sudo apt-get install net-tools -y
python -m pip install virtualenv
sudo modprobe ifb numifbs=1
- name: Start local HTTP server
run: (npm run start-server&)
- name: Run test with screenshots
run: ./bin/browsertime.js -b chrome --screenshotLCP --screenshotLS --xvfb http://127.0.0.1:3000/simple/
- name: Run test with tcp dump
run: ./bin/browsertime.js -b chrome --xvfb http://127.0.0.1:3000/simple/ -n 1 --tcpdump
- name: Run test with scripting.mjs
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.mjs
- name: Run test with scripting.cjs
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/common.cjs
- name: Run test with scripting.js
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/common.js --cjs
- name: Run test with scripting.js
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.js
- name: Run test with scripting.mts
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.mts
- name: Run test with scripting.cts
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/common.cts
- name: Run test with scripting.ts
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/common.ts --cjs
- name: Run test with scripting.ts
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.ts
- name: Test unified click commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/clickBackAndForth.cjs
- name: Test unified misc commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/misc.cjs
- name: Test new convenience commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/newCommands.cjs
- name: Test Selenium Actions API
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/actions.cjs
- name: Test stopWatch commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/stopWatch.cjs
- name: Test measure with alias
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/measureAlias.cjs
- name: Test scroll commands
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/commandscripts/scrollToBottom.cjs
- name: Test extra profile run Chrome
run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ -n 1 --viewPort 1000x600 --xvfb --enableProfileRun
- name: Test Chrome JS/CSS coverage
run: |
./bin/browsertime.js -b chrome -n 1 --xvfb --skipHar --chrome.coverage --resultDir /tmp/coverage http://127.0.0.1:3000/simple/
echo "--- coverage block ---"
jq '.[0].coverage' /tmp/coverage/browsertime.json
jq -e '(.[0].coverage.js | type) == "array" and (.[0].coverage.js | length) > 0' /tmp/coverage/browsertime.json
jq -e '(.[0].coverage.css | type) == "array" and (.[0].coverage.css | length) > 0' /tmp/coverage/browsertime.json
jq -e '.[0].coverage.js[0] | has("totalBytes") and has("usedBytes") and has("unusedBytes") and has("unusedPercent") and has("files")' /tmp/coverage/browsertime.json
jq -e '.[0].coverage.css[0] | has("totalBytes") and has("usedBytes") and has("unusedBytes") and has("unusedPercent") and has("files")' /tmp/coverage/browsertime.json
- name: Test Chrome soft navigation detection
run: |
./bin/browsertime.js -b chrome -n 1 --xvfb --spa --resultDir /tmp/soft-nav test/data/commandscripts/softNavigation.cjs
echo "--- soft navigation entry ---"
jq '.[0].browserScripts[0].timings.softNavigations[0]' /tmp/soft-nav/browsertime.json
echo "--- HAR page ---"
jq '.log.pages[0] | {title, _url, _softNavigation}' /tmp/soft-nav/browsertime.har
jq -e '.[0].browserScripts[0].timings.softNavigations | length > 0' /tmp/soft-nav/browsertime.json
jq -e '.[0].browserScripts[0].timings.softNavigations[0].name | endswith("/spa/page-2")' /tmp/soft-nav/browsertime.json
jq -e '.log.pages[0]._softNavigation == true' /tmp/soft-nav/browsertime.har
jq -e '.log.pages[0]._url | endswith("/spa/page-2")' /tmp/soft-nav/browsertime.har
video:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: block
allowed-endpoints: >
accounts.google.com:443
android.clients.google.com:443
api.github.com:443
azure.archive.ubuntu.com:80
clients2.google.com:80
dl-ssl.google.com:443
dl.google.com:80
esm.ubuntu.com:443
files.pythonhosted.org:443
github.com:443
motd.ubuntu.com:443
msedgedriver.microsoft.com:443
mtalk.google.com:5228
nodejs.org:443
packages.microsoft.com:443
pypi.org:443
registry.npmjs.org:443
release-assets.githubusercontent.com:443
results-receiver.actions.githubusercontent.com:443
storage.googleapis.com:443
www.google.com:443
www.sitespeed.io:443
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Use Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24.x'
cache: 'npm'
- name: Install latest Chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
google-chrome --version
- name: Install Browsertime
run: npm ci
- name: Install ffmpeg
uses: AnimMouse/setup-ffmpeg@ae28d57dabbb148eff63170b6bf7f2b60062cbae # v1.2.3
with:
version: '7.1'
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
sudo apt-get install net-tools -y
python -m pip install --upgrade pip setuptools==70.0.0 pyssim OpenCV-Python Numpy virtualenv
sudo modprobe ifb numifbs=1
- name: Start local HTTP server
run: (npm run start-server&)
- name: Test multi pages with video and visual metrics
run: ./bin/browsertime.js -b chrome test/data/navigationscript/multi.cjs -n 3 --chrome.timeline --video --visualMetrics --visualElements --viewPort 1000x600 --xvfb
- name: Test navigation and page complete check inactivity
run: ./bin/browsertime.js -b chrome test/data/navigationscript/navigateAndStartInTwoSteps.cjs -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
- name: Run test with check network idle in Chrome
run: ./bin/browsertime.js -b chrome --pageCompleteCheckNetworkIdle --xvfb http://127.0.0.1:3000/simple/