File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ function Start-SeChrome {
7
7
[array ]$Arguments ,
8
8
[switch ]$HideVersionHint ,
9
9
[System.IO.FileInfo ]$DefaultDownloadPath ,
10
- [bool ]$DisableBuiltInPDFViewer = $true
10
+ [bool ]$DisableBuiltInPDFViewer = $true ,
11
+ [bool ]$Headless = $false
11
12
)
12
13
13
14
$Chrome_Options = New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeOptions"
@@ -21,6 +22,10 @@ function Start-SeChrome {
21
22
$Chrome_Options.AddUserProfilePreference (' plugins' , @ {' always_open_pdf_externally' = $true ;})
22
23
}
23
24
25
+ if ($Headless ) {
26
+ $Chrome_Options.AddArguments (' headless' )
27
+ }
28
+
24
29
if ($Arguments ) {
25
30
$Chrome_Options.AddArguments ($Arguments )
26
31
}
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ Describe "Start-SeChrome" {
7
7
}
8
8
}
9
9
10
+ Describe " Start-SeChrome headless" {
11
+ Context " Should Start Chrome Driver in headless mode" {
12
+ $Driver = Start-SeChrome - Headless $true
13
+ Stop-SeDriver $Driver
14
+ }
15
+ }
16
+
10
17
Describe " Start-SeFirefox" {
11
18
Context " Should Start Firefox Driver" {
12
19
$Driver = Start-SeFirefox
You can’t perform that action at this time.
0 commit comments