mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-06 03:02:34 +01:00
dac1aa88d5
* Tests for authentication * Add db field to company table (required if we are doing jobs without an auth()->user() ) * Add Laravel Dusk for browser testing, add ability to set DB by incoming URL Hash
44 lines
975 B
PHP
44 lines
975 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Laravel\Dusk\TestCase as BaseTestCase;
|
|
use Facebook\WebDriver\Chrome\ChromeOptions;
|
|
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
|
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
|
|
|
abstract class DuskTestCase extends BaseTestCase
|
|
{
|
|
use CreatesApplication;
|
|
|
|
/**
|
|
* Prepare for Dusk test execution.
|
|
*
|
|
* @beforeClass
|
|
* @return void
|
|
*/
|
|
public static function prepare()
|
|
{
|
|
static::startChromeDriver();
|
|
}
|
|
|
|
/**
|
|
* Create the RemoteWebDriver instance.
|
|
*
|
|
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
|
|
*/
|
|
protected function driver()
|
|
{
|
|
$options = (new ChromeOptions)->addArguments([
|
|
'--disable-gpu',
|
|
'--headless'
|
|
]);
|
|
|
|
return RemoteWebDriver::create(
|
|
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
|
|
ChromeOptions::CAPABILITY, $options
|
|
)
|
|
);
|
|
}
|
|
}
|