Создание отчетов Allure с использованием cucumber и maven. И основ БДД.
Я пытаюсь создать отчет allure с помощью проекта cucumber, maven, но папка allure-result с файлами json в ней не создается.
Ниже приведен мой POM.xml файл.
<version>0.0.1-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <allure.version>1.5.2</allure.version> <aspectj.version>1.8.4</aspectj.version> </properties> <dependencies> <dependency> <groupId>net.masterthought</groupId> <artifactId>cucumber-reporting</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>gherkin</artifactId> <version>2.12.2</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>1.2.5</version> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-core</artifactId> <version>1.2.5</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-jvm</artifactId> <version>1.2.5</version> <type>pom</type> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>ru.yandex.qatools.allure</groupId> <artifactId>allure-core</artifactId> <version>${allure.version}</version> <type>pom</type> </dependency> <dependency> <groupId>ru.yandex.qatools.allure</groupId> <artifactId>allure-java-aspects</artifactId> <version>${allure.version}</version> <type>jar</type> </dependency> <dependency> <groupId>ru.yandex.qatools.allure</groupId> <artifactId>allure-commons</artifactId> <version>${allure.version}</version> <type>jar</type> </dependency> <dependency> <groupId>io.qameta.allure</groupId> <artifactId>allure-cucumber-jvm</artifactId> <version>2.13.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <fork>true</fork> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <testFailureIgnore>false</testFailureIgnore> <argLine> -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar -Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter" </argLine> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> </dependencies> </plugin> <plugin> <groupId>io.qameta.allure</groupId> <artifactId>allure-maven</artifactId> <version>2.9</version> </plugin> </plugins> </build>
below is step Defination file: <pre>package stepDefination; import org.openqa.selenium.WebDriver; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; public class CustomerInfoVerification { @Given("^user is already on home Page$") public void user_is_already_on_home_Page() throws Throwable { System.out.print(" thid is Given"); } @When("^click on Pattinson, Robert provider$") public void click_on_Pattinson_Robert_provider() throws Throwable { System.out.print(" thid is When"); } @Then("^user verifies unm and password$") public void userVerifiesGeography() throws Throwable { System.out.print(" thid is Then"); } }
Ниже приведен мой файл функций:
Feature: Rule management module Scenario: Provider information module Given user is already on home Page When click on Pattinson, Robert provider Then user verifies unm and password
Что я уже пробовал:
я попытался запустить ниже файл test runner мои тестовые случаи выполняются и передаются, но папка Allure-results не генерируется
тестов:
import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions(features = { "classpath:featureFile/clinicRule.feature" }, glue = { "stepDefination" }, monochrome = true, plugin = { "pretty", "html:target/cucumber-html-reports", "json:target/cucumber-html-reports/cucumber.json","rerun:target/failed_scenarios.txt" }) public class TestRunner { }