Skip to content

Commit b19994d

Browse files
huzaifaiftikharagundawar
authored andcommitted
upgrade to python 3 (#6)
1 parent 094f486 commit b19994d

7 files changed

+23
-10
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ Refer [Getting Started with App Automate](https://www.browserstack.com/app-autom
88
For frameworks integration with BrowserStack, refer to their individual repositories -
99
- [Lettuce](https://github.com/browserstack/lettuce-appium-app-browserstack)
1010
- [Behave](https://github.com/browserstack/behave-appium-app-browserstack)
11+
12+
For python 2 support refer the branch
13+
- [python-2-master](https://github.com/browserstack/python-appium-app-browserstack/tree/python-2-master)

android/BrowserStackAndroid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
accessKey = "BROWSERSTACK_ACCESS_KEY"
99

1010
desired_caps = {
11-
"build": "Python Android",
11+
"build": "Python 3 Android",
1212
"device": "Samsung Galaxy S7",
1313
"app": "bs://<hashed app-id>"
1414
}

android/LocalSampleAndroid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
accessKey = "BROWSERSTACK_ACCESS_KEY"
1010

1111
desired_caps = {
12-
"build": "Python Android Local",
12+
"build": "Python 3 Android Local",
1313
"device": "Samsung Galaxy S7",
1414
"browserstack.local": True,
1515
"app": "bs://<hashed app-id>"
@@ -47,7 +47,7 @@ def stop_local():
4747
raise Exception("Cannot find the needed TextView element from app")
4848

4949
matched_string = test_element.text
50-
print matched_string
50+
print (matched_string)
5151
assert(matched_string.__contains__("The active connection is wifi"))
5252
assert(matched_string.__contains__("Up and running"))
5353

android/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
For installing the required packages, use the following command
44

55
```
6-
$ pip install -r requirements.txt
6+
$ pip3 install -r requirements.txt
77
```
88

99
## Running your tests
@@ -16,7 +16,9 @@ $ pip install -r requirements.txt
1616
```
1717

1818
- If you do not have an .apk file and looking to simply try App Automate, you can download our [sample app](https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk) and upload to the BrowserStack servers using the above API.
19+
- Run ```python3 BrowserStackAndroid.py```
1920
- For LocalSample tests, you can use our [local sample app](https://www.browserstack.com/app-automate/sample-apps/android/LocalSample.apk).
21+
- Run ```python3 LocalSampleAndroid.py```
2022
- Update the desired capability "app" with the App URL returned from the above API call
2123

2224
## Notes
@@ -27,3 +29,6 @@ For frameworks integration with BrowserStack, refer to their individual reposito
2729

2830
- [Lettuce](https://github.com/browserstack/lettuce-appium-app-browserstack)
2931
- [Behave](https://github.com/browserstack/behave-appium-app-browserstack)
32+
33+
For python 2 support refer the branch
34+
- [python-2-master](https://github.com/browserstack/python-appium-app-browserstack/tree/python-2-master)

ios/BrowserStackIOS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
accessKey = "BROWSERSTACK_ACCESS_KEY"
99

1010
desired_caps = {
11-
"build": "Python iOS",
11+
"build": "Python 3 iOS",
1212
"device": "iPhone 7",
1313
"app": "bs://<hashed app-id>"
1414
}

ios/LocalSampleIOS.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
accessKey = "BROWSERSTACK_ACCESS_KEY"
1010

1111
desired_caps = {
12-
"build": "Python iOS Local",
12+
"build": "Python 3 iOS Local",
1313
"device": "iPhone 7",
1414
"browserstack.local": True,
1515
"app": "bs://<hashed app-id>"
@@ -46,8 +46,8 @@ def existence_lambda(s):
4646
if result_string.__contains__("not working"):
4747
screenshot_file = "%s/screenshot.png" % os.getcwd()
4848
driver.save_screenshot(screenshot_file)
49-
print "Screenshot stored at %s" % screenshot_file
50-
print "Unexpected BrowserStackLocal test result"
49+
print ("Screenshot stored at %s" % screenshot_file)
50+
print ("Unexpected BrowserStackLocal test result")
5151
else:
5252
assert(result_string.__contains__("up and running"))
5353

ios/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
For installing the required packages, use the following command
44

55
```
6-
$ pip install -r requirements.txt
6+
$ pip3 install -r requirements.txt
77
```
88

99
## Running your tests
@@ -16,8 +16,10 @@ $ pip install -r requirements.txt
1616
```
1717

1818
- If you do not have an .ipa file and looking to simply try App Automate, you can download our [sample app](https://www.browserstack.com/app-automate/sample-apps/ios/BStackSampleApp.ipa) and upload to the BrowserStack servers using the above API.
19-
- For LocalSample tests, you can use our [local sample app](https://www.browserstack.com/app-automate/sample-apps/ios/LocalSample.ipa).
2019
- Update the desired capability "app" with the App URL returned from the above API call
20+
- Run ```python3 BrowserStackIOS.py```
21+
- For LocalSample tests, you can use our [local sample app](https://www.browserstack.com/app-automate/sample-apps/ios/LocalSample.ipa).
22+
- Run ```python3 LocalSampleIOS.py``` for local testing
2123

2224
## Notes
2325
* You can view your test results on the [BrowserStack App Automate dashboard](https://www.browserstack.com/app-automate)
@@ -27,3 +29,6 @@ For frameworks integration with BrowserStack, refer to their individual reposito
2729

2830
- [Lettuce](https://github.com/browserstack/lettuce-appium-app-browserstack)
2931
- [Behave](https://github.com/browserstack/behave-appium-app-browserstack)
32+
33+
For python 2 support refer the branch
34+
- [python-2-master](https://github.com/browserstack/python-appium-app-browserstack/tree/python-2-master)

0 commit comments

Comments
 (0)