|
1 | | -# PHPUnit-Browserstack |
| 1 | +# phpunit-browserstack |
2 | 2 |
|
3 | | -Run [PHPUnit](https://github.com/sebastianbergmann/phpunit) scripts on BrowserStack. |
| 3 | +[PHPUnit](https://github.com/sebastianbergmann/phpunit) Integration with BrowserStack. |
4 | 4 |
|
5 | | -## Usage |
| 5 | +## Setup |
6 | 6 |
|
7 | | -### Prerequisites |
8 | | - |
9 | | -composer and php |
10 | | - |
11 | | -### Clone the repo |
12 | | - |
13 | | -`git clone https://github.com/browserstack/phpunit-browserstack.git` |
14 | | - |
15 | | -### Install dependencies |
16 | | - |
17 | | -Navigate to the root directory for testing and then install the dependencies by running |
18 | | - |
19 | | -`composer install` |
20 | | - |
21 | | -### BrowserStack Authentication |
22 | | - |
23 | | -Export the environment variables for the username and access key of your BrowserStack account. |
24 | | -These can be found on the automate accounts page on [BrowserStack](https://www.browserstack.com/accounts/automate) |
25 | | - |
26 | | -`export BROWSERSTACK_USERNAME=<browserstack-username>` |
27 | | - |
28 | | -`export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>` |
| 7 | +- Clone the repo |
| 8 | +- Install dependencies `composer install` |
| 9 | +- Update `*.conf.json` files inside the `config/` directory with your BrowserStack Username and Access Key. (These can be found in the [settings](https://www.browserstack.com/accounts/settings) section on BrowserStack accounts page) |
| 10 | +- Alternatively, you can export the environment variables for the Username and Access Key of your BrowserStack account. `export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>` |
29 | 11 |
|
30 | 12 | ### Run the tests |
31 | 13 |
|
32 | | - - To start a single test run: `composer test` or `composer test_single` |
33 | | - - To start parallel tests run: `composer test_parallel` |
34 | | - - To start local tests run: `composer test_local` |
35 | | - |
36 | | ------ |
37 | | - |
38 | | -#### Further Reading |
39 | | - |
40 | | -- [PHPUnit](https://phpunit.de/) |
41 | | -- [BrowserStack documentation for Automate](https://www.browserstack.com/automate/php) |
42 | | - |
43 | | -#### How to specify the capabilities |
| 14 | +- To run single test, run `composer single` |
| 15 | +- To run parallel tests, run `composer parallel` |
| 16 | +- To run local tests, run `composer local` |
44 | 17 |
|
45 | | -The [Code Generator](https://www.browserstack.com/automate/node#setting-os-and-browser) can come in very handy when specifying the capabilities especially for mobile devices. |
| 18 | +### Notes |
46 | 19 |
|
47 | | -Happy Testing! |
| 20 | +- In order to test on different set of browsers, check out our [code generator](https://www.browserstack.com/automate/python#setting-os-and-browser) |
0 commit comments