Skip to content

Commit 34eb2c2

Browse files
Ruben NoguerolesRuben Nogueroles
authored andcommitted
First commit
1 parent b5a6b15 commit 34eb2c2

20 files changed

+2470
-23
lines changed

.gitignore

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
# Compiled class file
2-
*.class
3-
4-
# Log file
5-
*.log
6-
7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
1+
/target/
2+
*/target/**
3+
/test-output/
4+
*/test-output/**
5+
.DS_Store
6+
.classpath
7+
.project
8+
.settings/

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Fashionette challenge
2+
This is the Fasionette challenge project by Rubén Nogueroles ([email protected]).
3+
4+
## Prerequisites
5+
1. [Maven](https://maven.apache.org/download.cgi) [Install manual](https://maven.apache.org/install.html )
6+
2. [Java 8](https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html)
7+
8+
## How to use the project
9+
Firstly, you have to clone the repository to get the project structure.
10+
11+
The project uses TestNG and it is configured to exetcute the tests using the _maven test_ command.
12+
You will be able to execute it going to project directory (use promp cmd) and executing there the maven command.
13+
If you want to execute a concreted test suite you can do it executing _mvn clean test -Dtest.suite=[testSuiteName].xml_
14+
15+
### Configuring pom.xml parameters
16+
_pom.xml_ is located in the root path of the project. There, there are defined versions of plugins and technologies, parameters for test executions and dependencies.
17+
18+
### Parameters for test executions
19+
Important parameters to execute tests:
20+
21+
1. _browser_: Browser used to launch tests. Allowed values: _Firefox_, _Chrome_
22+
2. _local.OS_: OS used to launch tests. Allowed values: _Windows_ , _MAcOS_
23+
3. _webdriver.chrome.driver_: Path in which the Chrome driver is.
24+
4. _webdriver.firefox.driver_: Path in which the Firefox driver is.
25+
26+
## src/main/resources folder:
27+
1. files/software: In this folder we store the browser drivers ([geckodriver versions](https://github.com/mozilla/geckodriver/releases) , [chromedriver versions](https://chromedriver.chromium.org/))
28+
2. suites: Here you can group sets of tests to run it together.
29+
3. _log4j.properties_: This file sets the logging properties, in this case the output to console.
30+
4. _test.properties_: In this file we store some common tests properties.
31+
32+
## src/main/java folder:
33+
1. pageObject: Here you have every PageObjects. All PageObjects extends BasePageObject, it has important functions.
34+
2. testSets: Here you can find the tests classes. _@before_ and _@after_ methods are defined here. All tests classes extends DefaultTestSet.
35+
3. utils:
36+
* Inizialization - Contains the main selenium webdriver configuration.
37+
* DataUtils - Class that contains useful methods to provide to us mock data.

pom.xml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.wizeline</groupId>
4+
<artifactId>selenium-simple</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>Selenium 4 WebDriver</name>
7+
8+
<developers>
9+
<developer>
10+
<name>Ruben Nogueroles</name>
11+
<email>[email protected]</email>
12+
<organization>Wizeline</organization>
13+
<timezone>Europe/Madrid</timezone>
14+
</developer>
15+
</developers>
16+
17+
<properties>
18+
19+
<!-- Parameters for test executions -->
20+
<!-- browser options "Chrome" or "Firefox" -->
21+
<browser>Chrome</browser>
22+
<local.OS>MacOs</local.OS>
23+
<webdriver.chrome.driver>src/main/resources/files/software/chromedriver.exe</webdriver.chrome.driver>
24+
<webdriver.firefox.driver>src/main/resources/files/software/geckodriver.exe</webdriver.firefox.driver>
25+
26+
<!-- Versions section -->
27+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
28+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
29+
30+
<selenium.version>4.3.0</selenium.version>
31+
<java.version>1.8</java.version>
32+
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
33+
<testng.version>6.14.2</testng.version>
34+
<commons.lang3.version>3.12.0</commons.lang3.version>
35+
<log4j.version>1.2.17</log4j.version>
36+
<commons-io.version>2.4</commons-io.version>
37+
<aspectj.version>1.9.9.1</aspectj.version>
38+
39+
<!-- Default parameters for selenium -->
40+
<environment.url>https://www.google.com/</environment.url>
41+
42+
<!-- Default test suite -->
43+
<test.suite>defaultTestSuite.xml</test.suite>
44+
45+
</properties>
46+
47+
<dependencies>
48+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
49+
<dependency>
50+
<groupId>org.seleniumhq.selenium</groupId>
51+
<artifactId>selenium-java</artifactId>
52+
<version>${selenium.version}</version>
53+
</dependency>
54+
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
55+
<dependency>
56+
<groupId>org.testng</groupId>
57+
<artifactId>testng</artifactId>
58+
<version>[${testng.version},)</version>
59+
<scope>provided</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>commons-io</groupId>
63+
<artifactId>commons-io</artifactId>
64+
<version>${commons-io.version}</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.apache.commons</groupId>
68+
<artifactId>commons-lang3</artifactId>
69+
<version>${commons.lang3.version}</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>log4j</groupId>
73+
<artifactId>log4j</artifactId>
74+
<version>${log4j.version}</version>
75+
</dependency>
76+
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
77+
<dependency>
78+
<groupId>org.aspectj</groupId>
79+
<artifactId>aspectjweaver</artifactId>
80+
<version>${aspectj.version}</version>
81+
<scope>runtime</scope>
82+
</dependency>
83+
</dependencies>
84+
85+
<!-- Build phase -->
86+
<build>
87+
<!-- Filtering resources -->
88+
<testResources>
89+
<testResource>
90+
<directory>src/main/resources</directory>
91+
<filtering>true</filtering>
92+
</testResource>
93+
</testResources>
94+
95+
<!-- Plugins section -->
96+
<plugins>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-surefire-plugin</artifactId>
100+
<version>2.19.1</version>
101+
<configuration>
102+
<suiteXmlFiles>
103+
<suiteXmlFile>src/main/resources/suites/${test.suite}</suiteXmlFile>
104+
</suiteXmlFiles>
105+
<argLine>
106+
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
107+
</argLine>
108+
</configuration>
109+
</plugin>
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-compiler-plugin</artifactId>
113+
<version>${maven-compiler-plugin.version}</version>
114+
<configuration>
115+
<source>${java.version}</source>
116+
<target>${java.version}</target>
117+
</configuration>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
122+
</project>

0 commit comments

Comments
 (0)