Skip to content

Commit 86a4b35

Browse files
committed
Merge pull request #1 from browserstack/restructure
Restructure
2 parents 248f093 + 52ac098 commit 86a4b35

13 files changed

Lines changed: 210 additions & 326 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
composer.lock
2+
local.log
23
vendor/
34
bin/

README.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
1-
phpunit-browserstack
2-
=========
1+
# PHPUnit-Browserstack
32

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

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

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_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
839

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

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+
1347
Happy Testing!

composer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"require": {
3+
"brianium/paratest": "dev-master",
4+
"browserstack/local": "dev-master",
5+
"phpunit/phpunit-selenium": "dev-master",
6+
"facebook/webdriver": "dev-master"
7+
},
8+
"scripts": {
9+
"test": "vendor/bin/phpunit tests/SampleSeleniumTest.php",
10+
"test_local": "vendor/bin/phpunit tests/LocalSeleniumTest.php",
11+
"test_single": "vendor/bin/phpunit tests/SampleSeleniumTest.php",
12+
"test_parallel": "vendor/bin/paratest -p 3 -f --phpunit=vendor/bin/phpunit tests/ParallelSeleniumTest.php"
13+
}
14+
}

parallel-tests-phpunit/README.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

parallel-tests-phpunit/composer.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

parallel-tests-phpunit/phpunit.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

parallel-tests-phpunit/test/SeleniumTest.php

Lines changed: 0 additions & 66 deletions
This file was deleted.

tests-phpunit/README.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

tests-phpunit/composer.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)