File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ function Start-SeChrome {
1616 [System.IO.FileInfo ]$DefaultDownloadPath ,
1717 [bool ]$DisableBuiltInPDFViewer = $true ,
1818 [switch ]$Headless ,
19- [switch ]$Incognito
19+ [switch ]$Incognito ,
20+ [switch ]$Maximized
2021 )
2122
2223 $Chrome_Options = New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeOptions"
@@ -38,6 +39,10 @@ function Start-SeChrome {
3839 $Chrome_Options.AddArguments (' Incognito' )
3940 }
4041
42+ if ($Maximized ) {
43+ $Chrome_Options.AddArguments (' start-maximized' )
44+ }
45+
4146 if ($Arguments ) {
4247 $Chrome_Options.AddArguments ($Arguments )
4348 }
Original file line number Diff line number Diff line change @@ -77,10 +77,27 @@ Describe "Start-SeChrome headless" {
7777 }
7878}
7979
80- Describe " Start-SeChrome incognito" {
81- Context " Should Start Chrome Driver in headless mode" {
82- $Driver = Start-SeChrome - Incognito
83- Stop-SeDriver $Driver
80+ Describe " Start-SeChrome with Options" {
81+ Context " Should Start Chrome Driver with different startup options" {
82+ It " Start Chrome in Headless mode" {
83+ $Driver = Start-SeChrome - Headless
84+ Stop-SeDriver $Driver
85+ }
86+
87+ It " Start Chrome Maximized " {
88+ $Driver = Start-SeChrome - Maximized
89+ Stop-SeDriver $Driver
90+ }
91+
92+ It " Start Chrome Incognito " {
93+ $Driver = Start-SeChrome - Incognito
94+ Stop-SeDriver $Driver
95+ }
96+
97+ It " Start Chrome Maximized and Incognito " {
98+ $Driver = Start-SeChrome - Maximized - Incognito
99+ Stop-SeDriver $Driver
100+ }
84101 }
85102}
86103
You can’t perform that action at this time.
0 commit comments