Skip to content

Commit 71eae1d

Browse files
authored
Updated JUnit With Appium README File (#4)
1 parent 95130c0 commit 71eae1d

File tree

1 file changed

+97
-51
lines changed

1 file changed

+97
-51
lines changed

README.md

Lines changed: 97 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1-
# JUnit ![pw](https://img.shields.io/badge/Junit5-25A162?style=for-the-badge&logo=junit5&logoColor=white)
2-
3-
<img height="300" src="https://img.shields.io/badge/Junit5-25A162?style=for-the-badge&logo=junit5&logoColor=white">
4-
5-
*JUnit is a popular unit testing framework for Java, and was an important part of test-driven development. It belongs to a family of unit testing frameworks known as xUnit.*
1+
# JUnit With Appium ![pw](https://img.shields.io/badge/Junit5-25A162?style=for-the-badge&logo=junit5&logoColor=white)
2+
3+
<p align="center">
4+
<img height="500" src="https://user-images.githubusercontent.com/95698164/171858482-4986e439-2a31-4947-91e7-93fa9eae7652.png">
5+
</p>
6+
7+
<p align="center">
8+
<a href="https://www.lambdatest.com/blog/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit" target="_bank">Blog</a>
9+
&nbsp; &#8901; &nbsp;
10+
<a href="https://www.lambdatest.com/support/docs/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit" target="_bank">Docs</a>
11+
&nbsp; &#8901; &nbsp;
12+
<a href="https://www.lambdatest.com/learning-hub/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit" target="_bank">Learning Hub</a>
13+
&nbsp; &#8901; &nbsp;
14+
<a href="https://www.lambdatest.com/newsletter/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit" target="_bank">Newsletter</a>
15+
&nbsp; &#8901; &nbsp;
16+
<a href="https://www.lambdatest.com/certifications/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit" target="_bank">Certifications</a>
17+
&nbsp; &#8901; &nbsp;
18+
<a href="https://www.youtube.com/c/LambdaTest" target="_bank">YouTube</a>
19+
</p>
20+
&emsp;
21+
&emsp;
22+
&emsp;
23+
24+
*JUnit is a popular unit testing framework for Java, and was an important part of test-driven development. It belongs to a family of unit testing frameworks known as xUnit. Perform [JUnit test on LambdaTest's online cloud](https://www.lambdatest.com/appium-mobile-testing).*
625

726
*Learn the basics of [Appium testing on the LambdaTest platform](https://www.lambdatest.com/support/docs/getting-started-with-appium-testing/).*
827

28+
[<img height="53" width="200" src="https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png">](https://accounts.lambdatest.com/register)
29+
930
## Table of Contents
1031

11-
* [Objective](#objective)
1232
* [Pre-requisites](#pre-requisites)
1333
* [Run Your First Test](#run-your-first-test)
14-
15-
## JUnit With Appium
16-
17-
In this topic, you will learn how to configure and run your **JUnit** automation testing scripts with **Appium** on **LambdaTest Real Device Cloud platform**.
18-
19-
## Objective
20-
21-
By the end of this topic, you will be able to:
22-
23-
1. Run a sample automation script of **JUnit** for application testing with **Appium** on **LambdaTest**.
24-
2. Run test cases in **parallel** using JUnit with Appium to reduce build times.
25-
3. Learn more about Desired Capabilities for Appium testing.
26-
4. Explore advanced features of LambdaTest.
34+
* [Executing The Test](#executing-the-test)
2735

2836
## Pre-requisites
2937

@@ -33,7 +41,7 @@ Before you can start performing App automation testing with Appium, you would ne
3341

3442
### Clone The Sample Project
3543

36-
**Step-1:** Clone the LambdaTest’s :link: [LT-appium-java-junit](https://github.com/LambdaTest/LT-appium-java-junit) repository and navigate to the code directory as shown below:
44+
Clone the LambdaTest’s :link: [LT-appium-java-junit](https://github.com/LambdaTest/LT-appium-java-junit) repository and navigate to the code directory as shown below:
3745

3846
```bash
3947
git clone https://github.com/LambdaTest/LT-appium-java-junit
@@ -44,46 +52,59 @@ cd LT-appium-java-junit
4452

4553
Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest. To obtain your access credentials, [purchase a plan](https://billing.lambdatest.com/billing/plans) or access the [Automation Dashboard](https://appautomation.lambdatest.com/).
4654

47-
**Step-2:** Set LambdaTest `Username` and `Access Key` in environment variables.
55+
Set LambdaTest `Username` and `Access Key` in environment variables.
4856

4957
**For Linux/macOS:**
50-
{`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}" \\
51-
export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}`}"
58+
59+
```bash
60+
export LT_USERNAME="YOUR_LAMBDATEST_USERNAME" \
61+
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
62+
```
5263

5364
**For Windows:**
54-
{`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}" \`
55-
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}`}"
56-
65+
66+
```bash
67+
set LT_USERNAME="YOUR_LAMBDATEST_USERNAME" `
68+
set LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
69+
```
70+
5771
### Upload Your Application
5872

59-
**Step-3:** Upload your **_iOS_** application (.ipa file) or **_android_** application (.apk file) to the LambdaTest servers using our **REST API**. You need to provide your **Username** and **AccessKey** in the format `Username:AccessKey` in the **cURL** command for authentication. Make sure to add the path of the **appFile** in the cURL request. Here is an example cURL request to upload your app using our REST API:
73+
Upload your **_iOS_** application (.ipa file) or **_android_** application (.apk file) to the LambdaTest servers using our **REST API**. You need to provide your **Username** and **AccessKey** in the format `Username:AccessKey` in the **cURL** command for authentication. Make sure to add the path of the **appFile** in the cURL request. Here is an example cURL request to upload your app using our REST API:
6074

6175
**Using App File:**
6276

6377
**For Linux/macOS:**
6478

65-
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" \\
66-
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \\
67-
--form 'name="Android_App"' \\
79+
```bash
80+
curl -u "YOUR_LAMBDATEST_USERNAME:YOUR_LAMBDATEST_ACCESS_KEY" \
81+
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \
82+
--form 'name="Android_App"' \
6883
--form 'appFile=@"/Users/macuser/Downloads/proverbial_android.apk"'
69-
`}
84+
```
7085

7186
**For Windows:**
7287

73-
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/proverbial_android.apk""`}
88+
```bash
89+
curl -u "YOUR_LAMBDATEST_USERNAME:YOUR_LAMBDATEST_ACCESS_KEY" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/proverbial_android.apk""
90+
```
7491

7592
**Using App URL:**
7693

7794
**For Linux/macOS:**
7895

79-
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" \\
80-
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \\
81-
--form 'name="Android_App"' \\
82-
--form 'url="https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk"'`}
96+
```bash
97+
curl -u "YOUR_LAMBDATEST_USERNAME:YOUR_LAMBDATEST_ACCESS_KEY" \
98+
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \
99+
--form 'name="Android_App"' \
100+
--form 'url="https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk"'
101+
```
83102

84103
**For Windows:**
85104

86-
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -d "{\"url\":\"https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk\",\"name\":\"sample.apk\"}"`}
105+
```bash
106+
curl -u "YOUR_LAMBDATEST_USERNAME:YOUR_LAMBDATEST_ACCESS_KEY" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -d "{"url":"https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk","name":"sample.apk"}"
107+
```
87108

88109
**Tip:**
89110

@@ -98,7 +119,7 @@ Once you are done with the above-mentioned steps, you can initiate your first JU
98119

99120
### Configuring Your Test Capabilities
100121

101-
**Step-4:** You can update your custom capabilities in test scripts. In this sample project, we are passing platform name, platform version, device name and app url (generated earlier) along with other capabilities like build name and test name via capabilities object. The capabilities object in the sample code are defined as:
122+
You can update your custom capabilities in test scripts. In this sample project, we are passing platform name, platform version, device name and app url (generated earlier) along with other capabilities like build name and test name via capabilities object. The capabilities object in the sample code are defined as:
102123

103124
<Tabs className="docs__val">
104125
<TabItem value="android-config" label="Android" default>
@@ -148,15 +169,15 @@ DesiredCapabilities capabilities = new DesiredCapabilities();
148169
- You must add the generated **APP_URL** to the `"app"` capability in the config file.
149170
- You can generate capabilities for your test requirements with the help of our inbuilt **[Capabilities Generator tool](https://www.lambdatest.com/capabilities-generator/beta/index.html)**. A more Detailed Capability Guide is available [here](https://www.lambdatest.com/support/docs/desired-capabilities-in-appium/).
150171

151-
### Executing The Test
172+
## Executing The Test
152173

153-
**Step-5:** Execute the following commands to install the required dependencies:
174+
Execute the following commands to install the required dependencies:
154175

155176
```bash
156177
mvn clean
157178
```
158179

159-
**Step-6:** The tests can be executed in the terminal using the following command:
180+
The tests can be executed in the terminal using the following command:
160181

161182
<Tabs className="docs__val">
162183
<TabItem value="android-exec" label="Android" default>
@@ -184,21 +205,46 @@ mvn test ios.java
184205
- [How to test locally hosted apps](https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/)
185206
- [How to integrate LambdaTest with CI/CD](https://www.lambdatest.com/support/docs/integrations-with-ci-cd-tools/)
186207

208+
## Documentation & Resources :books:
209+
210+
211+
Visit the following links to learn more about LambdaTest's features, setup and tutorials around test automation, mobile app testing, responsive testing, and manual testing.
212+
213+
* [LambdaTest Documentation](https://www.lambdatest.com/support/docs/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit)
214+
* [LambdaTest Blog](https://www.lambdatest.com/blog/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit)
215+
* [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit)
216+
187217
## LambdaTest Community :busts_in_silhouette:
188218
189-
The [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe.
219+
The [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe 🌎
190220
191-
## Documentation & Resources :books:
192-
193-
If you want to learn more about the LambdaTest's features, setup, and usage, visit the [LambdaTest documentation](https://www.lambdatest.com/support/docs/). You can also find in-depth tutorials around test automation, mobile app testing, responsive testing, manual testing on [LambdaTest Blog](https://www.lambdatest.com/blog/) and [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/).
194-
195-
## About LambdaTest
221+
## What's New At LambdaTest ❓
196222

197-
[LambdaTest](https://www.lambdatest.com) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.
223+
To stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/)
224+
225+
## About LambdaTest
226+
227+
[LambdaTest](https://www.lambdatest.com) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.
228+
229+
### Features
230+
231+
* Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments.
232+
* Real-time cross browser testing on 3000+ environments.
233+
* Test on Real device cloud
234+
* Blazing fast test automation with HyperExecute
235+
* Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale.
236+
* Smart Visual Regression Testing on cloud
237+
* 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more.
238+
* Automated Screenshot testing across multiple browsers in a single click.
239+
* Local testing of web and mobile apps.
240+
* Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.
241+
* Geolocation testing of web and mobile apps across 53+ countries.
242+
* LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports
243+
244+
[<img height="53" width="200" src="https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png">](https://accounts.lambdatest.com/register)
198245

199-
[<img height="70" src="https://user-images.githubusercontent.com/70570645/169649126-ed61f6de-49b5-4593-80cf-3391ca40d665.PNG">](https://accounts.lambdatest.com/register)
200246

201247
## We are here to help you :headphones:
202248

203-
* Got a query? we are available 24x7 to help. [Contact Us](mailto:support@lambdatest.com)
204-
* For more info, visit - https://www.lambdatest.com
249+
* Got a query? we are available 24x7 to help. [Contact Us](support@lambdatest.com)
250+
* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=LT-appium-java-junit)

0 commit comments

Comments
 (0)