Commit 8b9eed22 authored by michada's avatar michada

Test report generation added and minor code cleaning.

Sunfire report generation plugin added to pom.xml.

Minor code cleaning in pom.xml and PeopleWebTest class.
parent cf184b2c
...@@ -21,34 +21,6 @@ ...@@ -21,34 +21,6 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.39.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.0.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId> <groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId> <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
...@@ -79,6 +51,35 @@ ...@@ -79,6 +51,35 @@
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.9</version> <version>1.9</version>
</dependency> </dependency>
<!-- Test Scope -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.39.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.0.0.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
...@@ -93,6 +94,35 @@ ...@@ -93,6 +94,35 @@
<warName>DAAExample</warName> <warName>DAAExample</warName>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>test-reports</id>
<phase>test</phase>
<configuration>
<tasks>
<junitreport todir="target/surefire-reports">
<fileset dir="target/surefire-reports">
<include name="**/*.xml" />
</fileset>
<!-- report format="noframes" todir="target/surefire-reports" /-->
</junitreport>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
...@@ -21,7 +21,6 @@ import es.uvigo.esei.daa.TestUtils; ...@@ -21,7 +21,6 @@ import es.uvigo.esei.daa.TestUtils;
public class PeopleWebTest { public class PeopleWebTest {
private static final int DEFAULT_WAIT_TIME = 1; private static final int DEFAULT_WAIT_TIME = 1;
private WebDriver driver; private WebDriver driver;
private String baseUrl;
private StringBuffer verificationErrors = new StringBuffer(); private StringBuffer verificationErrors = new StringBuffer();
@BeforeClass @BeforeClass
...@@ -33,13 +32,12 @@ public class PeopleWebTest { ...@@ -33,13 +32,12 @@ public class PeopleWebTest {
public void setUp() throws Exception { public void setUp() throws Exception {
TestUtils.initTestDatabase(); TestUtils.initTestDatabase();
final String baseUrl = "http://localhost:9080/DAAExample/";
driver = new FirefoxDriver(); driver = new FirefoxDriver();
baseUrl = "http://localhost:9080/DAAExample/";
driver.get(baseUrl); driver.get(baseUrl);
driver.manage().addCookie( driver.manage().addCookie(new Cookie("token", "bXJqYXRvOm1yamF0bw=="));
new Cookie("token", "bXJqYXRvOm1yamF0bw==")
);
// Driver will wait DEFAULT_WAIT_TIME if it doesn't find and element. // Driver will wait DEFAULT_WAIT_TIME if it doesn't find and element.
driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_TIME, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_TIME, TimeUnit.SECONDS);
......
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