PHP code example of derekmd / laravel-dusk-firefox
1. Go to this page and download the library: Download derekmd/laravel-dusk-firefox library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
derekmd / laravel-dusk-firefox example snippets
namespace Tests;
use Derekmd\Dusk\Concerns\TogglesHeadlessMode;
use Derekmd\Dusk\Firefox\SupportsFirefox;
use Facebook\WebDriver\Firefox\FirefoxOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Laravel\Dusk\TestCase as BaseTestCase;
abstract class DuskTestCase extends BaseTestCase
{
// ...
protected function driver()
{
$capabilities = DesiredCapabilities::firefox();
$capabilities->getCapability(FirefoxOptions::CAPABILITY)
->addArguments($this->filterHeadlessArguments([
'--headless',
'--window-size=1920,1080',
]))
->setPreference('devtools.console.stdout.content', true);
return RemoteWebDriver::create('http://localhost:4444', $capabilities);
}
}