pom.xml как показано ниже
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>mavenproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mavenproject</name>
<properties>
<java.version>1.8</java.version>
<webdriver.driver>iexplorer</webdriver.driver>
<webdriver.iexplorer>D:/IEDriverServer_x64_3.12.0/IEDriverServer.exe</webdriver.iexplorer>
<webdriver.iexplorer.driver>${webdriver.iexplorer}</webdriver.iexplorer.driver>
<site.url>https://www.openbetcareers.com/</site.url>
<browser.name>iexplorer</browser.name>
</properties>
<description>manvenproject</description>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>cucumber-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/RunTest.java</include>
</includes>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<glue>mavenproject.stepdefinition</glue>
<featuresDirectory>src/test/java/featurefile/</featuresDirectory>
</configuration>
<systemProperties>
<webdriver.driver>${webdriver.driver}</webdriver.driver>
<surefire.rerunFailingTestsCount>${surefire.rerunFailingTestsCount</surefire.rerunFailingTestsCount>
</systemProperties>
<testFailureIgnore>true</testFailureIgnore>
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
RunTest.java , как показано ниже:
package mavenproject.stepdefinition;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features="src/test/java/mavenproject/featurefile",glue={"mavenproject.stepdefinition"}
)
public class RunTest {
}