forked from caneara/tipsea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientTest.php
56 lines (49 loc) · 1.26 KB
/
ClientTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace App\Types;
use App\Support\Test;
use Laravel\Dusk\TestCase;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Illuminate\Foundation\Testing\DatabaseMigrations;
abstract class ClientTest extends TestCase
{
use Test;
use DatabaseMigrations;
/**
* Create the remote web driver instance.
*
*/
protected function driver() : RemoteWebDriver
{
$arguments = array_values(array_filter([
'--disable-gpu',
'--window-size=1920,1080',
env('DUSK_HEADLESS', true) ? '--headless' : '',
]));
return RemoteWebDriver::create(
'http://localhost:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY,
(new ChromeOptions())->addArguments($arguments)
)
);
}
/**
* Create a new Browser instance.
*
*/
protected function newBrowser($driver) : Browser
{
return new Browser($driver);
}
/**
* Prepare for the test execution.
* @beforeClass
*
*/
public static function prepare() : void
{
static::startChromeDriver();
}
}