|
1 | 1 | # testng-appium-app-browserstack
|
2 | 2 |
|
3 |
| -[TestNG](http://testng.org) Integration with BrowserStack. |
| 3 | +This repository demonstrates how to run Appium tests in [TestNG](http://testng.org) on BrowserStack App Automate. |
4 | 4 |
|
5 | 5 | 
|
6 | 6 |
|
| 7 | +## Setup |
| 8 | + |
7 | 9 | ### Requirements
|
8 | 10 |
|
9 | 11 | 1. Java 8+
|
@@ -33,76 +35,24 @@ cd ios/testng-examples
|
33 | 35 | mvn clean
|
34 | 36 | ```
|
35 | 37 |
|
36 |
| -### Update `username` and `access_key` keys in *.conf.json |
37 |
| - |
38 |
| -- Update *.conf.json files for `username`, `access_key` keys inside the [android/testng-examples/src/test/resources/](android/testng-examples/src/test/resources) for Android examples and inside [ios/testng-examples/src/test/resources](ios/testng-examples/src/test/resources) for iOS examples with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings). |
39 |
| - |
40 |
| -- Note: You can also export the environment variables for the Username and Access Key of your BrowserStack account. |
41 |
| - |
42 |
| - ``` |
43 |
| - export BROWSERSTACK_USERNAME=<browserstack-username> && |
44 |
| - export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key> |
45 |
| - ``` |
46 |
| -
|
47 |
| -### Upload app and update `app` key in *.conf.json |
48 |
| -
|
49 |
| -- Android |
50 |
| - - Upload your Native App (.apk or .aab file) to BrowserStack servers using upload API: |
51 |
| -
|
52 |
| - ``` |
53 |
| - curl -u "username:access_key" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.apk" |
54 |
| - ``` |
55 |
| - - If you do not have an .apk file and looking to simply try App Automate, [you can download our sample app and upload](https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk) |
56 |
| - to the BrowserStack servers using the above API. |
57 |
| -
|
58 |
| - - You can use public url as well to upload your app |
59 |
| -
|
60 |
| - ``` |
61 |
| - curl -u "username:access_key" \ |
62 |
| - -X POST "https://api-cloud.browserstack.com/app-automate/upload" \ |
63 |
| - -F "url=https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk" |
64 |
| - ``` |
65 |
| - - Please note the value of app_url in the API response (bs://f7c874f21852.... in the above examples). |
66 |
| -
|
67 |
| - - Update *.conf.json with value of `app_url`(got from response) for `app` key |
68 |
| -
|
69 |
| - - Files inside the [android/testng-examples/src/test/resources/](android/testng-examples/src/test/resources) for Android examples and inside [ios/testng-examples/src/test/resources](ios/testng-examples/src/test/resources) for iOS examples. |
70 |
| -
|
71 |
| -
|
72 | 38 | ## Getting Started
|
73 | 39 |
|
74 | 40 | Getting Started with Appium tests in TestNg on BrowserStack couldn't be easier!
|
75 | 41 |
|
76 | 42 | ### **Run first test :**
|
77 | 43 |
|
78 | 44 | - Switch to `run_first_test` directory under [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples)
|
79 |
| -- Then run |
80 |
| - ```sh |
81 |
| - mvn test -P first |
82 |
| - ``` |
83 |
| -- Alternatively, you can follow the steps outlined in the documentation - [Get Started with your first test on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng) |
| 45 | +- Follow the steps outlined in the documentation - [Get Started with your first test on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng) |
84 | 46 |
|
85 | 47 | ### **Speed up test execution with parallel testing :**
|
86 | 48 |
|
87 | 49 | - Switch to `run_parallel_test` directory under [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/)
|
88 |
| -- Then run |
89 |
| - ```sh |
90 |
| - mvn test -P parallel |
91 |
| - ``` |
92 |
| -
|
93 |
| -- Alternatively, you can follow the steps outlined in the documentation - [Get Started with your parallel test on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/parallelize-tests) |
| 50 | +- Follow the steps outlined in the documentation - [Get Started with parallel testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/parallelize-tests) |
94 | 51 |
|
95 | 52 | ### **Use Local testing for apps that access resources hosted in development or testing environments :**
|
96 | 53 |
|
97 |
| -- If you do not have an local .apk file and looking to simply try local for App Automate, [you can download our sample local app and upload](https://www.browserstack.com/app-automate/sample-apps/android/LocalSample.apk) |
98 |
| - to the BrowserStack servers using the same app upload API. |
99 |
| -
|
100 | 54 | - Switch to `run_local_test` directory under [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/)
|
101 |
| -- Then run |
102 |
| - ```sh |
103 |
| - mvn test -P local |
104 |
| - ``` |
105 |
| -- Alternatively, you can follow the steps outlined in the documentation - [Get Started with Local testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/local-testing) |
| 55 | +- Follow the steps outlined in the documentation - [Get Started with Local testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/local-testing) |
106 | 56 |
|
107 | 57 | **Note**: If you are facing any issues, refer [Getting Help section](#Getting-Help)
|
108 | 58 |
|
|
0 commit comments