Last active
August 6, 2017 13:56
-
-
Save melihovv/e0c936b320c574bf328e7d42c1f4b475 to your computer and use it in GitHub Desktop.
How to use Laravel Dusk with Selenium and Firefox firefox plugin config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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