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 {
77 [array ]$Arguments ,
88 [switch ]$HideVersionHint ,
99 [System.IO.FileInfo ]$DefaultDownloadPath ,
10- [bool ]$DisableBuiltInPDFViewer = $true
10+ [bool ]$DisableBuiltInPDFViewer = $true ,
11+ [bool ]$Headless = $false
1112 )
1213
1314 $Chrome_Options = New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeOptions"
@@ -21,6 +22,10 @@ function Start-SeChrome {
2122 $Chrome_Options.AddUserProfilePreference (' plugins' , @ {' always_open_pdf_externally' = $true ;})
2223 }
2324
25+ if ($Headless ) {
26+ $Chrome_Options.AddArguments (' headless' )
27+ }
28+
2429 if ($Arguments ) {
2530 $Chrome_Options.AddArguments ($Arguments )
2631 }
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ Describe "Start-SeChrome" {
77 }
88}
99
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+
1017Describe " Start-SeFirefox" {
1118 Context " Should Start Firefox Driver" {
1219 $Driver = Start-SeFirefox
You can’t perform that action at this time.
0 commit comments