Skip to content

Commit 7fed369

Browse files
Add hasStartMaximizedEnabled method. (#978)
* Add hasStartMaximizedEnabled method. * Fix formatting. * Update DuskTestCase.stub Co-authored-by: Taylor Otwell <[email protected]>
1 parent 4f09b8e commit 7fed369

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

stubs/DuskTestCase.stub

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class DuskTestCase extends BaseTestCase
3232
protected function driver()
3333
{
3434
$options = (new ChromeOptions)->addArguments(collect([
35-
'--window-size=1920,1080',
35+
$this->shouldStartMaximized() ? '--start-maximized' : '--window-size=1920,1080',
3636
])->unless($this->hasHeadlessDisabled(), function ($items) {
3737
return $items->merge([
3838
'--disable-gpu',
@@ -58,4 +58,15 @@ abstract class DuskTestCase extends BaseTestCase
5858
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
5959
isset($_ENV['DUSK_HEADLESS_DISABLED']);
6060
}
61+
62+
/**
63+
* Determine if the browser window should start maximized.
64+
*
65+
* @return bool
66+
*/
67+
protected function shouldStartMaximized()
68+
{
69+
return isset($_SERVER['DUSK_START_MAXIMIZED']) ||
70+
isset($_ENV['DUSK_START_MAXIMIZED']);
71+
}
6172
}

0 commit comments

Comments
 (0)