serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

not sure about how to see o/p reports in cucumber serenity #171

Closed rohitpatwari84 closed 6 years ago

rohitpatwari84 commented 6 years ago

This is my POM . After I run the runner file , what are the steps to see my serenity report - package Runner;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
//import net.serenitybdd.cucumber.CucumberWithSerenity;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
//@RunWith(CucumberWithSerenity.class)

@CucumberOptions(
        features = {"src/test/java/Features/"},
       glue = {"Steps"},
        monochrome = true,
        tags = {"@Smoke"},
       plugin = {"pretty", "html:target/cucumber","json:target/cucumber.json"}

)
public class MainRunner {

}

POM - <?xml version="1.0" encoding="UTF-8"?> <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">

4.0.0
<groupId>Automation</groupId>
<artifactId>cucumber</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <fork>true</fork>
                    <!--<executable>C:\Program Files\Java\jdk1.8.0_162\javac.exe</executable>-->
                    <executable>C:\Program Files\Java\jdk1.8.0_162\\bin\javac.exe</executable>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <skip>false</skip>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>

            <!--
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <testFailureIgnore>false</testFailureIgnore>
                </configuration>
            </plugin>

            -->
            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>1.9.12</version>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- https://mvnrepository.com/artifact/net.serenity-bdd.maven.plugins/serenity-maven-plugin -->

        </plugins>
    </pluginManagement>
</build>

<!--
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.22.0</version>
        </plugin>
    </plugins>
</reporting>

-->

org.seleniumhq.selenium selenium-java 3.6.0 junit junit 4.12 net.serenity-bdd.maven.plugins serenity-maven-plugin 1.9.12 io.cucumber cucumber-core 3.0.2 io.cucumber cucumber-junit 3.0.2 test info.cukes cucumber-html 0.2.3 io.cucumber cucumber-java 3.0.2 info.cukes gherkin 2.12.2 org.hamcrest hamcrest-all 1.3 com.aventstack extentreports 3.0.5 org.freemarker freemarker 2.3.26-incubating net.masterthought cucumber-reporting 3.6.0 com.vimalselvam cucumber-extentsreport 2.0.4 net.serenity-bdd serenity-cucumber 1.9.10

wakaleo commented 6 years ago

Delete your current pom.xml file, use the pom.xml from https://github.com/serenity-bdd/serenity-cucumber-starter as a starting point, and add whatever dependencies are missing to make your project compile.

rohitpatwari84 commented 6 years ago

Awesome !! Thanks @wakaleo . It works now . Also had a general question . How does serenity compare with Relish and Pickles ? Are there any advantages as far as Live documentation is concerned ?

wakaleo commented 6 years ago

Serenity is a bit more comprehensive than tools like Relish and Pickles - it does both high level living documentation (with a configurable requirements hierarchy rather than just a list of features) and, if you write your tests using the Serenity APIs, in-depth documentation that documents what happened during the test itself (e.g. illustrated with screenshots or REST calls).