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 @@
</properties>
<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>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
......@@ -79,6 +51,35 @@
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</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>
<build>
......@@ -93,6 +94,35 @@
<warName>DAAExample</warName>
</configuration>
</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>
</build>
</project>
......@@ -21,7 +21,6 @@ import es.uvigo.esei.daa.TestUtils;
public class PeopleWebTest {
private static final int DEFAULT_WAIT_TIME = 1;
private WebDriver driver;
private String baseUrl;
private StringBuffer verificationErrors = new StringBuffer();
@BeforeClass
......@@ -33,13 +32,12 @@ public class PeopleWebTest {
public void setUp() throws Exception {
TestUtils.initTestDatabase();
final String baseUrl = "http://localhost:9080/DAAExample/";
driver = new FirefoxDriver();
baseUrl = "http://localhost:9080/DAAExample/";
driver.get(baseUrl);
driver.manage().addCookie(
new Cookie("token", "bXJqYXRvOm1yamF0bw==")
);
driver.manage().addCookie(new Cookie("token", "bXJqYXRvOm1yamF0bw=="));
// Driver will wait DEFAULT_WAIT_TIME if it doesn't find and element.
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