Skip to content

Commit

Permalink
Merge branch '6.x' into 7.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jul 30, 2024
2 parents acd2a15 + 7018212 commit c6ebc7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 13 additions & 1 deletion src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class Options
*/
public static function resetArguments(): void
{
static::$arguments = [];
static::$arguments = [
'--disable-search-engine-choice-screen',
];
}

/**
Expand Down Expand Up @@ -219,6 +221,16 @@ public static function windowSize(int $width, int $height)
return static::addArgument('--window-size='.$width.','.$height);
}

/**
* Set the initial browser as maximized.
*
* @return static
*/
public static function fullscreen()
{
return static::addArgument('--start-maximized');
}

/**
* Set remote debugging port.
*
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function it_can_use_no_zygote_argument()
Options::noZygote();

$this->assertEquals(
['--no-sandbox', '--no-zygote'],
['--disable-search-engine-choice-screen', '--no-sandbox', '--no-zygote'],
Options::getChromeOptions()->toArray()['args']
);
}
Expand All @@ -63,7 +63,7 @@ public function it_can_use_ignore_ssl_errors_argument()
Options::ignoreSslErrors();

$this->assertEquals(
['--ignore-certificate-errors'],
['--disable-search-engine-choice-screen', '--ignore-certificate-errors'],
Options::getChromeOptions()->toArray()['args']
);
}
Expand All @@ -74,7 +74,7 @@ public function it_can_use_window_size_argument()
Options::windowSize(2048, 1080);

$this->assertEquals(
['--window-size=2048,1080'],
['--disable-search-engine-choice-screen', '--window-size=2048,1080'],
Options::getChromeOptions()->toArray()['args']
);
}
Expand All @@ -85,7 +85,7 @@ public function it_can_use_remote_debugging_port_argument()
Options::remoteDebuggingPort(9095);

$this->assertEquals(
['--remote-debugging-port=9095'],
['--disable-search-engine-choice-screen', '--remote-debugging-port=9095'],
Options::getChromeOptions()->toArray()['args']
);
}
Expand All @@ -96,7 +96,7 @@ public function it_can_use_user_agent_argument()
Options::userAgent('Dusk');

$this->assertEquals(
['--user-agent=Dusk'],
['--disable-search-engine-choice-screen', '--user-agent=Dusk'],
Options::getChromeOptions()->toArray()['args']
);
}
Expand Down

0 comments on commit c6ebc7a

Please sign in to comment.