creasi / dusk-browserstack
Additional BrowserSstack Supports for Laravel Dusk
Fund package maintenance!
creasico
Installs: 11 059
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 3
Requires
- php: ^8.1
- ext-zip: *
- illuminate/console: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- laravel/dusk: ^7.0|^8.0
- symfony/process: ^6.0|^7.0
Requires (Dev)
- inertiajs/inertia-laravel: ^0.6.9
- laravel/pint: ^1.1
- nunomaduro/collision: ^7.4|^8.0
- orchestra/testbench: ^7.0|^8.0|^9.0
- orchestra/testbench-dusk: ^7.0|^8.0|^9.0
This package is auto-updated.
Last update: 2024-11-06 17:43:17 UTC
README
Additional BrowserStack Local Supports for Laravel Dusk
Installation
Use Composer
$ composer require creasi/dusk-browserstack --dev
Usage
-
Add
WithBrowserStack
to your existingDuskTestCase
, like souse Laravel\Dusk\TestCase as BaseTestCase; use Creasi\DuskBrowserStack\WithBrowserStack; abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; use WithBrowserStack; // ... }
-
Update
prepare
methoduse Creasi\DuskBrowserStack\BrowserStack; public static function prepare() { if (BrowserStack::hasAccessKey()) { static::startBrowserStackLocal(); return; } if (! static::runningInSail()) { static::startChromeDriver(); } }
-
Update
driver
methoduse Creasi\DuskBrowserStack\BrowserStack; protected function driver() { // ... $capabilities = DesiredCapabilities::chrome() ->setCapability(ChromeOptions::CAPABILITY, $options); return RemoteWebDriver::create( BrowserStack::getDriverURL(), $this->withBrowserStackCapabilities($capabilities) ); }
-
Last one, don't forget to update your
.env
fileBROWSERSTACK_USERNAME='<your-browserstack-username>' BROWSERSTACK_ACCESS_KEY='<your-browserstack-access-key>'
License
This library is open-sourced software licensed under MIT license.