Skip to content

Commit 66a8edf

Browse files
author
alireza sharifi
committed
Updated demo
1 parent e4caef8 commit 66a8edf

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

demo/demo_batch_runner.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
urls = ["https://amazon.com","https://alibaba.com"]
55
form_factors = ["mobile","desktop"]
66

7+
TIMINGS = [
8+
'first-contentful-paint',
9+
'speed-index',
10+
'interactive',
11+
]
12+
713
# settings are as the same as the pagespeed.web.dev
814
additional_settings = [
915
"--throttling.cpuSlowdownMultiplier=4",
@@ -18,6 +24,6 @@
1824
"--axe.version=4.7.0",
1925
]
2026

21-
batch_runner = BatchRunner(urls,form_factors,quiet=False,additional_settings=additional_settings,repeats=2)
27+
batch_runner = BatchRunner(urls,form_factors,quiet=False,additional_settings=additional_settings,repeats=2,timings=TIMINGS)
2228

2329
print(batch_runner.reports)

demo/demo_repeat_runner.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
url="https://github.com"
55

6+
TIMINGS = [
7+
'first-contentful-paint',
8+
'speed-index',
9+
'interactive',
10+
]
11+
612
# settings are as the same as the pagespeed.web.dev
713
additional_settings = [
814
"--throttling.cpuSlowdownMultiplier=4",
@@ -17,7 +23,7 @@
1723
"--axe.version=4.7.0",
1824
]
1925

20-
repeat_runner = LighthouseRepeatRunner(url,"desktop",quiet=False,additional_settings=additional_settings,repeats=2)
26+
repeat_runner = LighthouseRepeatRunner(url,"desktop",quiet=False,additional_settings=additional_settings,repeats=2,timings=TIMINGS)
2127

2228
print(repeat_runner.report.score)
2329
print(repeat_runner.report.timings)

demo/demo_runner.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
url="https://github.com"
55

6+
TIMINGS = [
7+
'first-contentful-paint',
8+
'speed-index',
9+
'interactive',
10+
]
11+
612
# settings are as the same as the pagespeed.web.dev
713
additional_settings = [
814
"--throttling.cpuSlowdownMultiplier=4",
@@ -17,9 +23,9 @@
1723
"--axe.version=4.7.0",
1824
]
1925

20-
runner = LighthouseRunner(url,"mobile",quiet=False,additional_settings=additional_settings)
26+
runner = LighthouseRunner(url,"mobile",quiet=False,additional_settings=additional_settings,
27+
timings=TIMINGS,output_type='both',output_dir='./outputs')
2128

2229
print(runner.report.score)
2330
print(runner.report.timings)
24-
print(runner.report.audits)
25-
31+
print(runner.report.audits(0.86)['performance'].passed)

0 commit comments

Comments
 (0)