PyTest Integration with BrowserStack using SDK.
- Python3
- Clone the repo with
git clone -b sdk https://github.com/browserstack/pytest-browserstack.git - It is recommended to use a virtual environment to install dependencies. To create a virtual environment:
python3 -m venv env source env/bin/activate # on Mac env\Scripts\activate # on Windows - Install dependencies
pip install -r requirements.txt - To run your automated tests using BrowserStack, you must provide a valid username and access key. This can be done either by providing your username and access key in the
browserstack.ymlconfiguration file, or by setting theBROWSERSTACK_USERNAMEandBROWSERSTACK_ACCESS_KEYenvironment variables.
- To run the sample test across platforms defined in the configuration file run:
browserstack-sdk pytest -s tests/bstack-sample-test.py
- To run the sample local test across platforms defined in the configuration file, you just need to set
browserstackLocalkey as true in thebrowserstack.ymlfile and run:
browserstack-sdk pytest -s tests/bstack-local-test.py
- You can view your test results on the BrowserStack Automate dashboard
- To test on a different set of browsers, check out our platform configurator
