2017 © Pedro Peláez
 

library browserstack-local

PHP bindings for BrowserStack Local

image

browserstack/browserstack-local

PHP bindings for BrowserStack Local

  • Tuesday, May 29, 2018
  • by browserstack
  • Repository
  • 14 Watchers
  • 3 Stars
  • 227,915 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 7 Versions
  • 11 % Grown

The README.md

browserstack-local-php

Build Status, (*1)

PHP bindings for BrowserStack Local., (*2)

Installation

Installation is possible using Composer., (*3)

If you don't already use Composer, you can download the composer.phar binary:, (*4)

curl -sS https://getcomposer.org/installer | php

Then install the library:, (*5)

`php composer.phar require browserstack/browserstack-local`

Install all depenedencies: php composer.phar install, (*6)

Test the installation by running a simple test file, check out example.php in the main repository., (*7)

Example

require_once('vendor/autoload.php');
use BrowserStack\Local;

#creates an instance of Local
$bs_local = new Local();

#replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
$bs_local_args = array("key" => "<browserstack-accesskey>");

#starts the Local instance with the required arguments
$bs_local->start(bs_local_args);

#check if BrowserStack local instance is running
echo $bs_local->isRunning();

#stop the Local instance
$bs_local->stop();

Arguments

Apart from the key, all other BrowserStack Local modifiers are optional. For the full list of modifiers, refer BrowserStack Local modifiers. For examples, refer below -, (*8)

Verbose Logging

To enable verbose logging -, (*9)

$bs_local_args = array("key" => "<browserstack-accesskey>", "v" => true);

Folder Testing

To test local folder rather internal server, provide path to folder as value of this option -, (*10)

$bs_local_args = array("key" => "<browserstack-accesskey>", "f" => "/my/awesome/folder");

Force Start

To kill other running Browserstack Local instances -, (*11)

$bs_local_args = array("key" => "<browserstack-accesskey>", "force" => true);

Only Automate

To disable local testing for Live and Screenshots, and enable only Automate -, (*12)

$bs_local_args = array("key" => "<browserstack-accesskey>", "onlyAutomate" => true);

Force Local

To route all traffic via local(your) machine -, (*13)

$bs_local_args = array("key" => "<browserstack-accesskey>", "forcelocal" => true);

Proxy

To use a proxy for local testing -, (*14)

  • proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
  • proxyUser: Username for connecting to proxy (Basic Auth Only)
  • proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
$bs_local_args = array("key" => "<browserstack-accesskey>", "proxyHost" => "127.0.0.1", "proxyPort" => "8000", "proxyUser" => "user", "proxyPass" => "password");

Local Proxy

To use local proxy in local testing -, (*15)

  • localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
  • localProxyUser: Username for connecting to proxy (Basic Auth Only)
  • localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
$bs_local_args = array("key" => "<browserstack-accesskey>", "localProxyHost" => "127.0.0.1", "localProxyPort" => "8000", "-localProxyUser" => "user", "-localProxyPass" => "password");

PAC (Proxy Auto-Configuration)

To use PAC (Proxy Auto-Configuration) in local testing -, (*16)

  • pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
$bs_local_args = array("key" => "<browserstack-accesskey>", "-pac-file" => "<pac_file_abs_path>");

Local Identifier

If doing simultaneous multiple local testing connections, set this uniquely for different processes -, (*17)

$bs_local_args = array("key" => "<browserstack-accesskey>", "localIdentifier" => "randomstring");

Additional Arguments

Binary Path

By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~/.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument. Path to specify local Binary path -, (*18)

$bs_local_args = array("key" => "<browserstack-accesskey>", "binarypath" => "/browserstack/BrowserStackLocal");

Logfile

To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory. To specify the path to file where the logs will be saved -, (*19)

$bs_local_args = array("key" => "<browserstack-accesskey>", "logfile" => "/browserstack/logs.txt");

Contribute

Testing is possible using PHPUnit., (*20)

To run the tests, run the command: phpunit, (*21)

Reporting bugs

You can submit bug reports either in the Github issue tracker., (*22)

Before submitting an issue please check if there is already an existing issue. If there is, please add any additional information give it a "+1" in the comments., (*23)

When submitting an issue please describe the issue clearly, including how to reproduce the bug, which situations it appears in, what you expect to happen, what actually happens, and what platform (operating system and version) you are using., (*24)

Pull Requests

We love pull requests! We are very happy to work with you to get your changes merged in, however, please keep the following in mind., (*25)

  • Adhere to the coding conventions you see in the surrounding code.
  • Include tests, and make sure all tests pass.
  • Before submitting a pull-request, clean up the git history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.

The Versions

29/05 2018

dev-master

9999999-dev https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

29/05 2018

dev-develop

dev-develop https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

19/09 2016

v1.1.0

1.1.0.0 https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

03/07 2016

v1.0.0

1.0.0.0 https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

03/07 2016

dev-stop

dev-stop https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

10/05 2016

v0.2.0

0.2.0.0 https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal

05/05 2016

v0.1.0

0.1.0.0 https://github.com/browserstack/browserstack-local-php

PHP bindings for BrowserStack Local

  Sources   Download

MIT

The Requires

  • php >=5.3.19

 

The Development Requires

selenium php browserstack local browserstacklocal