Giter Club home page Giter Club logo

serenity-cucumber's Introduction

DEPRECATED

This library only supports the older Cucumber 2.x versions of Cucumber. For the most recent version refer to serenity-core.

Serenity Cucumber Integration

This module lets you produce Serenity reports using Cucumber. You run your tests as normal, but using the CucumberWithSerenity runner, e.g.:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features="src/test/resources/samples/myfeature.feature")
public class SimpleTableScenario {}

Found a bug? Please read this before you raise an issue.

If you have found a defect, we are keen to hear about it! But there are a few things you can do to help us provide a fix sooner:

Give as much context as possible.

Simply saying "The reports don't get generated" will not help us very much. Give as much context as possible, including:

  • Serenity version (serenity-core and the other serenity libraries, such as serenity-cucummber and serenity-jbehave)
  • If you are using Firefox, firefox and geckodriver version
  • If you are using Chrome, chrome and chromedriver version
  • What Operating System are you using

Also, make sure you try with the latest version of Serenity - your bug may already be fixed, and in any case error messages from the latest version will be more relevant when we try to track down the source of the problem.

Use living documentation

It is easier for us to fix something we can see breaking. If someone has to volunteer an hour of there time to reproduce a defect, Start of with one of the Serenity started projects (like this one and add a scenario or test case that both illustrates and describes your issue. If possible, write the test to describe the behaviour you expect, so that it fails when the defect is present, and that it will pass when the defect is fixed.

Submit a Pull Request

The fastest way to fix a defect is often to dig into the code and to submit a pull request.

Ask for commercial support

If you are using Serenity for your company projects, and need faster or more in-depth support, why not ask your company to get some commercial support? We provide a range of support options including prioritied tickets, custom Serenity work, and remote mentoring/pair programming sessions, depending on your needs.

Take a look at this article for more information.

serenity-cucumber's People

Contributors

cliviu avatar ereticul avatar jeffjensen avatar odemkovychromexsoft avatar ram-raghu avatar valfirst avatar wakaleo avatar yamstranger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serenity-cucumber's Issues

@After hook causes NoSuchMethodError in the Reporter

Running 1.1.9 w/ 1.1.31 Core.

Downloading sources shows that SerenityReporter.after calls missing ThucydidesWebDriverSupport.clearDefaultDriver();

Examples: Time elapsed: 1.071 sec <<< ERROR! java.lang.NoSuchMethodError: net.thucydides.core.webdriver.ThucydidesWebDriverSupport.clearDefaultDriver()V at net.serenitybdd.cucumber.SerenityReporter.after(SerenityReporter.java:616) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at cucumber.runtime.Utils$1.call(Utils.java:37) at cucumber.runtime.Timeout.timeout(Timeout.java:13) at cucumber.runtime.Utils.invoke(Utils.java:31) at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:290) at com.sun.proxy.$Proxy19.after(Unknown Source) at cucumber.runtime.junit.JUnitReporter.after(JUnitReporter.java:149) at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:236) at cucumber.runtime.Runtime.runHooks(Runtime.java:211) at cucumber.runtime.Runtime.runAfterHooks(Runtime.java:205) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:46) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.api.junit.Cucumber.run(Cucumber.java:98) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

support of cucumber-java8 with OpenJDK

Greetings,

I was trying to use cucumber-java8 with Serenity and OpenJDK and that failed because of known bug in cucumber - cucumber/cucumber-jvm#912

Unfortunately when I upgraded cucumber and cucumber-java8 to 1.2.5 there popped up other incompatibilities, now related to Serenity and Cucumber itself:

java.lang.NoSuchMethodError: cucumber.runtime.RuntimeOptions.getJunitOptions()Ljava/util/List; at cucumber.api.junit.Cucumber.<init>(Cucumber.java:61) at net.serenitybdd.cucumber.CucumberWithSerenity.<init>(CucumberWithSerenity.java:26) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Is there an easy path to upgrade Serenity or is it somewhere on the roadmap?

Thank you.

Scenario Outline with PendingException marked as Passing instead of Pending

Hello,

If a scenario outline has steps which throwing PendingException, the scenario is marked as Passing.
I expected this scenario should be marked as Pending. Is it expected ?

If the scenario is not a scenario outline, the scenario is marked as Ignored
It's not Pending, as I would expeded but, unlike the previous result, it's not a false positive.

To reproduce the problem :

I think that the problem is in the SerenityReporter which doesn't support Pending result.
In the previous repository, I try to fix the problem building my own SerenityReporter : Please see CucumberWithSerenityFix class

can't read tags from within test, nor exlclude scenarios with tags

Hello,
using Serenity-core 1.5.9, serenity-junit (1.5.9), serenity-cucumber (1.5.7) and maven plugin (1.5.9), I can't read tags within tests. According to the documentation (http://thucydides.info/docs/serenity-staging/#_running_scenarios_by_tags), this should do the trick:

Map<String, String> metadata = Serenity.getCurrentSession().getMetaData();

But the map is still empty. In fact metadata and tags are not the same concept, so is it possible to access tags ?

Futhermore, tags like @Pending and @Ignore (ih feature files or step definitions) does't skip tests (as expected, see http://thucydides.info/docs/serenity-staging/#_skipping_tests). Tests are run, then marked as skipped in report. No way to really skip them, or adjust test execution through tags ?

Thank you for your help.

This is my feature file:

  • all steps 'This step should not be run' are executed (but the one tagged as Pending and the Manual are marked as Skipped in report:)
  • in last scenario, Serenity.getCurrentSession().getMetaData() is empty (but tags are shown in report)
Feature: Test

  @Pending
  Scenario: Pending scenario
    When do stuffs
    Then this step should not be run

  @Manual
  Scenario: Manual scenario
    When do stuffs
    Then this step should not be run

  @Ignore
  Scenario: Ignore scenario
    When do stuffs
    Then this step should not be run

  Scenario: Use step marked as Pending
    When I use method marked as Pending
    Then this step should not be run

  @ReadThisTad @Read:ThisTag
  Scenario: ReadTags
    When I test tags
    Then I should see blabla and othertag

After hook is executed after the browser is closed

I have a serenity + cucumber project for a web application and I'm using this property serenity.restart.browser.for.each=scenario. And I have in CucumberHooks class an @after method which is executed after each scenario.

The issue is that the browser is restarted before the @after method is executed.

Is there something that I'm doing wrong?

I'm using:
<serenity.core.version>1.2.5-rc.1</serenity.core.version>
<serenity.cucumber.version>1.1.28</serenity.cucumber.version>

java.lang.NullPointerException at net.thucydides.core.requirements.model.cucumber.CucumberParser.loadFeatureNarrative(CucumberParser.java:51)

I have created project similar to cucumber-webtests , please refer to https://github.com/vikramvi/serenity-cucumber-wl , when I run always getting below error

567 [main] ERROR net.thucydides.core.model.TestOutcome - Tag provider net.thucydides.core.requirements.FileSystemRequirementsTagProvider@628c4ac0 failure
java.lang.NullPointerException
at net.thucydides.core.requirements.model.cucumber.CucumberParser.loadFeatureNarrative(CucumberParser.java:51)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadFromFeatureFile(FileSystemRequirementsTagProvider.java:551)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementsFromStoryOrFeatureFile(FileSystemRequirementsTagProvider.java:532)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$2.convert(FileSystemRequirementsTagProvider.java:511)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$2.convert(FileSystemRequirementsTagProvider.java:508)
at ch.lambdaj.function.convert.ConverterIterator.next(ConverterIterator.java:37)
at ch.lambdaj.Lambda.convert(Lambda.java:986)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadStoriesFrom(FileSystemRequirementsTagProvider.java:495)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements(FileSystemRequirementsTagProvider.java:132)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readChildrenFrom(FileSystemRequirementsTagProvider.java:615)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.requirementFromDirectoryName(FileSystemRequirementsTagProvider.java:574)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementFrom(FileSystemRequirementsTagProvider.java:524)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$1.convert(FileSystemRequirementsTagProvider.java:502)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$1.convert(FileSystemRequirementsTagProvider.java:499)
at ch.lambdaj.function.convert.ConverterIterator.next(ConverterIterator.java:37)
at ch.lambdaj.Lambda.convert(Lambda.java:986)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadCapabilitiesFrom(FileSystemRequirementsTagProvider.java:490)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements(FileSystemRequirementsTagProvider.java:131)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getTagsFor(FileSystemRequirementsTagProvider.java:256)
at net.thucydides.core.model.TestOutcome.getTagsUsingTagProviders(TestOutcome.java:1414)
at net.thucydides.core.model.TestOutcome.getTags(TestOutcome.java:1404)
at net.thucydides.core.model.TestOutcome.addTags(TestOutcome.java:1444)
at net.thucydides.core.steps.StepEventBus.addTagsToCurrentTest(StepEventBus.java:497)
at net.serenitybdd.cucumber.SerenityReporter.startScenario(SerenityReporter.java:406)
at net.serenitybdd.cucumber.SerenityReporter.startOfScenarioLifeCycle(SerenityReporter.java:399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:290)
at com.sun.proxy.$Proxy19.startOfScenarioLifeCycle(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.startOfScenarioLifeCycle(JUnitReporter.java:219)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:39)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Gherkin statement with double quotes is failing - cucumber.runtime.CucumberException: Arity mismatch

.feature file
When User hits "Create List" button

Scenariosteps.java
@when("User hits "(.*)" button")

results in below error

cucumber.runtime.CucumberException: Arity mismatch: Step Definition .... pattern [User hits "(.*)" button] is declared with 0 parameters. However, the gherkin step has 1 arguments [Create List].
Step: When User hits "Create List" button
at cucumber.runtime.StepDefinitionMatch.arityMismatch(StepDefinitionMatch.java:102)
at cucumber.runtime.StepDefinitionMatch.transformedArgs(StepDefinitionMatch.java:60)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:299)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Serenity Cucumber does not scan @Manual on feature level

Hi,
In the document, it states that tagging a feature file @Manual on feature (story) level would consider all scenarios under the file manual scenarios.

Generally, it is possible to use it to mark scenarios (@Manual on scenario level) or all scenarios in story (@Manual on Story level).

However, from what I've tested, it seems the report does not properly recognize scenarios on a file with @Manual on top of the file as manual scenarios. The test steps are not skipped; and there is no humanoid icon for the manual scenario on the report. Could you introduce a fix for this issue?
The workaround is to tag @Manual above each scenario.
I'm using Serenity Cucumber version 1.1.11

Serenity Jbehave Driver instantiation issue across multiple pages and how to run a specific story?

Hi,
I have created a Maven Archetype Project for Serenity Jbehave.

I am working on automation of few Acceptance Criteria from some website page validation.

I have created definition Steps,Step library,and Page Objects with one TestRunner (extends serenity stories).I have created a login functionality separately in reusable library(page object) and using that Login method in Main Definition Steps of Acceptance criteria(customercheck.story).But Whenever I am defining page object for this acceptance criteria in SearchAndCustprofileCheck.java it is asking to provide defaulturl. But I am using driver instance of login and wants to use the same instance throughout my navigation for homepage validation without providing any further defaulturl.

PFA the my project attachment for your reference with all details and POM.xml

Can you please check once and help me for any suitable solution.

Also Please let me know how to execute a specific story as junit.This is particularly important when I wnat to selectively run story out of many stories using Jbehave -Junit.

src.zip

src.zip

POM.XML:


4.0.0
com.serenity.jl
serenityjbehave
0.0.1-SNAPSHOT
jar

<name>Sample Serenity project using JBehave and WebDriver</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>1.1.36</serenity.version>
    <serenity.jbehave.version>1.13.0</serenity.jbehave.version>
    <webdriver.driver>chrome</webdriver.driver>
</properties>

<repositories>
  <repository>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    <id>central</id>
    <name>bintray</name>
    <url>http://jcenter.bintray.com</url>
  </repository>
</repositories>
<pluginRepositories>
  <pluginRepository>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    <id>central</id>
    <name>bintray-plugins</name>
    <url>http://jcenter.bintray.com</url>
  </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-core</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-jbehave</artifactId>
        <version>${serenity.jbehave.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.7</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>1.7.0</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.lambdaj</groupId>
        <artifactId>lambdaj</artifactId>
        <version>2.3.3</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                    <include>**/*TestSuitess.java</include>
                    <include>**/Test*.java</include>
                    <include>**/When*.java</include>
                </includes>
                <argLine>-Xmx512m</argLine>
                <systemPropertyVariables>
                    <webdriver.driver>${webdriver.driver}</webdriver.driver>
                </systemPropertyVariables>
            </configuration>
            <executions>

                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution> 


            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Thanks in advance.

Regards,
Avijit Dutta

Serenity-cucumber implementation for ruby and protractor

Hi does anyone know of any similar implementation for ruby and protractor. I'm looking at using serenity with cucumber. Found a ruby gem for serenity but that isn't the same as this module. Any information regarding this would be great.

Tests passing but show as pending in the log and the report

Hi there,
I have been trying to figure out why the test keep showing as pending whereas it is passing in Intellij, but it shows as pending when running it with Maven and also shows pending in Serenity Report site.
I have my project organised as follows:
Feature file example

Feature: Client should get the portfolio of the sky customer returned

In order to see the customer portfolio
As a client
I want to get the customer portfolio

Scenario: client gets customer portfolio
When the client gets the getPortfolio api using Id pid-xxxxxxxxxxxxxxxx
Then assert the profile result
And print out the results

Here I will just show part of the file, one step definition to demonstrate what am doing

package serenity.test.suite.steps.steps.services;

import cucumber.api.java.Before;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import net.thucydides.core.annotations.Steps;
import serenity.test.suite.steps.serenity.services.;
public class getPortfolio {
@steps
profileSteps profileClass;
@when("^the client gets the getPortfolio api using Id (.
)$")
public void the_client_gets_the_getPortfolio_api_using_Id_pid(String Id) //throws Throwable
{
profileClass.getProfileResponse(Id);
}
}

Then the step definition method "getProfileResponse" will call some other code located in other class under the serenity package

It's really confusing, it keep telling me the method is not implemented however it is clearly implemented and passing when I run it. However when I run it with Maven I get the below:

Tests run: 6, Failures: 0, Errors: 0, Skipped: 5, Time elapsed: 0.031 sec - in serenity.test.suite.steps.TestRunners.RunProductTests
Running serenity.test.suite.steps.TestRunners.RunServiceTests

1 Scenarios (1 undefined)
3 Steps (3 undefined)
0m0.000s

You can implement missing steps with the snippets below:

@when("^the client gets the getPortfolio api using Id pid-(\d+)$")
public void the_client_gets_the_getPortfolio_api_using_Id_pid(int arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

I would appreciate your assistance
Many thanks

Update serenity-core dependency

The current release is dependent on serenity-core:1.1.25 which is absent from Maven repositories. As a result, including serenity-cucumber causes unresolved dependency errors requiring manual workarounds. Can you update to 1.1.26+?

DefaultUrl for PageObjects is not working in case CucumberWithSerenity is in use

If we will have a following PageObject class:

@DefaultUrl("http://something")
public class LoginPage extends PageObject{
}

and will run test with SerenityRunner, following tests will be executed successfully, page will be opened:

@RunWith(SerenityRunner.class)
public class Login {

  @Managed
  WebDriver driver;

  @Steps
  LoginPage loginPage;

  @Test
  public void login() {
    loginPage.open();
  }

If we will run the same code with CucumberWithSerenity

Runer:

@RunWith(CucumberWithSerenity.class)
public class CuceRunner {}

Steps Definition:

public class LoginStepsDefinition {

  @Managed
  WebDriver driver;

  @Steps
  LoginPage loginPage;

  @Given("Login Page is opened")
  public void loginPageIsOpened() {
     loginPage.open();
  }
}

following error will be returned:
java.lang.AssertionError: Undefined default URL for page object PageNotFound$$EnhancerByCGLIB$$dc6a9f70

even though same PageObject is successfully working with SerenityRunner runner.
serenity-core version 1.0.47. serenity-cucumber 1.0.15

Incompatible types- Found: CucumberWithSerenity.class, expected: org.junit.runner.Runner

While defining CucumberWithSerenity test runner I get below error basically saying incompatible type. Has anyone encountered this issue?
Incompatible types- Found: CucumberWithSerenity.class, expected: org.junit.runner.Runner

I am creating a simple serenity cucumber BDD automation test using maven on google website just to see how serenity works. Please advise if I am missing anything here.

ATTACHED - pom.xml and error screenshot

Test is passed but getting error in consoal Tag provider net.thucydides.core.requirements.PackageRequirementsTagProvider@278beade failure net.thucydides.core.requirements.CouldNotLoadRequirementsException

[pool-1-thread-1] ERROR net.thucydides.core.model.TestOutcome - Tag provider net.thucydides.core.requirements.PackageRequirementsTagProvider@278beade failure
net.thucydides.core.requirements.CouldNotLoadRequirementsException
at net.thucydides.core.requirements.PackageRequirementsTagProvider.requirementPathsFromClassesInPackage(PackageRequirementsTagProvider.java:168)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.requirementPathsStartingFrom(PackageRequirementsTagProvider.java:156)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.requirementsReadFromClasspath(PackageRequirementsTagProvider.java:117)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.fetchRequirements(PackageRequirementsTagProvider.java:100)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.getRequirements(PackageRequirementsTagProvider.java:92)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.getRequirementFor(PackageRequirementsTagProvider.java:241)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.getTagsFor(PackageRequirementsTagProvider.java:261)
at net.thucydides.core.model.TestOutcome.getTagsUsingTagProviders(TestOutcome.java:1492)
at net.thucydides.core.model.TestOutcome.getTags(TestOutcome.java:1477)
at net.thucydides.core.model.TestOutcome.addTags(TestOutcome.java:1522)
at net.thucydides.core.steps.BaseStepListener.testFinished(BaseStepListener.java:371)
at net.thucydides.core.steps.StepEventBus.testFinished(StepEventBus.java:250)
at net.serenitybdd.jbehave.SerenityReporter.afterScenario(SerenityReporter.java:619)
at org.jbehave.core.reporters.DelegatingStoryReporter.afterScenario(DelegatingStoryReporter.java:43)
at org.jbehave.core.reporters.ConcurrentStoryReporter.afterScenario(ConcurrentStoryReporter.java:176)
at org.jbehave.core.embedder.PerformableTree$PerformableScenario.perform(PerformableTree.java:890)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.performScenarios(PerformableTree.java:811)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.perform(PerformableTree.java:784)
at org.jbehave.core.embedder.PerformableTree.performCancellable(PerformableTree.java:416)
at org.jbehave.core.embedder.PerformableTree.perform(PerformableTree.java:387)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:291)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:265)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[pool-1-thread-1] INFO net.serenitybdd.core.Serenity - �[92m

(AfterStories)

Generating reports view to 'C:\Users\E002979\Documents\BridgeStone\qa-automation-seed-project\target\jbehave' using formats '[stats, console, html, xml, serenityreporter, junitscenarioreporter]' and view properties '{decorateNonHtml=true}'
Reports view generated with 2 stories (of which 0 pending) containing 1 scenarios (of which 0 pending)
Tests run: 8, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 35.138 sec <<< FAILURE! - in com.vml.serenity.BridgestoneCommercialHomePage
com.vml.serenity.BridgestoneCommercialHomePage Time elapsed: 1.453 sec <<< ERROR!
java.lang.RuntimeException: net.thucydides.core.reports.ReportGenerationFailedError: Failed to generate configuration report
at java.util.concurrent.FutureTask.report(FutureTask.java:122)

Cucumber tests scenarios with Example Table

Dear Team,

We are using serenity (1.4.0) with cucumber (1.36.0) & facing an issue when our feature file contains Scenario Outline with Example Table.

The serenity report (index.html) is showing only 1 scenario as failed (100% failed) however there are 8 set of data in Example Table & out of which only 1 row failed.

Also when we click on the scenario name, the detailed view is not showing all the Given, When & Then statements in a tabular format (The way it shows for JBehave). Do we have something similar in Cucumber as well?

image

Would appreciate if you could provide any update on this.

Thanks.

Running individual tests using tags doesn't work

When using Serenity with Cucumber-JVM and adding a tag in the .feature file above the Feature or Scenario definition (e.g. @JIRA-123), then it is not possible to run that test by itself using Maven.

mvn clean verify -Dtags="JIRA-123"

Using Serenity Cucumber version 1.1.6 and Serenity Maven Version 1.1.31

Please confirm that this is an issue, alternatively please provide or document correct usage.

why i am getting net.thucydides.core.requirements.CouldNotLoadRequirementsException: null when added readyapi dependencies

Hi,

Serenity alone is working fine with maven. But when I add ready api dependencies I am getting following exception. Using Serenity 1.4, ReadyAPI 2.0.2.
Please help. Thanks

net.thucydides.core.requirements.CouldNotLoadRequirementsException: null
at net.thucydides.core.requirements.PackageRequirementsTagProvider.requirementPathsFromClassesInPackage(PackageRequirementsTagProvider.java:170)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.requirementPathsStartingFrom(PackageRequirementsTagProvider.java:155)
at net.thucydides.core.requirements.PackageRequirementsTagProvider.getActiveRequirementTypes(PackageRequirementsTagProvider.java:299)
at net.thucydides.core.model.PackageBasedLeafRequirements.typeFrom(PackageBasedLeafRequirements.java:38)
at net.thucydides.core.model.PackageBasedLeafRequirements.testCase(PackageBasedLeafRequirements.java:28)
at net.thucydides.core.model.TestOutcome.storyDefinedIn(TestOutcome.java:421)
at net.thucydides.core.model.TestOutcome.(TestOutcome.java:408)
at net.thucydides.core.model.TestOutcome.(TestOutcome.java:388)
at net.thucydides.core.model.TestOutcome.forTestInStory(TestOutcome.java:650)
at net.thucydides.core.steps.BaseStepListener.testStarted(BaseStepListener.java:378)
at net.thucydides.core.steps.StepEventBus.testStarted(StepEventBus.java:115)
at net.thucydides.core.steps.StepEventBus.testStarted(StepEventBus.java:142)
at net.thucydides.junit.listeners.JUnitStepListener.testStarted(JUnitStepListener.java:80)
at net.thucydides.junit.listeners.JUnitStepListener.startTestIfNotYetStarted(JUnitStepListener.java:136)
at net.thucydides.junit.listeners.JUnitStepListener.testFailure(JUnitStepListener.java:117)
at org.junit.runner.notification.SynchronizedRunListener.testFailure(SynchronizedRunListener.java:63)
at org.junit.runner.notification.RunNotifier$4.notifyListener(RunNotifier.java:142)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestFailures(RunNotifier.java:138)
at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:132)
at org.junit.internal.runners.model.EachTestNotifier.addFailure(EachTestNotifier.java:23)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:329)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at net.serenitybdd.junit.runners.SerenityRunner.performRunChild(SerenityRunner.java:471)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:446)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:55)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:155)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81)
at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:82)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:974)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:824)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Test mechanism Time elapsed: 12.082 sec <<< ERROR!
java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:45)
at net.thucydides.core.steps.BaseStepListener.getCurrentTestOutcome(BaseStepListener.java:301)
at net.thucydides.core.steps.StepEventBus.testFinished(StepEventBus.java:254)
at net.thucydides.junit.listeners.JUnitStepListener.testFinished(JUnitStepListener.java:97)
at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at net.serenitybdd.junit.runners.SerenityRunner.performRunChild(SerenityRunner.java:471)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:446)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:55)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:155)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81)
at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:82)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:974)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:824)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Run-time errors using serenity

While running my BDD test from IntelliJ IDEA 2016.3.4 I see scenario passed in IDEA but in logs scenario is mentioned as failed despite all steps are passed.
Also while executing test I am getting following errors:

`Failed scenarios:
/Users/dulyanov/Projects/../../src/test/resources/features/../any.feature:4 # Scenario: Test scenario

1 Scenarios (1 failed)
5 Steps (5 passed)
0m6.226s

java.lang.ExceptionInInitializerError
at net.serenitybdd.cucumber.actors.StageDirector.endTheAct(StageDirector.java:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:223)
at cucumber.runtime.Runtime.runHooks(Runtime.java:211)
at cucumber.runtime.Runtime.runAfterHooks(Runtime.java:205)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:46)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
at cucumber.runtime.Runtime.run(Runtime.java:121)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: com.google.inject.ConfigurationException: Guice configuration errors:

  1. No implementation for net.thucydides.core.webdriver.WebdriverManager was bound.
    while locating net.thucydides.core.webdriver.WebdriverManager

1 error
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:961)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
at net.serenitybdd.cucumber.actors.Cast.(Cast.java:20)
at net.serenitybdd.cucumber.actors.OnStage.(OnStage.java:9)
... 22 more`

Exception when using the Portuguese language

Although I set up both serenity and the Cucumber to use the Portuguese language - pt - serenity throws an exception that prevents him from generating the report.

The code that generate the exception is here: https://github.com/palerique/cucumber-serenity-webtests

Some codes to guide:

.feature file:

# language: pt
@component:ui
@version:Sprint-7
Funcionalidade: Buscar por palavra chave
  Para os compradores encontrarem o que estão procurando de forma mais eficiente
  Como um vendedor
  Desejo que os compradores possam buscar por artigos utilizando palavras chave

  Cenário: Buscar artigos por palavra chave
    Dado que quero comprar um cachecol de lã
    Quando eu buscar por 'wool'
    Então devo ver apenas artigos relacionados com 'wool'

  Cenário: Buscar por nome da loja
    Dado que desejo visualizar artigos de uma loja em particular
    Quando eu buscar uma loja por 'docksmith'
    Então devo encontrar 1 loja chamada 'docksmith'

  Delineação do Cenário: Buscar por muitos artigos utilizando palavra chave
    Dado que quero comprar um <article>
    Quando eu buscar por '<article>'
    Então devo ver apenas artigos relacionados com '<keyword>'
    Exemplos:
      | article      | keyword |
      | wool scarf   | wool    |
      | cotton shirt | cotton  |

steps file:

package net.thucydides.showcase.cucumber.steps;

import cucumber.api.java.pt.Dado;
import cucumber.api.java.pt.Entao;
import cucumber.api.java.pt.Quando;
import net.thucydides.core.annotations.Steps;
import net.thucydides.core.util.Inflector;
import net.thucydides.showcase.cucumber.steps.serenity.BuyerSteps;

import java.text.ParseException;

public class SearchScenarioSteps {
    @Steps
    BuyerSteps buyer;

    @Dado("que (?:quero|possa querer) comprar um (.*)")
    public void buyerWantsToBuy(String article) {
        buyer.opens_home_page();
    }

    @Quando("eu buscar por '(.*)'")
    public void searchByKeyword(String keyword) {
        buyer.searches_by_keyword(keyword);
    }

    @Entao("devo ver apenas artigos relacionados com '(.*)'")
    public void resultsForACategoryAndKeywordInARegion(String keyword) throws ParseException {
        buyer.should_see_results_summary_containing(keyword);
    }

    @Dado("que desejo visualizar artigos de uma loja em particular")
    public void givenIWantToSeeArticlesFromAParticularShop() {
        buyer.opens_home_page();
    }

    @Quando("eu buscar uma loja por '(.*)'")
    public void whenISearchByShopFor(String shopName) {
        buyer.should_see_nonexistant_field();
        buyer.searches_for_shop_called(shopName);
    }

    @Entao("devo encontrar (\\d+) (?:loja|lojas) chamada '(.*)'")
    public void thenIShouldFindShopsCall(int count, String shopName) {
        String expectedMessage = String.format("%d %s encontrada para %s", count, pluralized(count, "loja"), shopName);
        buyer.should_see_shop_search_result_summary_of(expectedMessage);
    }

    private String pluralized(int count, String word) {
        return Inflector.getInstance().pluralize(word, count);

    }
}

serenity.properties:

#webdriver.driver=chrome
webdriver.driver=firefox
serenity.project.name = Demo Project using Serenity and Cucumber

serenity.use.unique.browser = false

serenity.browser,height = 1200
serenity.browser,width = 1200
serenity.dry.run=false

# How long does Serenity wait for elements that are not present on the screen to load
webdriver.timeouts.implicitlywait = 5000
serenity.take.screenshots=AFTER_EACH_STEP

# Like code
feature.file.language=pt
# Like docs
feature.file,language=pt

The stacktrace:

599 [main] ERROR net.thucydides.core.model.TestOutcome - Tag provider net.thucydides.core.requirements.FileSystemRequirementsTagProvider@7203c7ff failure
gherkin.parser.ParseError: Parse error at search_by_keyword.feature:22. Found examples when expecting one of: background, comment, scenario, scenario_outline, tag. (Current getState: feature).
        at gherkin.parser.Parser$Machine.event(Parser.java:207)
        at gherkin.parser.Parser.event(Parser.java:159)
        at gherkin.parser.Parser.examples(Parser.java:124)
        at gherkin.lexer.Pt.scan(Pt.java:966)
        at gherkin.lexer.I18nLexer.scan(I18nLexer.java:36)
        at gherkin.parser.Parser.parse(Parser.java:62)
        at net.thucydides.core.requirements.model.cucumber.CucumberParser.loadFeatureNarrative(CucumberParser.java:45)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadFromFeatureFile(FileSystemRequirementsTagProvider.java:515)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementsFromStoryOrFeatureFile(FileSystemRequirementsTagProvider.java:496)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$2.convert(FileSystemRequirementsTagProvider.java:475)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$2.convert(FileSystemRequirementsTagProvider.java:472)
        at ch.lambdaj.function.convert.ConverterIterator.next(ConverterIterator.java:37)
        at ch.lambdaj.Lambda.convert(Lambda.java:986)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadStoriesFrom(FileSystemRequirementsTagProvider.java:459)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements(FileSystemRequirementsTagProvider.java:138)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readChildrenFrom(FileSystemRequirementsTagProvider.java:579)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.requirementFromDirectoryName(FileSystemRequirementsTagProvider.java:538)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementFrom(FileSystemRequirementsTagProvider.java:488)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$1.convert(FileSystemRequirementsTagProvider.java:466)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider$1.convert(FileSystemRequirementsTagProvider.java:463)
        at ch.lambdaj.function.convert.ConverterIterator.next(ConverterIterator.java:37)
        at ch.lambdaj.Lambda.convert(Lambda.java:986)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadCapabilitiesFrom(FileSystemRequirementsTagProvider.java:454)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements(FileSystemRequirementsTagProvider.java:137)
        at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getTagsFor(FileSystemRequirementsTagProvider.java:263)
        at net.thucydides.core.model.TestOutcome.getTagsUsingTagProviders(TestOutcome.java:1271)
        at net.thucydides.core.model.TestOutcome.getTags(TestOutcome.java:1261)
        at net.thucydides.core.model.TestOutcome.addTags(TestOutcome.java:1286)
        at net.thucydides.core.steps.StepEventBus.addTagsToCurrentTest(StepEventBus.java:475)
        at net.serenitybdd.cucumber.SerenityReporter.startScenario(SerenityReporter.java:395)
        at net.serenitybdd.cucumber.SerenityReporter.startOfScenarioLifeCycle(SerenityReporter.java:387)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at cucumber.runtime.Utils$1.call(Utils.java:37)
        at cucumber.runtime.Timeout.timeout(Timeout.java:13)
        at cucumber.runtime.Utils.invoke(Utils.java:31)
        at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:290)
        at com.sun.proxy.$Proxy19.startOfScenarioLifeCycle(Unknown Source)
        at cucumber.runtime.junit.JUnitReporter.startOfScenarioLifeCycle(JUnitReporter.java:219)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:39)
        at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
        at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
        at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
        at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBoot
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

pom.xml:

<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.serenity-bdd.demos</groupId>
    <artifactId>cucumber-webtests</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Sample Serenity Cucumber project</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <serenity.version>1.0.59</serenity.version>
        <serenity.maven.version>1.0.58</serenity.maven.version>
        <serenity.cucumber.version>1.0.18</serenity.cucumber.version>
    </properties>

    <!-- Define the Bintray repos for convenience -->
    <repositories>
        <repository>
            <id>serenity</id>
            <name>bintray</name>
            <url>http://dl.bintray.com/serenity/maven</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>serenity</id>
            <name>bintray-plugins</name>
            <url>http://dl.bintray.com/serenity/maven</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-rest-assured</artifactId>
            <version>${serenity.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-cucumber</artifactId>
            <version>${serenity.cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.8.6</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.lambdaj</groupId>
            <artifactId>lambdaj</artifactId>
            <version>2.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>1.7.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <requireUpperBoundDeps/>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18</version>
                <configuration>
                    <includes>
                        <include>**/cucumber/*.java</include>
                    </includes>
                    <reuseForks>true</reuseForks>
                    <!--<forkCount>2</forkCount>-->
                    <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${serenity.maven.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>net.serenity-bdd</groupId>
                        <artifactId>serenity-core</artifactId>
                        <version>${serenity.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

cucumber-spring issue with Spring annotations

Trying to use cucumber serenity but it doesn't pick up Spring beans defined using org.springframework.context.annotation.Configuration & org.springframework.context.annotation.Bean

@Configuration
public class AppConfig {
    @Bean
    public MyBean getMyBean() {
    }
}

Incorrect order of displaying the example values in the Step Description

Hi,
Steps to reproduce:
(1) Execute the scenario outline below
Scenario Outline: Buying lots of widgets
Given I want to purchase widgets
And a widget costs $
When I buy the widgets
Then I should be billed $
Examples:
| amount | cost | total |
| 0 | 10 | 0 |
| 1 | 10 | 10 |
| 2 | 10 | 50 |
| 2 | 0 | 0 |

[Actual] The Step's Description would be as follow:
[1] {amount=0, total=0, cost=10}
[1] {amount=1, total=10, cost=10}
[1] {amount=2, total=50, cost=10}
[1] {amount=2, total=0, cost=0}

[Expected]
The Step's Description would be as follow:
[1] {amount=0, cost=10, total=0}
[1] {amount=1, cost=10, total=10}
[1] {amount=2, cost=10, total=50}
[1] {amount=2, cost=0, total=0}

I've played into SerenityReporter and fixed that adding instead of Map<K,V> the LinkedHaspMap<K, V>

private List<Map<String, String>> getValuesFrom(List examplesTableRows, List headers) {

    List<Map<String, String>> rows = Lists.newArrayList();

    for (int row = 1; row < examplesTableRows.size(); row++) {
        LinkedHashMap<String, String> rowValues = Maps.newLinkedHashMap();
        int column = 0;
        for (String cellValue : examplesTableRows.get(row).getCells()) {
            String columnName = headers.get(column++);
            rowValues.put(columnName, cellValue);
        }
        rows.add(rowValues);
    }
    return rows;
}

private void addRow(List<Map<String, String>> exampleRows,
                    List<String> headers,
                    ExamplesTableRow currentTableRow) {
    LinkedHashMap<String, String> row = new LinkedHashMap<>();
    for (int j = 0; j < headers.size(); j++) {
        row.put(headers.get(j), currentTableRow.getCells().get(j));
    }
    exampleRows.add(row);
}

I think the order is important due to that the Step Description should be right ordered with example's values when viewing the scenario outline in the Serenity Html Report.

Thanks,
Andy

Jira link in tests missing after 1.1.14

The issue links in the tests in the serenity report to jira tickets are missing after version 1.1.14 even though the issue tag is present in the feature file.

serenityVersion=1.2.3-rc.3
serenityJiraVersion=1.1.3-rc.2
serenityCucumberVersion=1.1.23

Serenity Cucumber is failing by opening multiple browser instance of chrome driver

Hi,

I am working on serenity -cucumber projects with testrunner class, stepdefinition class , and individual page object abstraction is mentioned here.
I have also mentioned in serenity.properties file

serenity.properties:
webdriver.driver=CHROME
webdriver.chrome.driver=C://Cucumber//chromedriver_win32//chromedriver.exe
serenity.use.unique.browser=true

My issue is that I am combining 3 feature file with filtering tags to create a testcase .But chrome driver is invoking 3 times without doing anything and consequently tests are failing.

testrunner class: (Directory :test.resources.run)
package test.resources.run;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.ManagedPages;
import net.thucydides.core.annotations.Steps;
import net.thucydides.core.pages.Pages;
import net.serenitybdd.cucumber.SerenityReporter;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
features = "src/test/resources/features"
,glue={"test/resources/steps"}
,tags={"@Login,@ProfileCheck,@Logout"}

    )

public class TestRunner {

}

I have 3 feature files namely alogin.feature,bdpacheck.feature and clogout.feature

Directory(test.resources.features)
alogin.feature
Feature: Login Action

@Login
Scenario: Successful Login with Valid Credentials
Given User is on Home Page
When User enters UserName and Password
|Fields | Value|
|username | UserID|
|pwd| Pwd|
Then Message displayed Login Successfully

bdpacheck.feature
Feature: DPA Check in HomePage

@ProfileCheck
Scenario:Customer Profile Check
Given the agent has performed search for customer "Cust Name" in HomePage
And the search result returns a list of customer
When the agent has selected the customer "Mr Cust Name"
Then the agent can view corresponding customer profiles within customer

clogout.feature
Feature: Logout action

@Logout
Scenario: Successful LogOut
When User LogOut from the Application

Then Message displayed LogOut Successfully

StepDefinition file

Directory (test.resources.steps)
TestStpes.java

package test.resources.steps;

import java.util.concurrent.TimeUnit;

import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.apache.log4j.Logger;
import org.junit.Test;
import org.apache.log4j.LogManager;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.PageFactory;
//import org.testng.annotations.BeforeTest;
import cucumber.api.DataTable;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import net.thucydides.core.annotations.Step;
import test.resource.connexcase.config.Config;
import test.resource.connexcase.steps.*;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.ManagedPages;
import net.thucydides.core.annotations.Steps;
import net.thucydides.core.pages.Pages;

public class TestSteps {

@Steps                                                                      
LoginSteps loginHome;

@Steps  
CustomerCheckSteps custCheck;

@Steps
LogoutSteps logout;


    @Given("^User is on Home Page$")
    public void OpenBaseUrl()
    {
        String str = "salesforce";
    loginHome.openURL(str);

        }

    @When("^User enters UserName and Password$")
    public void LoginwithCred(DataTable table) throws InterruptedException
     {
    // WHEN   User enters UserName and Password
        loginHome.LoginWithValidCredential(table);;

    }

    @Then("^Message displayed Login Successfully$")
    public void Loginhome()
    {
        String str = "Case - Console";
    // THEN Message displayed Login Successfully
    loginHome.NaviagteHomePage(str);

    }


    @Given("^the agent has performed search for customer \"([^\"]*)\" in Connex Case$")

    public void SearchCustomer(String CustName) throws InterruptedException
    {
        custCheck.custSearch(CustName);

    }

    @Given("^the search result returns a list of customer$")

    public void ListOfCustomer()
    {
        custCheck.custList();
    }


    @When("^the agent has selected the customer \"([^\"]*)\"$")

    public void SelectCustomer(String Customer) throws InterruptedException
    {
        custCheck.selectCust(Customer);
    }

    @Then("^the agent can view corresponding customer profiles within customer$")
    public void CustomerView()
    {
        custCheck.CustProfileview();
    }



    @When("^User LogOut from the Application$")

    public void LogOff() throws InterruptedException
    {
       logout.LoggingOff();
    }


    @Then("^Message displayed LogOut Successfully$")

     public void LogOffPage()
     {
        logout.LandingPage();
     }

}

and the corresponding step library are LoginSteps.java,CustomerCheckSteps.java and LogoutSteps.java
are placed under test.resource.connexcase.steps

LoginSteps.java,

package test.resource.connexcase.steps;

import org.junit.Test;
import org.openqa.selenium.WebDriver;

import cucumber.api.DataTable;
import test.resource.connexcase.config.Config;
import test.resource.connexcase.pages.HomePage;
import net.thucydides.core.annotations.Step;

public class LoginSteps {

HomePage homepage;

@Step
public void openURL(String string1) {
    // TODO Auto-generated method stub
    homepage.open1(string1);

}
@Step
public void LoginWithValidCredential(DataTable table) throws InterruptedException {
    // TODO Auto-generated method stub
    homepage.LoginWithValidCredential(table);
}

@Step
public void NaviagteHomePage(String string4) {
    // TODO Auto-generated method stub
    homepage.NaviagteHomePage(string4);
}

}

CustomerCheckSteps.java

package test.resource.connexcase.steps;

import org.junit.Test;
import org.openqa.selenium.WebDriver;
import test.resource.connexcase.config.Config;
import test.resource.connexcase.pages.SearchAndCustprofileCheck;
import net.thucydides.core.annotations.Step;

public class CustomerCheckSteps {

SearchAndCustprofileCheck custdetail;

@Step
public void custSearch(String string1) throws InterruptedException {
    // TODO Auto-generated method stub

    custdetail.customerSearch(string1);

}
@Step
public void custList() {
    // TODO Auto-generated method stub
    custdetail.customerList();
}
@Step
public void selectCust(String string2) throws InterruptedException {
    // TODO Auto-generated method stub
    custdetail.customerSelect(string2);
}
@Step
public void CustProfileview() {
    // TODO Auto-generated method stub
    custdetail.custProfile();
}

}
LogoutSteps.java

package test.resource.connexcase.steps;
import org.junit.Test;

import test.resource.connexcase.pages.LogoutApp;
import net.thucydides.core.annotations.Step;

public class LogoutSteps {

LogoutApp logoutapp;

@Step
public void LoggingOff() throws InterruptedException
{
    logoutapp.logout();
}

@Step
public void LandingPage()
{
    logoutapp.landingPage();
}

}

The pgaeObject classed are mentioned below for each of Login(HomePage.java),CustomerCheck(SearchAndCustprofileCheck.java) and Logout(LogoutApp.java)

HomePage.java

package test.resource.connexcase.pages;
import test.resource.connexcase.config.Config;
import test.resources.steps.TestSteps;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.pagefactory.*;
import cucumber.api.DataTable;
import net.serenitybdd.core.pages.PageObject;
import net.serenitybdd.core.pages.WebElementFacade;
import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.ManagedPages;
import net.thucydides.core.pages.Pages;

import org.openqa.selenium.chrome.ChromeDriver;

import java.util.Base64;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class HomePage extends PageObject{

Logger Log = LogManager.getLogger("DebugLogger");

public void open1(String logo) 
{   

   //getDriver().get("Url");    

   String txt = getDriver().findElement(By.xpath("//img[@id='logo']")).getText();

    System.out.println(txt);
    if (txt ==logo)
    {

        Log.info("User Is on home");
        //System.out.println("User is on home Page");
    }

    try {
        Thread.sleep(2);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

public void LoginWithValidCredential(DataTable table) throws InterruptedException
{

    List<List<String>> data = table.raw();
    System.out.println(data.get(1).get(1));
    getDriver().findElement(By.id("username")).sendKeys(data.get(1).get(1));


    // Decryption of string
    System.out.println(data.get(2).get(1));
    String encryptedPassword = data.get(2).get(1);
    byte[] decryptedPasswordBytes = Base64.getDecoder().decode(encryptedPassword);
    String decryptedPassword = new String(decryptedPasswordBytes);

    getDriver().findElement(By.id("password")).sendKeys(decryptedPassword);
    //driver.findElement(By.id("username")).sendKeys(usrID);     
    // driver.findElement(By.id("password")).sendKeys(Pwd);
    getDriver().findElement(By.id("Login")).click();
    Thread.sleep(2);

}

public void NaviagteHomePage(String browserTitle) {
    // TODO Auto-generated method stub

    getDriver().manage().window().maximize();
    try {
        Thread.sleep(5);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    Boolean bb = getDriver().getTitle().equalsIgnoreCase(browserTitle);
    if (bb)
    {
    Log.info("Login successfully in the Salesforce Portal");
    //System.out.println("Login Successfully");

    }
}

}

SearchAndCustprofileCheck.java

package test.resource.connexcase.pages;

import test.resources.steps.TestSteps;
import test.resource.connexcase.config.Config;
import test.resource.connexcase.pages.HomePage;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import net.serenitybdd.core.pages.PageObject;
import net.serenitybdd.core.*;
import net.serenitybdd.core.pages.WebElementFacade;
import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.guice.Injectors;
import net.thucydides.core.webdriver.WebdriverManager;

import java.util.Base64;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class SearchAndCustprofileCheck extends PageObject
{

     Logger Log = LogManager.getLogger("DebugLogger"); 


public void customerSearch(String cust) throws InterruptedException

{
    //Injectors.getInjector().getInstance(WebdriverManager.class).getWebdriver();

    Thread.sleep(4);

    getDriver().findElement(By.xpath("//input[@id='phSearchInput']")).clear();

    getDriver().findElement(By.xpath("//input[@id='phSearchInput']")).sendKeys(cust);

    getDriver().findElement(By.xpath("//input[@id='phSearchInput']")).sendKeys(Keys.ENTER);
    Thread.sleep(2);


}

public void customerList()
{
    getDriver().switchTo().frame("ext-comp-1019");
    if(getDriver().findElement(By.id("Contact_body")).isDisplayed())
    {
      Log.info("Search Returns the Specific Customer");
      //System.out.println("Search return the specified customer");
    }

}

public void customerSelect(String cust) throws InterruptedException
{

  java.util.List<WebElement> links = getDriver().findElements(By.tagName("a"));

    for (int i = 1; i<=links.size()-1; i=i+1)

    {
        //System.out.println(links.get(i).getText());

        if (links.get(i).getText().equalsIgnoreCase(cust))
        {
            links.get(i).click();
            System.out.println("Clicked");
            Thread.sleep(2);
        }

    }


}


public void custProfile()

{
    WebElement aa = getDriver().findElement(By.className("pbHeader"));
    WebElement bb =aa.findElement(By.className("pbTitle"));
    String hh = bb.getText().toString();
    if (hh.contains("Customer Detail"))
        {
        Log.info("Agent is able to view the customer details");
        //System.out.println("Agent able to view the customer details");

        }
    getDriver().switchTo().defaultContent();
}

}

LogoutApp.java

package test.resource.connexcase.pages;
import test.resources.steps.TestSteps;
import test.resource.connexcase.config.Config;
import test.resource.connexcase.pages.HomePage;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import net.serenitybdd.core.pages.PageObject;
import net.serenitybdd.core.pages.WebElementFacade;
import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.annotations.Managed;

import java.util.Base64;
import java.util.concurrent.TimeUnit;

public class LogoutApp extends PageObject{

//static WebDriver driver;

Logger Log = LogManager.getLogger("DebugLogger"); 

public void logout() throws InterruptedException
{
    getDriver().findElement(By.xpath("//span[@id ='userNavLabel']")).click();
    Thread.sleep(2);
    getDriver().findElement(By.xpath("//a[@title='Logout']")).click();
    Thread.sleep(2);

}

public void landingPage()
{
    Log.info("Logged out successfully");
    boolean cc = getDriver().getTitle().equalsIgnoreCase("Login | Salesforce");
    //System.out.println("Logout Successfully");
    if (cc)
    {
        Log.info("Logged out successfully");
    }
    getDriver().quit();
}

}

Can you please help me in this regards?As each time I tried to execute testrunner.class as junit testcases , it basically trying to open 3 blank chrome page but without doing nothing although defined all properties in serenity.properties along with default.url. I want entire flow to be executed in a single chrome driver session instead of opening 3 chrome browser.

Please help me to resolve this.

Regards,
Avijit Dutta

(Question not issue) Maven POM file out of date

hey guys,

just imported as Maven project and noticed that the POM file has the old namespace therefore compilation errors. I'm guessing Gradle is what used for this project.

Would it worth the while for me cleaning up the POM file?

thanks
Dimi

Serenity Cucumber does not recognise JUnit Test Rules

Serenity does not seem to recognise JUnit Test Rules. It does however recognise JUnit TestClass Rules. This is because Cucumber does not support JUnit TestRules for philosophical reasons. The Cucumber project does have their own spring integration, which theoretically should be usable in place of something like SpringMethodRule JUnit TestRule. However Cucumber's Spring Integration does not seem to work when Guice is on the classpath, which is a critical dependency of serenity-core.

See serenity-bdd/serenity-core#221 for more info.

Problems with tags when mixing cucumber and serenity tests

Hi,

I have different tests in my project. Some use the CucumberWithSerenity runner, some others (typically some smoke tests) simply use the SerenityRunner.

When I want to execute a subset of the cucumber tests + the smoke tests, I use the tags as follow:

mvn clean verify -Dcucumber.options="--tags @f17.05" -Dtags="smoke-test"

The trouble is that I have the following error:

None of the features at [src/test/resources/features] matched the filters: [@f17.05, @smoke-test]

Although the feature files contain the tag @f17.05. As if cucumber was searching for a test which is tagged both by f17.05 and smoke-test, as if serenity called cucumber with the --tags @f17.05 --tags @smoke-test instead of --tags @f17.05,@smoke-test (AND instead of OR : https://github.com/cucumber/cucumber/wiki/Tags). Moreover, I did not ask cucumber to handle the tag smoke-test, it was a serenity tag...

Any idea of how I can achieve this ? Do I need to move all my tags from feature files to java (@WithTag) ? If this is not a bug, it is quite unlogical the way it handle the different tags...

Thanks

Serenity Cucumber: Mark manual tests as pass/fail

Hi,
I've got a quick question.
On the overall test results tab, is it possible to mark manual tests as pass or fail in feature files?
As far as I know, all those manual tests are categorized as Pending.
image

Thank you,
Warit

support for JIRA integration?

Will there be support for the serenity-jira integration with cucumber? I'm currently using serenity-cucumber 1.1.1 and serenity-jira 1.0.1
I already tried all documented variations for the mapping of features/scenarios to stories "imported" from JIRA:

  • @issue resp. @issue annotations on the feature like documented for jbehave,
  • @jira issuekey annotation on the feature as recommended by cucumber,
  • mentioning the jira issuekey in the Feature title like documented for junit testclasses

but none of them map the acceptance tests to the appropriate JIRA stories.

Ideally this would work using the @jira issuekey annotation since this is the way recommended by cucumber for mapping features and scenarios to requirements documented elsewhere.
But I guess it may be easier to copy the handling of the @issue notation in the SerenityReporter class over from the jbehave plugin.

Obtuse Error when Feature title is missing.

When the cucumber features are missing the optional name after the Feature keyword like in

Feature: 
In order to encourage buyers to make a purchase
As a seller
I want buyers to be able to see details about a product

Scenario: Display product details from the search list
Given I have searched for 'Docking station'
When I select item 1
Then I should see product description and price on the details page

then the report will not record the test and maven will show the following error (but ignore it and report a success anyway).

[WARNING] this file was not a valid JSON Thucydides test report: 33a9afec97724d7bbe27d661df4c2083bea2c37fe5a6eef00adb17a5055deac6.json
HV000041: Call to TraversableResolver.isReachable() threw an exception.
[WARNING] this file was not a valid JSON Thucydides test report: 62701f3618ac093e27d21702ab1be4dcdf864c2c1c792119213bc4055dc8917b.json
HV000041: Call to TraversableResolver.isReachable() threw an exception.
[WARNING] this file was not a valid JSON Thucydides test report: 8cb21874ba5a428e008ec00f417d237f04c5d519d592a2063b4890df3aa6b702.json
HV000041: Call to TraversableResolver.isReachable() threw an exception.
[WARNING] this file was not a valid JSON Thucydides test report: b55f75b7aa367d89d1eed9c63e4f8e6e0c948ff3c599ac20c43a1fa694c0048a.json
HV000041: Call to TraversableResolver.isReachable() threw an exception.

This is caused by the hashCode function on the UserStory barfing that the id field are null. And indeed the id and storyName attributes are missing in the json file, which causes the validation to fail.

I have not looked further into this but it seems to me that it would either generate some sensible default from the filename or failing sooner with a better error message would be helpful for new users.

Adding the name after the Feature keyword fixes the issue and adds the test to the reporting output.

Serentiy Report with protracor and cucumber

I have protractor cucumber example works fine, now I'm trying to create report by serenity.js

protractor.conf.js file

exports.config = {
    getPageTimeout: 600000,
    allScriptsTimeout: 700000,
    framework: 'custom',
    frameworkPath: require.resolve('serenity-js'),
    capabilities: {
        'browserName': 'chrome'
    },
    specs: [
        '/home/git/adap_gateway/src/test/features/*.feature'
    ],
    baseURL: 'http://localhost:8099/',
    cucumberOpts: {
        require: '/home/git/adap_gateway/src/test/javascript/stepDefinitions.js',
        format: ['pretty'],
    }
};

The feature file

Feature: Running Cucumber with Protractor

  Scenario: Protractor and Cucumber Test
    Given I go to "http://localhost:8099/#/"
    When I add login credential
    Then I go to scenario home page
    Then I go to scenario details page
    Then I go to edit attack tree page
    Then build attack tree

ANd package.json file is

{
    "name": "c",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
     "dependencies": {
      "gulp": "^3.9.1",
      "protractor-cucumber": "^0.1.8",
     "protractor-cucumber-framework": "^3.1.0"
     },
     "devDependencies": {
     "protractor-cucumber": "^0.1.8",
     "serenity-cli": "^0.2.4",
     "serenity-js": "^1.4.1",
     },
    "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "prereport": "serenity update",
     "report":  "serenity run"
    },
    "author": "",
    "license": "ISC"
}

I get

E/launcher - Error: Error: EACCES: permission denied, scandir '/etc/cups/ssl' at Error (native) at Object.fs.readdirSync (fs.js:952:18) at GlobSync._readdir (/home/ali/node_modules/cucumber/node_modules/glob/sync.js:2‌​88:41) [18:15:41] E/launcher - 
Process exited with error code 100,

Do you have any instructions?

Unable to use serenity-cucumber (aka thucydides-cucumber) along with cucumber-guice

I've created Cucumber test project and successfully configured Guice support by cucumber-guice. When I've added serenity-cucmber and configure test runner with CucumberWithSerenity I've got an error:

More than one Cucumber ObjectFactory was found in the classpath

You probably may have included, for instance, cucumber-spring AND cucumber-guice as part of
your dependencies. When this happens, Cucumber falls back to instantiating the
DefaultJavaObjectFactory implementation which doesn't provide IoC.
In order to enjoy IoC features, please remove the unnecessary dependencies from your class path.

The cause is there are two ObjectFactory implementations:

  • cucumber.runtime.java.guice.impl.GuiceFactory (in cucumber-guice)
  • cucumber.runtime.SerenityObjectFactory (in serenity-cucumber)

Is it possible to use serenity-cucumber along with cucumber guice?

feature marked as pending instead of success

To reproduce the issue:

  1. clone this repository, and checkout the branch submodule.
  2. mvn clean install on the root project (or from the module directory)
  3. check the generated report (requirement tab)

The report should look like this : all tests in success except one in pending. (please note that is marked that 33% of tests are success instead of 50%)

img

Expected : all tests are succed.

workaround: change, in the aa.feature file the line Fonctionnalité: AA scénario to match the file feature name.

ie : Fonctionnalité: AA scénario should be rewrite as Fonctionnalité: aa as it's in the aa.feature file.

No 'data driven sample scenario' generated in the Serenity Html Report

Hi,
Perhaps it could more related to Serenity-Core, it actually could be also an issue reproduced for Serenity-JBehave.

When I mean sample scenario, there is a section above of Examples table (e.g 'http://wakaleo.com/thucydides-sample-reports/c2c1decb61b963a0194169cd710f500f63ec570e622f9b9bd8b7870f21ed3c9c.html')

Steps to reproduce:
(1) Execute the scenario below:
Scenario: Non-web Data-driven testing from an external CSV file

Given the data in data/names-data.csv
When we enter this data
Then the values should be correct

The output is as follow, the 'Examples' table is populated:
Examples:
FIRSTNAME LASTNAME EXPECTEDFIRSTNAME EXPECTEDLASTNAME
Joe Smith Will Smith
Forrest Bill Scott George

But the Scenario Sample section is blank.

TestOutcome.java -> there is a check first step to have children, that's why it has been failed to get the sample:
public String getDataDrivenSampleScenario() {
if(this.isDataDriven() && !this.getTestSteps().isEmpty() && ((TestStep)this.getTestSteps().get(0)).hasChildren()) {
TestStep firstExample = (TestStep)this.getTestSteps().get(0);
StringBuilder sampleScenario = new StringBuilder();

Maybe this is a cosmetic issue, that's not really works like a Scenario Outline with Example data table. What do you think?

Thanks,
Andy

Misleading/Wrong Serenity report in case of exception during hook execution

Hello,

Serenity reports buggy scenario results in case an exception occurs during the execution of some (@before) hook. Some scenarios are reported as ignored, some as passed.

Imagine an exception gets thrown in a before hook:

    @Before
    public void setup() {
        System.out.println("Executing @Before Hook");
        // simulate some external operation that fails for some reason, e.g. database setup/cleanup
        throw new RuntimeException("Oops! Some exception happened during hook execution!");
    }

Then Cucumber correctly reports:

3 Scenarios (3 failed)
12 Steps (12 skipped)
0m0.002s

But Serenity instead comes up with this results:

2 test scenarios (3 tests in all, including 2 rows of test data)
| 1 passed | 1 ignored | 

A sample project to reproduce the problem can be found at:
https://github.com/datentyp/bugs-cucumber-hooks-and-serenity-report

The sample project does contain more details on the bug and the expected behavior. I've included the generated report for a quick view as well.

Regards,
Wolfgang

The Serenity Steps are not skipped/ ignored if the feature is annotated with @wip

Hi,
I've executed a feature which is annotated with @wip tag and noticed that the Serenity steps are NOT ignored/ skipped (although Cucumber Steps are skipped).

I've played a little into the SerenityReporter and added the following statements checkForSkipped And checkForPending, as below and as a result the Serenity Steps would be marked as ignored.
private void startScenario(Scenario scenario) {
getThucydidesListeners().withDriver(ThucydidesWebDriverSupport.getDriver());
StepEventBus.getEventBus().testStarted(scenario.getName());
StepEventBus.getEventBus().addDescriptionToCurrentTest(scenario.getDescription());
StepEventBus.getEventBus().addTagsToCurrentTest(convertCucumberTags(currentFeature.getTags()));
StepEventBus.getEventBus().addTagsToCurrentTest(convertCucumberTags(scenario.getTags()));

    checkForSkipped(currentFeature);
    checkForPending(currentFeature);
}

Maybe there is a better fix. Have a look.

Andy

NoClassDefFoundError: net/thucydides/core/statistics/service/InjectedTagProvider

We are having an issue running BDD tests in IntelliJ Idea using JUnit. Our project is using the following serenity dependencies:

  • serenity-core (1.2.4)
  • serenity-junit (1.2.4)
  • serenity-rest-assured (1.2.4)
  • serenity-cucumber (1.1.29)

A test will run and the given/when/then steps successfully execute, but the test fails at "Class Configuration" with the following error:
java.lang.NoClassDefFoundError: net/thucydides/core/statistics/service/InjectedTagProvider

at net.serenitybdd.cucumber.service.CucumberTagProviderStrategy.getTagProviders(CucumberTagProviderStrategy.java:34)
at net.thucydides.core.statistics.service.ClasspathTagProviderService.tagProvidersThatCanProcess(ClasspathTagProviderService.java:63)
at net.thucydides.core.statistics.service.ClasspathTagProviderService.loadTagProvidersFromPath(ClasspathTagProviderService.java:39)
at net.thucydides.core.statistics.service.ClasspathTagProviderService.getTagProviders(ClasspathTagProviderService.java:23)
at net.thucydides.core.model.TestOutcome.getTags(TestOutcome.java:1618)
at net.thucydides.core.model.TestOutcome.addTags(TestOutcome.java:1663)
at net.thucydides.core.steps.BaseStepListener.testFinished(BaseStepListener.java:434)
at net.thucydides.core.steps.StepEventBus.testFinished(StepEventBus.java:256)
at net.serenitybdd.cucumber.SerenityReporter.result(SerenityReporter.java:603)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:294)
at com.sun.proxy.$Proxy19.result(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.result(JUnitReporter.java:121)
at cucumber.runtime.Runtime.runStep(Runtime.java:310)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:38)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

0 Scenarios ()
4 Steps (4 passed)
0m4.654s

I have looked in all my relevant jar files, and cannot find the class InjectedTagProvider. The only reference I can find to this class is in the class CucumberTagProviderStrategy. Google searches on InjectedTagProvider results in only one match - a link to CucumberTagProviderStrategy.java.

Where can I find a dependency that actually has this class, or do we need different dependencies?
Any help you can provide would be appreciated.
Thanks!

FreeMarker error after integrating serenity with jira

Hi,

I'm getting following error on integrating serenity with jira.

SEVERE: Error executing FreeMarker template
FreeMarker template error:
An error has occurred when reading existing sub-variable "grandparentRequirement"; see cause exception! The type of the containing value was: extended_hash+string (net.thucydides.core.requirements.reports.RequirementsOutcomes wrapped into f.e.b.StringModel)


FTL stack trace ("~" means nesting-related):
- Failed at: #if (requirements.grandparentRequirem... [in template "freemarker/requirements.ftl" at line 172, column 17]

Java stack trace (for programmers):

freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]
at freemarker.ext.beans.BeanModel.get(BeanModel.java:199)
at freemarker.core.Dot._eval(Dot.java:40)
at freemarker.core.Expression.eval(Expression.java:78)
at freemarker.core.Dot._eval(Dot.java:38)
at freemarker.core.Expression.eval(Expression.java:78)
at freemarker.core.MethodCall._eval(MethodCall.java:55)
at freemarker.core.Expression.eval(Expression.java:78)
at freemarker.core.Expression.evalToBoolean(Expression.java:124)
at freemarker.core.Expression.evalToBoolean(Expression.java:110)
at freemarker.core.ParentheticalExpression.evalToBoolean(ParentheticalExpression.java:31)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:46)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.Environment.process(Environment.java:302)
at net.thucydides.core.reports.templates.FreemarkerReportTemplate.merge(FreemarkerReportTemplate.java:42)
at net.thucydides.core.reports.html.Merger$MergeBuilder.to(Merger.java:37)
at net.thucydides.core.reports.html.BaseReportingTask.generateReportPage(BaseReportingTask.java:46)
at net.thucydides.core.reports.html.RequirementsOverviewReportingTask.generateReports(RequirementsOverviewReportingTask.java:92)
at net.thucydides.core.reports.html.ReportExecutor.call(ReportExecutor.java:32)
at net.thucydides.core.reports.html.ReportExecutor.call(ReportExecutor.java:11)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1458)
at freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:255)
at freemarker.ext.beans.BeanModel.get(BeanModel.java:159)
... 28 more
Caused by: java.lang.AbstractMethodError: net.serenitybdd.plugins.jira.requirements.JIRARequirementsProvider.getParentRequirementOf(Lnet/thucydides/core/requirements/model/Requirement;)Lcom/google/common/base/Optional;
at net.thucydides.core.requirements.reports.RequirementsOutcomes.parentRequirementOf(RequirementsOutcomes.java:176)
at net.thucydides.core.requirements.reports.RequirementsOutcomes.getGrandparentRequirement(RequirementsOutcomes.java:171)
... 35 more

@manual annotation does not work for scenario outlines

Hi im using serenity-core 1.1.31 and tagging a scenario outline with @Manual does not work properly

It works only for the first example then the following ones actually run all the remaining examples even though it's been tagged at the scenario outline level.

Proposal: Report on on exception/issues that occur in Hooks

It would be nice if the Serenity report showed any issues that occurred when running the Cucumber Hooks.

   @cucumber.api.java.Before
    public void beforeScenario(Scenario scenario) {
     }

    @cucumber.api.java.After
    public void afterScenario() {
    }
``

The same currentScenarioId is used into different features when Scenario Outline name is same

Hi John,

I've just encountered a null pointer exception when executing this java class:
@CucumberOptions(features="src/test/resources/samples/calculator/")
public class BasicArithemticScenario {}

As a result, three features would be executed: samples/calculator:
(1) basic_arithmetic.feature
(2) basic_arithmetic_with_tables.feature
(3) basic_arithmetic_with_tables_and_background.feature

and (2) and (3) features has the same scenario outline name: Many additions

So, the (3) feature would be resulted with an error/ exception:
java.lang.NullPointerException
at net.serenitybdd.cucumber.SerenityReporter.addTableRowsTo(SerenityReporter.java:354)
at net.serenitybdd.cucumber.SerenityReporter.examples(SerenityReporter.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

So, we need to reset the currentScenarioId for every new Scenario Outline which is going to be executed.

My fix:

@Override
    public void scenarioOutline(ScenarioOutline scenarioOutline) {
        addingScenarioOutlineSteps = true;
       currentScenarioId = "";
    }

On next re-run of BasicArithemticScenario.java (as above), the features would be run successfully.

Spring integration not working

Please provide minimal demo showcasing how to get serenity-cucumber + Spring to work together (preferably Spring Boot too).

The documentation suggests it's working out of the box for JBehave and Cucumber out of the box but I couldn't get it to work.

unable to clear cookies and/or clean session with safari

Hello,

this is my first time here. In my setup, I am running my tests for CucumberWithSerenity.class
The issue is after execution of my tests with safari browser, safari does not clear the cookies and other related data. e.g. After login steps are completed, i have to search for a user and set the user so i get relevant sections. But safari retains the set user information from previous test execution. To address this issue, i have set the following in serenity.properties file : safari.options.useCleanSession=true
however, this does not seem to work.

On other browsers, i do not have such an issue. Is there a fix for this or am i implementing the property incorrectly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.