Skip to content

Commit 6567a1f

Browse files
authored
Merge pull request #25 from kamal-kaur04/readme-and-command-changes
update: readme and config updation, Profile Name change
2 parents ae71996 + f9ceadf commit 6567a1f

File tree

11 files changed

+49
-52
lines changed

11 files changed

+49
-52
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# testng-appium-app-browserstack
22

3-
This repository demonstrates how to run Appium tests in [TestNG](http://testng.org) on BrowserStack App Automate.
3+
This repository demonstrates how to run Appium tests in [TestNG](http://testng.org) on BrowserStack App Automate using BrowserStack SDK.
44

55
![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)
66

@@ -39,15 +39,18 @@ mvn clean
3939

4040
Getting Started with Appium tests in TestNg on BrowserStack couldn't be easier!
4141

42-
### **Run first test :**
42+
### **Run Sample test :**
4343

4444
- Switch to one of the following directories: [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples)
45-
- Run the following maven command `mvn test -P first`
45+
- Run the following maven command `mvn test -P sample-test`
4646

4747
### **Use Local testing for apps that access resources hosted in development or testing environments :**
4848

49-
- Simply configure the `browserstackLocal` parameter in the `browserstack.yml` file accordingly in [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/).
50-
- You can use the `LocalSample` app provided in both folder [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/) to run your test. Change the app parameter in the `browserstack.yml` file and run the tests with the following command: `mvn test -P local`
49+
- Simply configure the `browserstackLocal` parameter in the `browserstack.yml` file accordingly in [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples).
50+
```
51+
browserstackLocal: true
52+
```
53+
- You can use the `LocalSample` app provided in both folder [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples) to run your test. Change the app parameter in the `browserstack.yml` file and run the tests with the following command: `mvn test -P sample-local-test`
5154

5255

5356
**Note**: If you are facing any issues, refer [Getting Help section](#Getting-Help)
-2.47 MB
Binary file not shown.

android/testng-examples/browserstack.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ userName: BROWSERSTACK_USERNAME
77
accessKey: BROWSERSTACK_ACCESS_KEY
88

99
# ======================
10-
# Organizing your tests
10+
# BrowserStack Reporting
1111
# ======================
12-
# Use `projectName`, `buildName`, `name` capabilities to organise your tests
13-
# `name` is the name of your test sessions and is automatically picked from your
14-
# test name and doesn't need to be set manually when using BrowserStack SDK
15-
# `buildName` is used to name your CI/CD job or the execution of your test suite.
16-
# Ensure you add a dynamic identifier, like an incremental build number from your
17-
# CI/CD or timestamp at the end of every build; otherwise tests from different
18-
# executions will be grouped together on BrowserStack
19-
buildName: browserstack-build
20-
# Use `projectName` to set the name of your project. Example, Marketing Website
21-
projectName: TestNg Android Project
22-
# Use `framework` to set the framework of your project. Example, testng, cucumber, cucumber-testng
12+
# The following capabilities are used to set up reporting on BrowserStack:
13+
# Set 'projectName' to the name of your project. Example, Marketing Website
14+
projectName: BrowserStack Samples
15+
# Set `buildName` as the name of the job / testsuite being run
16+
buildName: browserstack build
17+
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
18+
# buildName. Choose your buildIdentifier format from the available expressions:
19+
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
20+
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
21+
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
22+
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
23+
# Set `framework` of your test suite. Example, `testng`, `cucumber`, `cucumber-testng`
24+
# This property is needed to send test context to BrowserStack (test name, status)
2325
framework: testng
2426

25-
source: testng:sample-sdk:v1.0
27+
source: testng:appium-sample-sdk:v1.0
2628

2729
app: ./WikipediaSample.apk
28-
# app: ./LocalSample.ipa #For running local tests
30+
#app: ./LocalSample.apk #For running local tests
2931

3032
# =======================================
3133
# Platforms (Browsers / Devices to test)

android/testng-examples/pom.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
<artifactId>selenium-remote-driver</artifactId>
4141
<version>4.6.0</version>
4242
</dependency>
43-
<dependency>
44-
<groupId>com.browserstack</groupId>
45-
<artifactId>browserstack-local-java</artifactId>
46-
<version>1.0.3</version>
47-
</dependency>
4843
<dependency>
4944
<groupId>com.googlecode.json-simple</groupId>
5045
<artifactId>json-simple</artifactId>
@@ -94,31 +89,31 @@
9489

9590
<profiles>
9691
<profile>
97-
<id>first</id>
92+
<id>sample-test</id>
9893
<build>
9994
<plugins>
10095
<plugin>
10196
<groupId>org.apache.maven.plugins</groupId>
10297
<artifactId>maven-surefire-plugin</artifactId>
10398
<configuration>
10499
<suiteXmlFiles>
105-
<suiteXmlFile>src/test/resources/com/browserstack/first.testng.xml</suiteXmlFile>
100+
<suiteXmlFile>src/test/resources/com/browserstack/sample-test.testng.xml</suiteXmlFile>
106101
</suiteXmlFiles>
107102
</configuration>
108103
</plugin>
109104
</plugins>
110105
</build>
111106
</profile>
112107
<profile>
113-
<id>local</id>
108+
<id>sample-local-test</id>
114109
<build>
115110
<plugins>
116111
<plugin>
117112
<groupId>org.apache.maven.plugins</groupId>
118113
<artifactId>maven-surefire-plugin</artifactId>
119114
<configuration>
120115
<suiteXmlFiles>
121-
<suiteXmlFile>src/test/resources/com/browserstack/local.testng.xml</suiteXmlFile>
116+
<suiteXmlFile>src/test/resources/com/browserstack/sample-local-test.testng.xml</suiteXmlFile>
122117
</suiteXmlFiles>
123118
</configuration>
124119
</plugin>

ios/testng-examples/LocalSample.ipa

-3.02 MB
Binary file not shown.

ios/testng-examples/browserstack.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
# =============================
22
# Set BrowserStack Credentials
33
# =============================
4-
# Add your BrowserStack userName and acccessKey here or set BROWSERSTACK_USERNAME and
4+
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
55
# BROWSERSTACK_ACCESS_KEY as env variables
66
userName: BROWSERSTACK_USERNAME
77
accessKey: BROWSERSTACK_ACCESS_KEY
88

99
# ======================
10-
# Organizing your tests
10+
# BrowserStack Reporting
1111
# ======================
12-
# Use `projectName`, `buildName`, `name` capabilities to organise your tests
13-
# `name` is the name of your test sessions and is automatically picked from your
14-
# test name and doesn't need to be set manually when using BrowserStack SDK
15-
# `buildName` is used to name your CI/CD job or the execution of your test suite.
16-
# Ensure you add a dynamic identifier, like an incremental build number from your
17-
# CI/CD or timestamp at the end of every build; otherwise tests from different
18-
# executions will be grouped together on BrowserStack
19-
buildName: browserstack-build
20-
# Use `projectName` to set the name of your project. Example, Marketing Website
21-
projectName: TestNg Android Project
22-
# Use `framework` to set the framework of your project. Example, testng, cucumber, cucumber-testng
12+
# The following capabilities are used to set up reporting on BrowserStack:
13+
# Set 'projectName' to the name of your project. Example, Marketing Website
14+
projectName: BrowserStack Samples
15+
# Set `buildName` as the name of the job / testsuite being run
16+
buildName: browserstack build
17+
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
18+
# buildName. Choose your buildIdentifier format from the available expressions:
19+
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
20+
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
21+
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
22+
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
23+
# Set `framework` of your test suite. Example, `testng`, `cucumber`, `cucumber-testng`
24+
# This property is needed to send test context to BrowserStack (test name, status)
2325
framework: testng
2426

25-
source: testng:sample-sdk:v1.0
27+
source: testng:appium-sample-sdk:v1.0
2628

2729
app: ./BStackSampleApp.ipa
28-
# app: ./LocalSample.ipa #For running local tests
30+
#app: ./LocalSample.ipa #For running local tests
2931

3032
# =======================================
3133
# Platforms (Browsers / Devices to test)

ios/testng-examples/pom.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
<artifactId>selenium-remote-driver</artifactId>
4141
<version>4.6.0</version>
4242
</dependency>
43-
<dependency>
44-
<groupId>com.browserstack</groupId>
45-
<artifactId>browserstack-local-java</artifactId>
46-
<version>1.0.3</version>
47-
</dependency>
4843
<dependency>
4944
<groupId>com.googlecode.json-simple</groupId>
5045
<artifactId>json-simple</artifactId>
@@ -94,31 +89,31 @@
9489

9590
<profiles>
9691
<profile>
97-
<id>first</id>
92+
<id>sample-test</id>
9893
<build>
9994
<plugins>
10095
<plugin>
10196
<groupId>org.apache.maven.plugins</groupId>
10297
<artifactId>maven-surefire-plugin</artifactId>
10398
<configuration>
10499
<suiteXmlFiles>
105-
<suiteXmlFile>src/test/resources/com/browserstack/first.testng.xml</suiteXmlFile>
100+
<suiteXmlFile>src/test/resources/com/browserstack/sample-test.testng.xml</suiteXmlFile>
106101
</suiteXmlFiles>
107102
</configuration>
108103
</plugin>
109104
</plugins>
110105
</build>
111106
</profile>
112107
<profile>
113-
<id>local</id>
108+
<id>sample-local-test</id>
114109
<build>
115110
<plugins>
116111
<plugin>
117112
<groupId>org.apache.maven.plugins</groupId>
118113
<artifactId>maven-surefire-plugin</artifactId>
119114
<configuration>
120115
<suiteXmlFiles>
121-
<suiteXmlFile>src/test/resources/com/browserstack/local.testng.xml</suiteXmlFile>
116+
<suiteXmlFile>src/test/resources/com/browserstack/sample-local-test.testng.xml</suiteXmlFile>
122117
</suiteXmlFiles>
123118
</configuration>
124119
</plugin>

0 commit comments

Comments
 (0)