Repository navigation
Expand file tree
/
Copy pathpom.xml
More file actions
115 lines (108 loc) · 4.67 KB
/
Copy pathpom.xml
File metadata and controls
115 lines (108 loc) · 4.67 KB
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
<!--
Maven build for selenium-java-framework.
Run all tests: mvn clean test
Run without a window: mvn clean test -Dheadless=true
Run one group: mvn clean test -Dgroups=smoke
Change parallel threads: mvn clean test -Dthreads=1
Include the demo tests: mvn clean test -Pdemo (they fail and skip on purpose)
-->
<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">
<!-- POM format version; always 4.0.0 for Maven 3 -->
<modelVersion>4.0.0</modelVersion>
<!-- The project's coordinates: group (like a package), name and version -->
<groupId>com.automation</groupId>
<artifactId>selenium-java-framework</artifactId>
<!-- SNAPSHOT = work in progress, not a release -->
<version>0.0.1-SNAPSHOT</version>
<!-- Build output type (a jar; for a test project it is never published) -->
<packaging>jar</packaging>
<!-- Display name and description (shown by IDEs and Maven reports) -->
<name>selenium-java-framework</name>
<description>UI test automation framework built with Selenium WebDriver, TestNG and the Page Object Model</description>
<!-- Values used below as ${name}; each can be overridden on the command line with -Dname=value -->
<properties>
<!-- Read and write source files and reports as UTF-8 on every OS -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Compile for Java 17 (any newer JDK can build it) -->
<maven.compiler.release>17</maven.compiler.release>
<!-- Test classes run in parallel on this many threads (one browser each); override with -Dthreads=N -->
<threads>3</threads>
<!-- Groups left out of a run; "demo" holds the tests that fail and skip on purpose (see the demo profile) -->
<excludedGroups>demo</excludedGroups>
</properties>
<!-- Libraries the project needs; Maven downloads them (and what they need) from Maven Central -->
<dependencies>
<!-- Browser automation; Selenium Manager downloads the matching driver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.50.0</version>
</dependency>
<!-- Test runner; also used by the page objects (Reporter steps) and the report listener -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.12.0</version>
</dependency>
<!-- Silences the "no SLF4J provider" warning of libraries that log through SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>2.0.17</version>
</dependency>
</dependencies>
<!-- How the project is built and tested -->
<build>
<plugins>
<!-- Compiles for Java 17 (see maven.compiler.release) and reports deprecated API use -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.16.0</version>
<configuration>
<!-- List every use of a deprecated API, not just a summary -->
<showDeprecation>true</showDeprecation>
<!-- Show compiler warnings -->
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<!--
Runs every *Test class with TestNG. No suite file is used here, so
-Dgroups=... and -Dtest=... work as usual; testng.xml is for the IDE.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.6</version>
<configuration>
<!-- Each test class runs on its own thread; the methods of one class stay on one thread -->
<parallel>classes</parallel>
<!-- How many classes run at the same time (property above, or -Dthreads=N) -->
<threadCount>${threads}</threadCount>
<!-- Groups to leave out (property above; the demo profile changes it) -->
<excludedGroups>${excludedGroups}</excludedGroups>
<!-- Without it, a project path with spaces breaks the forked JVM's classpath -->
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<!-- Optional settings switched on with -P<id> -->
<profiles>
<!--
mvn clean test -Pdemo also runs ReportDemoTest, whose tests fail and skip
on purpose, so the report shows every outcome. The build then ends as failed.
Only the demo tests: mvn clean test -Pdemo -Dgroups=demo
-->
<profile>
<!-- The name used with -P -->
<id>demo</id>
<properties>
<!-- No real group is called "none", so nothing is left out -->
<excludedGroups>none</excludedGroups>
</properties>
</profile>
</profiles>
</project>