Skip to content

Commit a77d6c4

Browse files
committed
updated readme
1 parent 79ea5cc commit a77d6c4

3 files changed

Lines changed: 48 additions & 5 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# browserstack-local-python
2+
3+
## Setup
4+
5+
```
6+
pip install browserstack-local
7+
```
8+
9+
## API
10+
11+
### Constructor
12+
13+
* `browserstack.Local()`: creates an instance of Local
14+
15+
### Methods
16+
17+
* `start(**options)`: starts Local instance with options. The options available are detailed below.
18+
* `stop()`: stops the Local instance
19+
* `isRunning()`: checks if Local instance is running
20+
21+
### Options
22+
23+
* `key`: BrowserStack Access Key
24+
* `v`: Provides verbose logging
25+
* `f`: If you want to test local folder rather internal server, provide path to folder as value of this option
26+
* `force`: Kill other running Browserstack Local
27+
* `only`: Restricts Local Testing access to specified local servers and/or folders
28+
* `forcelocal`: Route all traffic via local machine
29+
* `onlyAutomate`: Disable Live Testing and Screenshots, just test Automate
30+
* `proxyHost`: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
31+
* `proxyPort`: Port for the proxy, defaults to 3128 when -proxyHost is used
32+
* `proxyUser`: Username for connecting to proxy (Basic Auth Only)
33+
* `proxyPass`: Password for USERNAME, will be ignored if USERNAME is empty or not specified
34+
* `localIdentifier`: If doing simultaneous multiple local testing connections, set this uniquely for different processes
35+
* `hosts`: List of hosts and ports where Local must be enabled for eg. localhost,3000,1,localhost,3001,0
36+
* `logfile`: Path to file where Local logs be saved to
37+
* `binary_path`: Optional path to Local binary
38+
39+
40+
## Tests
41+
42+
To run the test suite run, `python -m unittest discover`.
43+

browserstack/local.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def start(self, **kwargs):
4545
break
4646

4747
while True:
48-
if self.is_running():
48+
if self.isRunning():
4949
break
5050
time.sleep(1)
5151

52-
def is_running(self):
52+
def isRunning(self):
5353
if (hasattr(self, 'proc')):
5454
return True if self.proc.poll() is None else False
5555
return False
@@ -91,7 +91,7 @@ def stop(self):
9191
try:
9292
self.proc.terminate()
9393
while True:
94-
if not self.is_running():
94+
if not self.isRunning():
9595
break
9696
time.sleep(1)
9797
except Exception as e:

tests/test_local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ def test_invalid_option(self):
4848
self.assertRaises(BrowserStackLocalError, lambda: self.local.start(random=True))
4949

5050
def test_running(self):
51-
self.assertFalse(self.local.is_running())
51+
self.assertFalse(self.local.isRunning())
5252
self.local.start()
53-
self.assertTrue(self.local.is_running())
53+
self.assertTrue(self.local.isRunning())

0 commit comments

Comments
 (0)