2
2
3
3
namespace Tests;
4
4
5
+ use Illuminate\Support\Collection;
5
6
use Facebook\WebDriver\Chrome\ChromeOptions;
6
7
use Facebook\WebDriver\Remote\DesiredCapabilities;
7
8
use Facebook\WebDriver\Remote\RemoteWebDriver;
@@ -15,9 +16,8 @@ abstract class DuskTestCase extends BaseTestCase
15
16
* Prepare for Dusk test execution.
16
17
*
17
18
* @beforeClass
18
- * @return void
19
19
*/
20
- public static function prepare()
20
+ public static function prepare(): void
21
21
{
22
22
if (! static::runningInSail()) {
23
23
static::startChromeDriver();
@@ -26,14 +26,12 @@ abstract class DuskTestCase extends BaseTestCase
26
26
27
27
/**
28
28
* Create the RemoteWebDriver instance.
29
- *
30
- * @return \Facebook\WebDriver\Remote\RemoteWebDriver
31
29
*/
32
- protected function driver()
30
+ protected function driver(): RemoteWebDriver
33
31
{
34
32
$options = (new ChromeOptions)->addArguments(collect([
35
33
$this->shouldStartMaximized() ? '--start-maximized' : '--window-size=1920,1080',
36
- ])->unless($this->hasHeadlessDisabled(), function ($items) {
34
+ ])->unless($this->hasHeadlessDisabled(), function (Collection $items) {
37
35
return $items->merge([
38
36
'--disable-gpu',
39
37
'--headless',
@@ -50,21 +48,17 @@ abstract class DuskTestCase extends BaseTestCase
50
48
51
49
/**
52
50
* Determine whether the Dusk command has disabled headless mode.
53
- *
54
- * @return bool
55
51
*/
56
- protected function hasHeadlessDisabled()
52
+ protected function hasHeadlessDisabled(): bool
57
53
{
58
54
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
59
55
isset($_ENV['DUSK_HEADLESS_DISABLED']);
60
56
}
61
57
62
58
/**
63
59
* Determine if the browser window should start maximized.
64
- *
65
- * @return bool
66
60
*/
67
- protected function shouldStartMaximized()
61
+ protected function shouldStartMaximized(): bool
68
62
{
69
63
return isset($_SERVER['DUSK_START_MAXIMIZED']) ||
70
64
isset($_ENV['DUSK_START_MAXIMIZED']);
0 commit comments