Skip to content

Instantly share code, notes, and snippets.

@melihovv
Last active August 6, 2017 13:56
Show Gist options
  • Save melihovv/e0c936b320c574bf328e7d42c1f4b475 to your computer and use it in GitHub Desktop.
Save melihovv/e0c936b320c574bf328e7d42c1f4b475 to your computer and use it in GitHub Desktop.
How to use Laravel Dusk with Selenium and Firefox firefox plugin config
<?php
namespace Tests;
use Facebook\WebDriver\Firefox\FirefoxProfile;
use Laravel\Dusk\TestCase as BaseTestCase;
abstract class FirefoxDuskTestCase extends BaseTestCase
{
// Some other methods
/**
* Load firefox extensions.
*
* @param FirefoxProfile $profile
*/
protected function loadExtensions(FirefoxProfile $profile)
{
// Do not require extension to be signed.
// This allows us to load our custom extensions.
$profile->setPreference('xpinstall.signatures.required', false);
// Load custom plugin.
$profile->addExtension(
storage_path('extensions/firefox/some-plugin.xpi')
);
// Configure custom plugin.
$profile->setPreference('some-plugin.foo', 'foo');
$profile->setPreference('some-plugin.bar', 'bar');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment