Skip to content

Commit adcf279

Browse files
Updated Sample
1 parent 8d96e7d commit adcf279

27 files changed

+430
-1113
lines changed

.classpath

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" output="target/classes" path="src/main/java">
3+
<classpathentry kind="src" output="target/classes" path="Java-TestNG-Selenium/src">
44
<attributes>
55
<attribute name="optional" value="true"/>
66
<attribute name="maven.pomderived" value="true"/>
@@ -13,20 +13,31 @@
1313
<attribute name="test" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
1717
<attributes>
1818
<attribute name="maven.pomderived" value="true"/>
19-
<attribute name="test" value="true"/>
2019
</attributes>
2120
</classpathentry>
22-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2322
<attributes>
2423
<attribute name="maven.pomderived" value="true"/>
2524
</attributes>
2625
</classpathentry>
27-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
26+
<classpathentry kind="src" path="target/generated-sources/annotations">
27+
<attributes>
28+
<attribute name="optional" value="true"/>
29+
<attribute name="maven.pomderived" value="true"/>
30+
<attribute name="ignore_optional_problems" value="true"/>
31+
<attribute name="m2e-apt" value="true"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
2835
<attributes>
36+
<attribute name="optional" value="true"/>
2937
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="ignore_optional_problems" value="true"/>
39+
<attribute name="m2e-apt" value="true"/>
40+
<attribute name="test" value="true"/>
3041
</attributes>
3142
</classpathentry>
3243
<classpathentry kind="output" path="target/classes"/>

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/target/
2+
/bin/
3+
.project
4+
.settings
5+
.theia

.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>lambdatest-TestNG-project</name>
3+
<name>lambdatest-TestNG-project/src</name>
44
<comment></comment>
55
<projects>
66
</projects>

.settings/org.eclipse.jdt.core.prefs

-6
This file was deleted.

.settings/org.eclipse.m2e.core.prefs

-4
This file was deleted.

Config.properties

-10
This file was deleted.

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,11 @@
2323
2424
```
2525
To run single test
26-
$ mvn test -P single
27-
28-
To run local test
29-
$ mvn test -P local
26+
$ mvn test -Dsuite=single.xml
3027

3128
To run parallel test
32-
$ mvn test -P parallel
33-
34-
To run single test fron Jenkins
35-
$ mvn test -P singleJenkins
29+
$ mvn test -Dsuite=single.xml
3630

37-
To run parallel test from Jenkins
38-
$ mvn test -P parallelJenkins
3931
```
4032
## About LambdaTest
4133

parallel.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
3+
<suite thread-count="20" parallel="tests" name="Suite">
4+
<test thread-count="20" parallel="classes" name="Test">
5+
<classes>
6+
<class name="com.lambdatest.TestNGTodo1"/>
7+
<class name="com.lambdatest.TestNGTodo2"/>
8+
<class name="com.lambdatest.TestNGTodo3"/>
9+
</classes>
10+
</test> <!-- Test -->
11+
</suite> <!-- Suite -->

pom.xml

+62-187
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,62 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
6-
<artifactId>lambdatest-TestNG-project</artifactId>
7-
<groupId>com.lambdatest</groupId>
8-
<version>1.0-SNAPSHOT</version>
9-
<packaging>jar</packaging>
10-
<name>lambdatest_quickstart</name>
11-
<description>A sample Maven project that demonstrates how to integrate Lambdatest with WebDriver tests
12-
that run using TestNG
13-
</description>
14-
15-
<dependencies>
16-
<dependency>
17-
<groupId>org.hamcrest</groupId>
18-
<artifactId>hamcrest-core</artifactId>
19-
<version>1.3</version>
20-
<scope>test</scope>
21-
</dependency>
22-
<dependency>
23-
<groupId>org.testng</groupId>
24-
<artifactId>testng</artifactId>
25-
<version>6.9.10</version>
26-
<scope>test</scope>
27-
</dependency>
28-
<dependency>
29-
<groupId>org.seleniumhq.selenium</groupId>
30-
<artifactId>selenium-java</artifactId>
31-
<version>3.13.0</version>
32-
<scope>test</scope>
33-
</dependency>
34-
<dependency>
35-
<groupId>commons-lang</groupId>
36-
<artifactId>commons-lang</artifactId>
37-
<version>2.6</version>
38-
<scope>test</scope>
39-
</dependency>
40-
41-
<dependency>
42-
<groupId>com.googlecode.json-simple</groupId>
43-
<artifactId>json-simple</artifactId>
44-
<version>1.1.1</version>
45-
</dependency>
46-
47-
<dependency>
48-
<groupId>org.json</groupId>
49-
<artifactId>json</artifactId>
50-
<version>20171018</version>
51-
</dependency>
52-
</dependencies>
53-
54-
<build>
55-
<plugins>
56-
<plugin>
57-
<artifactId>maven-compiler-plugin</artifactId>
58-
<version>3.0</version>
59-
<configuration>
60-
<source>1.6</source>
61-
<target>1.6</target>
62-
</configuration>
63-
</plugin>
64-
<plugin>
65-
<groupId>org.apache.maven.plugins</groupId>
66-
<artifactId>maven-surefire-plugin</artifactId>
67-
<version>2.12.4</version>
68-
</plugin>
69-
</plugins>
70-
</build>
71-
72-
<profiles>
73-
<profile>
74-
<id>single</id>
75-
<build>
76-
<plugins>
77-
<plugin>
78-
<groupId>org.apache.maven.plugins</groupId>
79-
<artifactId>maven-surefire-plugin</artifactId>
80-
<configuration>
81-
<suiteXmlFiles>
82-
<suiteXmlFile>src/test/resources/single.xml</suiteXmlFile>
83-
</suiteXmlFiles>
84-
</configuration>
85-
</plugin>
86-
</plugins>
87-
</build>
88-
</profile>
89-
90-
<profile>
91-
<id>local</id>
92-
<build>
93-
<plugins>
94-
<plugin>
95-
<groupId>org.apache.maven.plugins</groupId>
96-
<artifactId>maven-surefire-plugin</artifactId>
97-
<configuration>
98-
<suiteXmlFiles>
99-
<suiteXmlFile>src/test/resources/local.xml</suiteXmlFile>
100-
</suiteXmlFiles>
101-
</configuration>
102-
</plugin>
103-
</plugins>
104-
</build>
105-
</profile>
106-
107-
<profile>
108-
<id>parallel</id>
109-
<build>
110-
<plugins>
111-
<plugin>
112-
<groupId>org.apache.maven.plugins</groupId>
113-
<artifactId>maven-surefire-plugin</artifactId>
114-
<configuration>
115-
<suiteXmlFiles>
116-
<suiteXmlFile>src/test/resources/parallel.xml</suiteXmlFile>
117-
</suiteXmlFiles>
118-
</configuration>
119-
</plugin>
120-
</plugins>
121-
</build>
122-
</profile>
123-
124-
125-
<profile>
126-
<id>parallelJenkins</id>
127-
<build>
128-
<plugins>
129-
<plugin>
130-
<groupId>org.apache.maven.plugins</groupId>
131-
<artifactId>maven-surefire-plugin</artifactId>
132-
<configuration>
133-
<suiteXmlFiles>
134-
<suiteXmlFile>src/test/resources/parallelJenkins.xml</suiteXmlFile>
135-
</suiteXmlFiles>
136-
</configuration>
137-
</plugin>
138-
</plugins>
139-
</build>
140-
</profile>
141-
142-
<profile>
143-
<id>singleJenkins</id>
144-
<build>
145-
<plugins>
146-
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-surefire-plugin</artifactId>
149-
<configuration>
150-
<suiteXmlFiles>
151-
<suiteXmlFile>src/test/resources/singleJenkins.xml</suiteXmlFile>
152-
</suiteXmlFiles>
153-
</configuration>
154-
</plugin>
155-
</plugins>
156-
</build>
157-
</profile>
158-
159-
160-
<profile>
161-
<id>parallelJenkinsThreadControl</id>
162-
<build>
163-
<plugins>
164-
<plugin>
165-
<groupId>org.apache.maven.plugins</groupId>
166-
<artifactId>maven-surefire-plugin</artifactId>
167-
<configuration>
168-
<suiteXmlFiles>
169-
<suiteXmlFile>src/test/resources/parallelJenkinsThreadControl.xml</suiteXmlFile>
170-
</suiteXmlFiles>
171-
172-
<systemProperties>
173-
<systemProperty>
174-
<name>threadcount</name>
175-
<value>${threadcount}</value>
176-
177-
</systemProperty>
178-
</systemProperties>
179-
</configuration>
180-
</plugin>
181-
</plugins>
182-
</build>
183-
</profile>
184-
185-
</profiles>
186-
187-
</project>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>Java-TestNG-Selenium</groupId>
6+
<artifactId>Java-TestNG-Selenium</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<build>
9+
<sourceDirectory>Java-TestNG-Selenium/src</sourceDirectory>
10+
<resources>
11+
<resource>
12+
<directory>Java-TestNG-Selenium/src</directory>
13+
<excludes>
14+
<exclude>**/*.java</exclude>
15+
</excludes>
16+
</resource>
17+
</resources>
18+
<plugins>
19+
<plugin>
20+
<artifactId>maven-compiler-plugin</artifactId>
21+
<version>3.7.0</version>
22+
<configuration>
23+
<release>10</release>
24+
</configuration>
25+
</plugin>
26+
<plugin>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-surefire-plugin</artifactId>
29+
<version>2.19.1</version>
30+
<executions>
31+
<execution>
32+
<goals>
33+
<goal>test</goal>
34+
</goals>
35+
</execution>
36+
</executions>
37+
<configuration>
38+
<suiteXmlFiles>
39+
<!--suppress UnresolvedMavenProperty -->
40+
<suiteXmlFile>${suite}</suiteXmlFile>
41+
</suiteXmlFiles>
42+
</configuration>
43+
</plugin>
44+
</plugins>
45+
46+
</build>
47+
<dependencies>
48+
<dependency>
49+
<groupId>org.seleniumhq.selenium</groupId>
50+
<artifactId>selenium-java</artifactId>
51+
<version>3.13.0</version>
52+
</dependency>
53+
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
54+
<dependency>
55+
<groupId>org.testng</groupId>
56+
<artifactId>testng</artifactId>
57+
<version>6.14.3</version>
58+
</dependency>
59+
60+
</dependencies>
61+
62+
</project>

single.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
3+
<suite thread-count="1" parallel="tests" name="Suite">
4+
<test thread-count="1" parallel="classes" name="Test">
5+
<classes>
6+
<class name="com.lambdatest.TestNGTodo1"/>
7+
<class name="com.lambdatest.TestNGTodo2"/>
8+
<class name="com.lambdatest.TestNGTodo3"/>
9+
</classes>
10+
</test> <!-- Test -->
11+
</suite> <!-- Suite -->

0 commit comments

Comments
 (0)