Commit c8daff52 authored by Administrator's avatar Administrator

Fixes JSF testing problems

The default FirefoxDriver from Selenium no longer supports Firefox since
version 47 without a native web driver. This commit adds support to
native drivers, downloading and configuring this drivers depending on
the current OS (only Unix, Windows and Mac OS supported at this moment).
parent 7ba792b4
......@@ -8,3 +8,6 @@ target
#General
bak
#Firefox
C:\\nppdf32Log\\debuglog.txt
......@@ -70,13 +70,197 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>jsf-geckodriver-download-unix</id>
<activation>
<os><family>unix</family></os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-geckodriver</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<mkdir dir="${geckodriver.basepath}"/>
<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
<untar src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}" compression="gzip"/>
<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jsf-geckodriver-download-windows</id>
<activation>
<os><family>windows</family></os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-geckodriver</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<mkdir dir="${geckodriver.basepath}"/>
<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
<unzip src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}"/>
<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jsf-geckodriver-properties-unix-amd64</id>
<activation>
<os>
<family>unix</family>
<arch>amd64</arch>
</os>
</activation>
<properties>
<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-linux64.tar.gz</geckodriver.url>
<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-linux64.tar.gz</geckodriver.compressed.path>
<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
</properties>
</profile>
<profile>
<id>jsf-geckodriver-properties-unix-x86</id>
<activation>
<os>
<family>unix</family>
<arch>x86</arch>
</os>
</activation>
<properties>
<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-linux86.tar.gz</geckodriver.url>
<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-linux86.tar.gz</geckodriver.compressed.path>
<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
</properties>
</profile>
<profile>
<id>jsf-geckodriver-properties-windows-amd64</id>
<activation>
<os>
<family>windows</family>
<arch>amd64</arch>
</os>
</activation>
<properties>
<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-win64.zip</geckodriver.url>
<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-win64.zip</geckodriver.compressed.path>
<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver.exe</geckodriver.uncompressed.path>
</properties>
</profile>
<profile>
<id>jsf-geckodriver-properties-windows-x86</id>
<activation>
<os>
<family>windows</family>
<arch>x86</arch>
</os>
</activation>
<properties>
<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-win86.zip</geckodriver.url>
<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-win86.zip</geckodriver.compressed.path>
<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver.exe</geckodriver.uncompressed.path>
</properties>
</profile>
<profile>
<id>jsf-geckodriver-properties-and-download-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-macos.tar.gz</geckodriver.url>
<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-macos.tar.gz</geckodriver.compressed.path>
<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-geckodriver</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<mkdir dir="${geckodriver.basepath}"/>
<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
<untar src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}" compression="gzip"/>
<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
......@@ -41,8 +41,8 @@
<!-- BOM versions -->
<javaee.api.version>7.0</javaee.api.version>
<arquillian.version>1.1.11.Final</arquillian.version>
<arquillian.rest.version>1.0.0.Alpha3</arquillian.rest.version>
<arquillian.selenium.version>2.53.1</arquillian.selenium.version>
<arquillian.rest.version>1.0.0.Alpha4</arquillian.rest.version>
<arquillian.selenium.version>3.0.0</arquillian.selenium.version>
<!-- Dependencies versions -->
<wildfly.version>8.2.1.Final</wildfly.version>
......@@ -59,6 +59,7 @@
<mysql.connector.java.version>5.1.21</mysql.connector.java.version>
<resteasy.version>3.0.19.Final</resteasy.version>
<graphene.webdrive.version>2.1.0.Final</graphene.webdrive.version>
<geckodriver.version>v0.11.1</geckodriver.version>
<!-- Plugins versions -->
<wildfly.maven.plugin.version>1.1.0.Alpha11</wildfly.maven.plugin.version>
......@@ -70,6 +71,7 @@
<maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
<maven.resources.plugin.version>3.0.1</maven.resources.plugin.version>
<maven.ear.plugin.version>2.10.1</maven.ear.plugin.version>
<maven.antrun.plugin.version>1.8</maven.antrun.plugin.version>
</properties>
<dependencyManagement>
......@@ -210,7 +212,7 @@
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
......@@ -272,6 +274,11 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.antrun.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......@@ -366,6 +373,25 @@
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>
[1.8,)
</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment