|
1 | | -# PHPUnit-Browserstack |
2 | | - |
3 | | -Run [PHPUnit](https://github.com/sebastianbergmann/phpunit) scripts on BrowserStack. |
4 | | - |
5 | | -## Usage |
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>` |
29 | | - |
30 | | -### Run the tests |
31 | | - |
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 |
44 | | - |
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. |
46 | | - |
47 | | -Happy Testing! |
| 1 | +# phpunit-browserstack |
| 2 | + |
| 3 | +[PHPUnit](https://github.com/sebastianbergmann/phpunit) Integration with BrowserStack |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Setup |
| 8 | +* Clone the repo |
| 9 | +* Install dependencies `composer install` |
| 10 | +* Update `*.conf.json` files inside the `config/` directory with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings) |
| 11 | + |
| 12 | +## Running your tests |
| 13 | +* To run a single test, run `composer single` |
| 14 | +* To run parallel tests, run `composer parallel` |
| 15 | +* To run local tests, run `composer local` |
| 16 | + |
| 17 | +## Notes |
| 18 | +* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate) |
| 19 | +* To test on a different set of browsers, check out our [platform configurator](https://www.browserstack.com/automate/php#setting-os-and-browser) |
| 20 | +* You can export the environment variables for the Username and Access Key of your BrowserStack account |
| 21 | + |
| 22 | + ``` |
| 23 | + export BROWSERSTACK_USERNAME=<browserstack-username> && |
| 24 | + export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key> |
| 25 | + ``` |
| 26 | + |
| 27 | +## Additional Resources |
| 28 | +* [Documentation for writing Automate test scripts in PHP](https://www.browserstack.com/automate/php) |
| 29 | +* [Customizing your tests on BrowserStack](https://www.browserstack.com/automate/capabilities) |
| 30 | +* [Browsers & mobile devices for selenium testing on BrowserStack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate) |
| 31 | +* [Using REST API to access information about your tests via the command-line interface](https://www.browserstack.com/automate/rest-api) |
0 commit comments