Skip to content

Commit 6a3cc2b

Browse files
committed
Add README
1 parent 9ae25e4 commit 6a3cc2b

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
TestNG-BrowserStack
2+
=========
3+
4+
Sample for running [TestNG] tests with BrowserStack Automate.
5+
6+
### Configuring the json
7+
- Open `src/com/browserstack/TestNGSample.java` or `src/com/browserstack/TestNGParallel.java`.
8+
- Add `username` and `accessKey` with your BrowserStack credentials. Don't have one? Get one on BrowserStack [dashboard].
9+
- Add / customise more [capabilities].
10+
- Optionally, you can add your BrowserStack credentials to the environment variables `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY`.
11+
12+
### Running the tests
13+
- To start tests in series, run: `ant test-series`
14+
- To start parallel tests run: `ant test-parallel`
15+
16+
[TestNG]:http://testng.org
17+
[capabilities]:http://www.browserstack.com/automate/capabilities
18+
[dashboard]:https://www.browserstack.com/automate

build.xml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
<property name="build.dir" location="bin" />
1111

12-
<property name="dist.dir" location="dist" />
13-
1412
<target name="init">
1513
<tstamp />
1614
<mkdir dir="${build.dir}" />
@@ -28,26 +26,16 @@
2826
</javac>
2927
</target>
3028

31-
<target name="dist" depends="compile" description="create a JAR for the tests">
32-
<mkdir dir="${dist.dir}" />
33-
34-
<jar jarfile="${dist.dir}/${projectName}-${DSTAMP}.jar" basedir="${build.dir}" >
35-
<manifest>
36-
<attribute name="Main-Class" value="com.browserstack.TestNGParallel" />
37-
</manifest>
38-
</jar>
39-
</target>
40-
4129
<taskdef name="testng" classpathref="build.classpath" classname="org.testng.TestNGAntTask" />
4230

43-
<target name="test-parallel" depends="dist" description="run the tests on BrowserStack">
31+
<target name="test-parallel" depends="compile" description="run the tests on BrowserStack">
4432
<testng classpathref="build.classpath" verbose="10" >
4533
<classpath location="bin" />
4634
<xmlfileset dir="." includes="testng.xml"/>
4735
</testng>
4836
</target>
4937

50-
<target name="test-series" depends="dist" description="run the tests on BrowserStack">
38+
<target name="test-series" depends="compile" description="run the tests on BrowserStack">
5139
<testng classpathref="build.classpath" verbose="10" groups="series_test">
5240
<classpath location="bin" />
5341
<classfileset dir="bin" includes="**/**/TestNGSample.class"/>
@@ -56,9 +44,8 @@
5644

5745
<target name="clean" description="clean up">
5846
<delete dir="${build.dir}" />
59-
<delete dir="${dist.dir}" />
6047
</target>
6148

62-
<target name="main" depends="clean, compile, dist, test-parallel" />
49+
<target name="main" depends="clean, compile, test-parallel" />
6350

6451
</project>

0 commit comments

Comments
 (0)