forked from brave-experiments/browser-comparison-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitespeed-bench.ps1
executable file
·52 lines (47 loc) · 1.38 KB
/
sitespeed-bench.ps1
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
param (
[Parameter(Mandatory=$true)][string]$test,
[Parameter(Mandatory=$true)][string]$connectivity
)
$browsers = @("Chrome", "Brave", "Firefox", "Opera")
$i = 0
Get-Content $test | ForEach-Object {
$page = $_
foreach ($browser in $browsers) {
switch ($browser)
{
"Brave" {
$spbrowser="chrome"
$binaryFlag="--$spbrowser.binaryPath"
$binaryPath="$ENV:LOCALAPPDATA\BraveSoftware\Brave-Browser-Beta\Application\brave.exe"
$driver="--chrome.chromedriverPath=chromedrivers/win/chromedriver.exe"
}
"Chrome" {
$spbrowser="chrome"
$binaryFlag="--$spbrowser.binaryPath"
$binaryPath="${Env:Programfiles(x86)}\Google\Chrome Beta\Application\chrome.exe"
$driver="--chrome.chromedriverPath=chromedrivers/win/chromedriver.exe"
}
"Opera" {
$spbrowser="chrome"
$binaryFlag="--$spbrowser.binaryPath"
$binaryPath="$ENV:LOCALAPPDATA\Programs\Opera\64.0.3417.73\opera.exe"
$driver="--chrome.chromedriverPath=chromedrivers/win/operadriver.exe"
}
"Firefox" {
$spbrowser="firefox"
$binaryFlag=""
$binaryPath=""
$driver=""
}
}
Write-Output "Testing $browser with $page"
browsertime -b $spbrowser $binaryFlag $binaryPath $driver `
--iterations 3 `
--pageCompleteCheckInactivity `
--resultDir browsertime/$BROWSER/$connectivity/$i `
--viewPort maximize `
--connectivity.alias $connectivity `
$page
}
$i += 1
}