Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit c39b9b9

Browse files
committed
Add headless chrome configuration
1 parent 4fd6687 commit c39b9b9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/DuskIntegrationTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
namespace BeyondCode\VisualDiff\Tests;
44

5+
use Facebook\WebDriver\Remote\DesiredCapabilities;
6+
use Facebook\WebDriver\Remote\RemoteWebDriver;
57
use Laravel\Dusk\Browser;
68
use Orchestra\Testbench\Dusk\TestCase;
9+
use Facebook\WebDriver\Chrome\ChromeOptions;
710
use PHPUnit\Framework\ExpectationFailedException;
811
use BeyondCode\VisualDiff\VisualDiffServiceProvider;
912

@@ -14,6 +17,21 @@ protected function getPackageProviders($app)
1417
return [VisualDiffServiceProvider::class];
1518
}
1619

20+
protected function driver()
21+
{
22+
$options = (new ChromeOptions())->addArguments([
23+
'--disable-gpu',
24+
'--headless',
25+
'--window-size=1920, 1080',
26+
]);
27+
28+
return RemoteWebDriver::create(
29+
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
30+
ChromeOptions::CAPABILITY, $options
31+
)
32+
);
33+
}
34+
1735
protected function tearDown()
1836
{
1937
$files = glob(__DIR__.'/temp/*.png');

0 commit comments

Comments
 (0)