Skip to content

creasico/laravel-dusk-browserstack

Repository files navigation

Version License

Additional BrowserStack Local Supports for Laravel Dusk

Installation

Use Composer

$ composer require creasi/dusk-browserstack --dev

Usage

  1. Add WithBrowserStack to your existing DuskTestCase, like so

    use Laravel\Dusk\TestCase as BaseTestCase;
    use Creasi\DuskBrowserStack\WithBrowserStack;
    
    abstract class DuskTestCase extends BaseTestCase
    {
        use CreatesApplication;
        use WithBrowserStack;
    
        // ...
    }
  2. Update prepare method

    use Creasi\DuskBrowserStack\BrowserStack;
    
    public static function prepare()
    {
        if (BrowserStack::hasAccessKey()) {
            static::startBrowserStackLocal();
            return;
        }
    
        if (! static::runningInSail()) {
            static::startChromeDriver();
        }
    }
  3. Update driver method

    use Creasi\DuskBrowserStack\BrowserStack;
    
    protected function driver()
    {
        // ...
    
        $capabilities = DesiredCapabilities::chrome()
            ->setCapability(ChromeOptions::CAPABILITY, $options);
        
        return RemoteWebDriver::create(
            BrowserStack::getDriverURL(),
            $this->withBrowserStackCapabilities($capabilities)
        );
    }
  4. Last one, don't forget to update your .env file

    BROWSERSTACK_USERNAME='<your-browserstack-username>'
    BROWSERSTACK_ACCESS_KEY='<your-browserstack-access-key>'

License

This library is open-sourced software licensed under MIT license.

About

Additional BrowserStack support for Laravel Dusk

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy