-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
154 lines (152 loc) · 6.67 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.udemy.selenium-docker</groupId>
<artifactId>selenium-docker</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<selenium.java.version>4.11.0</selenium.java.version>
<logback.version>1.4.8</logback.version>
<webdriver.manager.version>5.4.0</webdriver.manager.version>
<testng.version>7.8.0</testng.version>
<jackson.version>2.12.0</jackson.version>
<!-- plugins versions -->
<maven.compiler.version>3.11.0</maven.compiler.version>
<maven.dependency.version>3.6.0</maven.dependency.version>
<maven.jar.version>3.3.0</maven.jar.version>
<maven.surefire.version>3.1.2</maven.surefire.version>
<maven.resources.plugin>3.3.1</maven.resources.plugin>
<!-- output directory -->
<package.directory>${project.build.directory}/docker-resources</package.directory>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.java.version}</version>
</dependency>
<!-- logging library -->
<!-- https://www.baeldung.com/logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- web-driver manager for local testing -->
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>${webdriver.manager.version}</version>
<scope>test</scope>
</dependency>
<!-- To deserialize json into Java object or vice versa -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<!-- Test framework -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>selenium-docker</finalName>
<plugins>
<!-- To compile the source code using specific java version. also to force IDE to change the settings -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<!-- To run the tests using specific parameters, change thread count, testng report output directory etc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<systemPropertyVariables>
<browser>chrome</browser>
<selenium.grid.enabled>true</selenium.grid.enabled>
</systemPropertyVariables>
<suiteXmlFiles>
<file>src/test/resources/suites/test-suite.xml</file>
</suiteXmlFiles>
<threadCount>1</threadCount>
<reportsDirectory>target/test-output</reportsDirectory>
</configuration>
</plugin>
<!-- To copy all the dependencies to run our tests as part of "mvn package" -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${package.directory}/libs
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- To package our page objects, test classes into jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.version}</version>
<configuration>
<outputDirectory>${package.directory}/libs</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
<configuration>
<includes>**/*.class</includes>
</configuration>
</execution>
</executions>
</plugin>
<!-- To copy resources into the output directory -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin}</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${package.directory}</outputDirectory>
<resources>
<resource>
<directory>src/test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>