https://github.com/browserstack/pytest-browserstack
https://github.com/browserstack/pytest-browserstack
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/browserstack/pytest-browserstack
- Owner: browserstack
- Created: 2022-02-11T04:47:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T13:53:19.000Z (over 1 year ago)
- Last Synced: 2025-04-22T21:06:46.911Z (11 months ago)
- Language: Python
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 12
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# PyTest with Browserstack
PyTest Integration with BrowserStack using SDK.

## Prerequisite
* Python3
## Setup
* 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.yml` configuration file, or by setting the `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables.
## Run sample test in parallel:
* To run the sample test across platforms defined in the configuration file run:
```
browserstack-sdk pytest -s tests/bstack-sample-test.py
```
## Run a sample local test:
* To run the sample local test across platforms defined in the configuration file, you just need to set `browserstackLocal` key as true in the `browserstack.yml` file and run:
```
browserstack-sdk pytest -s tests/bstack-local-test.py
```
## Notes
* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)
* To test on a different set of browsers, check out our [platform configurator](https://www.browserstack.com/automate/python#setting-os-and-browser)