PHPUnit Integration with BrowserStack
- Make sure that you have PHP installed on your system. You can download and install PHP using following commands in the terminal:
- MacOS:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install php
- Windows:
Note: For Windows, you can download PHP from here. Also, refer to this documentation for ensuring the accessibility of PHP through the Command Prompt.
sudo apt-get install curl libcurl3 libcurl3-dev php
-
Download composer in the project directory (Linux/MacOS, Windows).
Note: To use the composer command directly, it either should have been downloaded in the project directory or should be accessible globally which can be done by the command below:
mv composer.phar /usr/local/bin/composer
- Clone the repo
- Install dependencies using:
composer install
- Update
test.conf.json
file inside theconfig/
directory with your BrowserStack Username and Access Key
- To run tests, run:
composer test
- To run local tests, run:
composer local
Understand how many parallel sessions you need by using our Parallel Test Calculator
-
You can view your test results on the BrowserStack Automate dashboard
-
To test on a different set of browsers, check out our platform configurator
-
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>