PHP code example of creasi / dusk-browserstack

1. Go to this page and download the library: Download creasi/dusk-browserstack 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/ */

    

creasi / dusk-browserstack example snippets


   use Laravel\Dusk\TestCase as BaseTestCase;
   use Creasi\DuskBrowserStack\WithBrowserStack;
 
   abstract class DuskTestCase extends BaseTestCase
   {
       use CreatesApplication;
       use WithBrowserStack;

       // ...
   }
   

   use Creasi\DuskBrowserStack\BrowserStack;

   public static function prepare()
   {
       if (BrowserStack::hasAccessKey()) {
           static::startBrowserStackLocal();
           return;
       }

       if (! static::runningInSail()) {
           static::startChromeDriver();
       }
   }
   

   use Creasi\DuskBrowserStack\BrowserStack;

   protected function driver()
   {
       // ...

       $capabilities = DesiredCapabilities::chrome()
           ->setCapability(ChromeOptions::CAPABILITY, $options);
       
       return RemoteWebDriver::create(
           BrowserStack::getDriverURL(),
           $this->withBrowserStackCapabilities($capabilities)
       );
   }