Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
composer.lock
local.log
vendor/
bin/
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,47 @@
phpunit-browserstack
=========
# PHPUnit-Browserstack

This repository provides information and helpful tweaks to run your PhpUnit tests on the BrowserStack selenium cloud infrastructure.
Run [PHPUnit](https://github.com/sebastianbergmann/phpunit) scripts on BrowserStack.

You can run parallel as well as single test on the BrowserStack. Follow the steps in the respective folders for further information.
## Usage

### Prerequisites

composer and php

### Clone the repo

`git clone https://github.com/browserstack/phpunit-browserstack.git`

### Install dependencies

Navigate to the root directory for testing and then install the dependencies by running

`composer install`

### BrowserStack Authentication

Export the environment variables for the username and access key of your BrowserStack account.
These can be found on the automate accounts page on [BrowserStack](https://www.browserstack.com/accounts/automate)

`export BROWSERSTACK_USERNAME=<browserstack-username>`

`export BROWSERSTACK_KEY=<browserstack-access-key>`

### Run the tests

- To start a single test run: `composer test` or `composer test_single`
- To start parallel tests run: `composer test_parallel`
- To start local tests run: `composer test_local`

-----

#### Further Reading

###Further Reading
- [PHPUnit](https://phpunit.de/)
- [BrowserStack documentation for Automate](https://www.browserstack.com/automate/php)

#### How to specify the capabilities

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.

Happy Testing!
14 changes: 14 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"require": {
"brianium/paratest": "dev-master",
"browserstack/local": "dev-master",
"phpunit/phpunit-selenium": "dev-master",
"facebook/webdriver": "dev-master"
},
"scripts": {
"test": "vendor/bin/phpunit tests/SampleSeleniumTest.php",
"test_local": "vendor/bin/phpunit tests/LocalSeleniumTest.php",
"test_single": "vendor/bin/phpunit tests/SampleSeleniumTest.php",
"test_parallel": "vendor/bin/paratest -p 3 -f --phpunit=vendor/bin/phpunit tests/ParallelSeleniumTest.php"
}
}
87 changes: 0 additions & 87 deletions parallel-tests-phpunit/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions parallel-tests-phpunit/composer.json

This file was deleted.

17 changes: 0 additions & 17 deletions parallel-tests-phpunit/phpunit.xml

This file was deleted.

66 changes: 0 additions & 66 deletions parallel-tests-phpunit/test/SeleniumTest.php

This file was deleted.

84 changes: 0 additions & 84 deletions tests-phpunit/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions tests-phpunit/composer.json

This file was deleted.

Loading