I'm running some tests using Maven clean/verify. My reporting is in Serenity. However my tests appear to run twice before the build is successful Serenity only shows one test (which is good) can someone check over the code and see what's causing it because I've tried a few things like taking out post-integration-tests etc yet it still runs the same test twice.
POM File
`<project xmlns="http://ift.tt/IH78KX"` xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/VE5zRx">
<modelVersion>4.0.0</modelVersion>
<groupId>website.SurveyManager</groupId>
<artifactId>GeneralTests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GeneralTests</name>
<description>General Tests for Survey Manager</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.47.1</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>1.1.12</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>1.1.12</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*When*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>1.1.12</version>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.8.0_60\bin\javac.exe</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
Test FIle:
package website.SurveyManager.test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import website.SurveyManager.test.steps.SurveyManagerSteps;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.Steps;
@RunWith (SerenityRunner.class)
public class SurveyManagerTest {
@Managed
WebDriver driver;
@Steps
SurveyManagerSteps steps;
@Test
public void testSurveyManagerVersion(){
steps.gotoSurveyManager();
steps.checkVersion();
steps.VersionValidation("1.0.0.9");
}
}
Steps FIle:
package website.SurveyManager.test.steps;
import org.openqa.selenium.By;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.steps.ScenarioSteps;
import static org.junit.Assert.*;
public class SurveyManagerSteps extends ScenarioSteps {
@Step
public void gotoSurveyManager(){
getDriver().get("http://ift.tt/1Qm8mdA");
}
@Step ()
public void checkVersion(){
getDriver().findElement(By.className("popupLink")).click();
}
@Step ()
public void VersionValidation(String s){
String actualValue = getDriver().findElement(By.xpath(".//*[@id='aboutSM']/div[1]/div[2]/table/tbody/tr[2]/td[2]")).getText();
assertEquals(s, actualValue);
}
}
from Newest questions tagged java - Stack Overflow http://ift.tt/1Qm8o57
via IFTTT
Aucun commentaire:
Enregistrer un commentaire