Skip to content

Commit 458e282

Browse files
committed
Updating Readme
1 parent 7ceec9e commit 458e282

File tree

1 file changed

+19
-89
lines changed

1 file changed

+19
-89
lines changed

README.md

Lines changed: 19 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# junit-appium-app-browserstack
2-
[JUnit4](http://junit.org/junit4/) and [Junit5](https://junit.org/junit5/) Integration with BrowserStack.
32

4-
![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)
3+
This repository demonstrates how to run Appium tests in [JUnit4](http://junit.org/junit4/) and [Junit5](https://junit.org/junit5/) on BrowserStack App Automate.
54

6-
![JUnit](http://junit.org/junit4/images/junit-logo.png)
5+
![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)
76

87
## Setup
98

@@ -17,7 +16,8 @@
1716

1817
2. Maven
1918
- If Maven is not downloaded, download it from [here](https://maven.apache.org/download.cgi)
20-
- For installation, follow the instructions [here]((https://maven.apache.org/install.html))
19+
- For installation, follow the instructions [here](https://maven.apache.org/install.html)
20+
2121
### Install the dependencies
2222

2323
To install the dependencies for Android tests, run :
@@ -54,109 +54,39 @@ To install the dependencies for iOS tests, run :
5454
mvn clean
5555
```
5656

57-
### Update `username` and `access_key` keys in *.conf.json
58-
59-
- Junit4
60-
61-
- Update *.conf.json files for `username`, `access_key` keys inside the [android/junit4-examples/src/test/resources/](android/junit4-examples/src/test/resources) for Android examples and inside [ios/junit4-examples/src/test/resources](ios/junit4-examples/src/test/resources) for iOS examples with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings).
62-
63-
- Junit5
64-
65-
- Update *.conf.json files for `username`, `access_key` inside the [android/junit5-examples/src/test/resources](android/junit5-examples/src/test/resources) for Android examples and inside [ios/junit5-examples/src/test/resources](ios/junit5-examples/src/test/resources) for iOS examples with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings).
66-
67-
- Note: You can also export the environment variables for the Username and Access Key of your BrowserStack account.
68-
69-
```
70-
export BROWSERSTACK_USERNAME=<browserstack-username> &&
71-
export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
72-
```
73-
74-
### Upload app and update `app` key in *.conf.json
75-
76-
- Android
77-
- Upload your Native App (.apk file) to BrowserStack servers using upload API:
78-
79-
```
80-
curl -u "username:access_key" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.apk"
81-
```
82-
- 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)
83-
to the BrowserStack servers using the above API.
84-
85-
- You can use public url as well to upload your app
86-
87-
```
88-
curl -u "username:access_key" \
89-
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
90-
-F "url=https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk"
91-
```
92-
- Please note the value of app_url in the API response (bs://f7c874f21852.... in the above examples).
93-
94-
- Update *.conf.json with value of `app_url`(got from response) for `app` key
95-
96-
- Junit4
97-
98-
- Files inside the [android/junit4-examples/src/test/resources/](android/junit4-examples/src/test/resources) for Android examples and inside [ios/junit4-examples/src/test/resources](ios/junit4-examples/src/test/resources) for iOS examples.
99-
100-
- Junit5
101-
102-
- Files inside the [android/junit5-examples/src/test/resources](android/junit5-examples/src/test/resources) for Android examples and inside [ios/junit5-examples/src/test/resources](ios/junit5-examples/src/test/resources) for iOS examples .
103-
104-
10557
## Getting Started
10658

10759
Getting Started with Appium tests in Junit4 and Junit5 on BrowserStack couldn't be easier!
10860
10961
### **Run first test :**
11062
11163
- Junit4
112-
- Switch to `run_first_test` directory under [Android examples](android/junit4-examples) or [iOS examples](ios/junit4-examples)
113-
- Then run
114-
```sh
115-
mvn test -P first
116-
```
64+
- Switch to `run_first_test` directory under [Android Junit4 examples](android/junit4-examples) or [iOS Junit4 examples](ios/junit4-examples)
65+
- 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/junit)
66+
11767
- Junit5
118-
- Switch to `run_first_test` directory under [Android examples](android/junit5-examples) or [iOS examples](ios/junit5-examples)
119-
- Then run
120-
```sh
121-
mvn test -P first
122-
```
123-
- 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/junit)
68+
- Switch to `run_first_test` directory under [Android Junit5 examples](android/junit5-examples) or [iOS Junit5 examples](ios/junit5-examples)
69+
- 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/junit)
12470
12571
### **Speed up test execution with parallel testing :**
12672
12773
- Junit4
128-
- Switch to `run_parallel_test` directory under [Android examples](android/junit4-examples/) or [iOS examples](ios/junit4-examples/)
129-
- Then run
130-
```sh
131-
mvn test -P parallel
132-
```
74+
- Switch to `run_parallel_test` directory under [Android Junit4 examples](android/junit4-examples/) or [iOS Junit4 examples](ios/junit4-examples/)
75+
- 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/junit/parallelize-tests)
76+
13377
- Junit5
134-
- Switch to `run_parallel_test` directory under [Android examples](android/junit5-examples/) or [iOS examples](ios/junit5-examples/)
135-
- Then run
136-
```sh
137-
mvn test -P parallel
138-
```
139-
140-
- 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/junit/parallelize-tests)
78+
- Switch to `run_parallel_test` directory under [Android Junit5 examples](android/junit5-examples/) or [iOS Junit5 examples](ios/junit5-examples/)
79+
- 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/junit/parallelize-tests)
14180
14281
### **Use Local testing for apps that access resources hosted in development or testing environments :**
14382
144-
- 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)
145-
to the BrowserStack servers using the same app upload API.
146-
14783
- Junit4
148-
- Switch to `run_local_test` directory under [Android examples](android/junit4-examples/) or [iOS examples](ios/junit4-examples/)
149-
- Then run
150-
```sh
151-
mvn test -P local
152-
```
84+
- Switch to `run_local_test` directory under [Android Junit4 examples](android/junit4-examples/) or [iOS Junit4 examples](ios/junit4-examples/)
85+
- 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/junit/local-testing)
86+
15387
- Junit5
154-
- Switch to `run_local_test` directory under [Android examples](android/junit5-examples/) or [iOS examples](ios/junit5-examples/)
155-
- Then run
156-
```sh
157-
mvn test -P local
158-
```
159-
- 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/junit/local-testing)
88+
- Switch to `run_local_test` directory under [Android Junit5 examples](android/junit5-examples/) or [iOS Junit5 examples](ios/junit5-examples/)
89+
- 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/junit/local-testing)
16090
16191
**Note**: If you are facing any issues, refer [Getting Help section](#Getting-Help)
16292

0 commit comments

Comments
 (0)