GithubHelp home page GithubHelp logo

trivago / cucable-plugin Goto Github PK

View Code? Open in Web Editor NEW
115.0 24.0 47.0 1.46 MB

Maven plugin that simplifies running Cucumber scenarios in parallel.

License: Apache License 2.0

Java 97.75% Gherkin 2.02% Makefile 0.23%
maven-plugin test-automation cucumber-jvm parallelization maven-failsafe test-runner gherkin-parser cucumber-scenarios

cucable-plugin's People

Contributors

bischoffdev avatar daczczcz1 avatar josepj avatar mre 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  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

cucable-plugin's Issues

Google Guice @Inject issue in 0.0.6

With the latest 0.0.6 version a simple 'mvn clean verify' fails with the following error:

  1. Could not find a suitable constructor in com.trivago.rta.CucablePlugin. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
    at com.trivago.rta.CucablePlugin.class(Unknown Source)
    while locating com.trivago.rta.CucablePlugin
    at ClassRealm[plugin>com.trivago.rta:cucable-plugin:0.0.6, parent: sun.misc.Launcher$AppClassLoader@55f96302]
    while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=com.trivago.rta:cucable-plugin:0.0.6:parallel)
    1 error
    at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
    at com.google.inject.Scopes$1$1.get(Scopes.java:59)
    at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
    at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
    ... 23 more

This does not happen in 0.0.5

I have created a new project with an empty test runner to rule out injection library conflicts and I get the same problem.

Here is my pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mygroupid</groupId>
    <artifactId>myartifact</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.failsafe.plugin.version>2.20</maven.failsafe.plugin.version>
    </properties>

    <dependencies>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.trivago.rta</groupId>
                <artifactId>cucable-plugin</artifactId>
                <version>0.0.6</version>
                <executions>
                    <execution>
                        <id>generate-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>parallel</goal>
                        </goals>
                        <configuration>
                            <sourceRunnerTemplateFile>src/test/resources/parallel/cucable.template</sourceRunnerTemplateFile>
                            <sourceFeatures>src/test/resources/features</sourceFeatures>
                            <generatedFeatureDirectory>src/test/resources/parallel/features</generatedFeatureDirectory>
                            <generatedRunnerDirectory>src/test/java/parallel</generatedRunnerDirectory>
                            <numberOfTestRuns>1</numberOfTestRuns>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>**/RunCukes.*</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Java version:

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Maven version:

Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)

Data tables not being supported

Could you please add support for data tables. Currently the plugin deals with example tables but if a scenario has got a data table the plugin copies the scenario but omits the table.

Exception when building in travis

Hi Lax,

I am facing issue while building my project in travis.
It's throwing below exception in travis....

[ERROR] Failed to execute goal com.trivago.rta:cucable-plugin:1.1.0:parallel (generate-test-resources) on project restassured-cucumber-java: src\test\resources\features\ is not a feature file or a directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The same is running fine in Local and jenkins....but not in travis...not sure if its a plugin issue or travis issue
But any help will be appreciated

Cucable desiredNumberOfRunners with value 2 is not running two runners in parallel(one runner has chrome features and second runner has ie features) both are executing in sequence not in parallel thread

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a scenario with...
  2. Run Cucable
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Attachments
If applicable, add an attachment to help explain your problem.

Additional context
Add any other context about the problem here.

Enhancement Request - Capability to add glue path in the template from pom

I must say this is a cool plug in and thanks for the great work.
I have a situation where I want to add the glue path from pom. Let me tell why?

Here is my package structure:
com.feature

  • login
    • loginstep.java
  • logout
    • logout.java

I want to provide the glue path
glue = "com.feature.login" or "com.feature.logout"

I can't give both because the before in each step definition runs for all the files.

Can you add a capability to pass the glue path from pom to the template?

Thanks !

Error: """ Not Working

Expected behavior

Parallel Test Running

Actual behavior

Run using Intellij, not runing using "mvn clean verify -Pparallel"

cucumber.runtime.CucumberException: Arity mismatch: Step Definition 'void com.turitop.api.Steps.pass_body_login(String) in file:/home/turitop/IdeaProjects/ApiTest/target/test-classes/' with pattern [^pass body login$] is declared with 1 parameters. However, the gherkin step has 0 arguments []. Step: And pass body login 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:300) 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 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.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

Reproduction steps

#Feature
And pass body login
"""
{
"user": "[email protected]",
"data" : {
"password": "123456"
}
}
"""
#Step

@Test
    @And("^pass body login$")
    fun pass_body_login(body :String) {
        request = request?.body(body)
        println("\n$body")

    }

Additional details (Maven version, Java version, etc.)

Java: 1.8
Maven: 3.3.9
restassured

For Rest Api tests

Cucable plugin work with tests in Rest Api? I have not yet had the opportunity to test just an API, just in frontend

When a directory begins with "u", the runners fail to execute

The runner classes generated feature comments at the bottom that specify the location from which they are derived. If a directory begins with "u", because the file separator is using a backslash character to separate files, it throws a parsing error when trying to run feature files as it interprets this as a unicode character (even though it is commented out).

Filter generation of feature runners with cucumber tags

First of all, it's a really cool plugin, thank you very much :)
Would it be possible to filter the generation of runners with cucumber tags configurable in the pom.xml?
The same feature already exists in cucumber-slices-maven-plugin and my use case is the @ignore tag. At the moment for all scenarios labeled with @ignore a runner will generated anyway which leads to unnecessary overhead and furthermore to errors in your reporting plugin cluecumber (nullpointerexception due to an empty json output file)

Feature and Scenario Description in generation of features files

Expected behavior

Given I have a description for Feature or Scenario in my .feature file
When new feature files are generated in parallel.features folder
Then I will see the Feature description
And I will see the Scenario description

Actual behavior

when new feature files are generated in parallel.features folder, the process doesn't import descriptions bellow Feature and Scenario tags

Reproduction steps

If I have a file.feature like bellow

Feature: this is my feature titlr
This is my description from feature

Scenario: This is my scenario title
This is my description from Scenario
Given aaaaaaa
When bbbbbbb
Then cccccccc

when the title_scenario001_run001_IT.feature is generated
the content is:

Feature: this is my feature title

Scenario: This is my scenario title

Given aaaaaaa
When bbbbbbb
Then cccccccc

And cucumber report .json will be generated with an empty description ("description":"")

Additional details (Maven version, Java version, etc.)

Cucacle:
com.trivago.rta
cucable-plugin
0.0.8

Apache Maven 3.3.9
Java version: 1.8.0_121, vendor: Oracle Corporation

generatedFeatureDirectory and generatedRunnerDirectory does not get deleted

Expected behavior

generatedFeatureDirectory and generatedRunnerDirectory should get deleted before every build

Actual behavior

If I add/remove scenarios from the feature file, no change to the generated features or runners

Reproduction steps

Additional details (Maven version, Java version, etc.)

java 8, maven 3.1.1

Plugin does not work with scenarios without steps

If I have a feature file containing a scenario without any steps then I get the following error:

Execution generate-test-resources of goal com.trivago.rta:cucable-plugin:0.0.6:parallel failed: Index: 0, Size: 0

In our test flow - we start off with defining Scenario titles which are separately reviewed and filled out at a later stage. As a result it's common for us to have many Scenarios in this state.

I'd expect the empty scenario to be taken into it's own feature file as-is just as one with steps is.

Failed to execute goal com.trivago.rta:cucable-plugin:1.1.0:parallel

throws below error while maven clean verify
[ERROR] Failed to execute goal com.trivago.rta:cucable-plugin:1.1.0:parallel (generate-test-resources) on project cucable-test-project: Could not parse feature file 'src\test\resources\features\testfeature\MyTest8.feature'. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Only one Scenario Outlines displayed in Report

Hi @laxersaz ,

Scenario Outline in 1.3 works as expected. Thank you.
Now there is a problem with displaying scenarios in report. Looks like only last one is displayed since each of them has the same name so they are being overwritten.

NPE handling - incorrect Scenario Outline placeholder

When parsing a Scenario Outline with a placeholder is not present in the examples table, there is a NPE.

Scenario Outline: <badplaceholder>
    When #some steps

Examples:
|placeholder1|placeholder2|
|...         |            |

This results in a NPE during parsing of features.

[ERROR] Failed to execute goal com.trivago.rta:cucable-plugin:0.1.9:parallel (generate-test-resources) on project *******: Execution generate-test-resources of goal com.trivago.rta:cucable-plugin:0.1.9:parallel failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.trivago.rta:cucable-plugin:0.1.9:parallel (generate-test-resources) on project *******: Execution generate-test-resources of goal com.trivago.rta:cucable-plugin:0.1.9:parallel failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-test-resources of goal com.trivago.rta:cucable-plugin:0.1.9:parallel failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.NullPointerException
at com.trivago.rta.gherkin.GherkinDocumentParser.substituteScenarioNameExamplePlaceholders(GherkinDocumentParser.java:400)
at com.trivago.rta.gherkin.GherkinDocumentParser.getSingleScenariosFromOutline(GherkinDocumentParser.java:212)
at com.trivago.rta.gherkin.GherkinDocumentParser.getSingleScenariosFromFeature(GherkinDocumentParser.java:135)
at com.trivago.rta.features.FeatureFileConverter.convertToSingleScenariosAndRunners(FeatureFileConverter.java:127)
at com.trivago.rta.features.FeatureFileConverter.convertToSingleScenariosAndRunners(FeatureFileConverter.java:93)
at com.trivago.rta.CucablePlugin.execute(CucablePlugin.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more

Ideally, the user would like to see some message pointing to the file and scenario causing the problem.

Version for maven enforce plugin for build status

Expected behavior

Please provide the working example for build status update

Actual behavior

Using below plugin
"

org.apache.maven.plugins
maven-enforcer-plugin


com.trivago.rta
your-custom-maven-fail-rule
${cluecumber.version}




post-integration-test

enforce





true



            </plugins>

"

Global before execution

Enhancement

Hello,

I was wondering if it would be possible to add an option to make a global before step. I'd like to download something before my test execution. At this moment it has to download it separately for each run. This could maybe be done by adding an option to the profile of a java file that would be executed before the parallel runs get started.

Thanks in advance,
Rob

Forking creating issues with users

Hello,

We are having issues when running multiple scenarios in parallel with a set of users. We use a csv file to store and pick users and this is not being shared as each test is being forked and isolated.

So multiple users are having to use up the same users at same time and creating issues.

Any help appreciated!

Data tables with empty values are not processed correctly

Scenarios with data tables are not processed correctly if a cell in the table has a blank value

If I have this table:

|header1|header2|header3|
|value1 | |value3 |

Then the plugin processes this as:

|header1|header2|header3|
|value1 |
|value3 |

getting PicoCompositionException with multiple @Before/@After methods

Summary

When using Before / After annotated methods in two or more stepdef classes getting

Error: Either the specified parameters do not match any of the following constructors: [private classNameStepdefs]; OR the constructors were no
t accessible for 'classNameStepdefs'

I experienced it with cucumber-parallel-jvm-plugin as well and opened an issue with cucumber-jvm, altough also posting it here as I really need a solution and might be it is coming from parallelization that both plugins are doing.

Expected Behavior

I have several sptepdef classes for each of the features. Each feature has a tag:
@featureOne
@featureTwo

In each stepdef class I have setup methods to run before Scenario execution as Before / After and they have tag names ingested:
@Before("@featureOne") / @Before("@featureTwo")

I expect each setup method to be executed for the scenarios with provided tag however it seems that picocontainer is confused about to which annotated method to use and throws an exception.

Current Behavior

Getting following exception:

org.picocontainer.PicoCompositionException: Either the specified parameters do not match any of the following constructors: [private com.accenture.ava.rt_testrobot.stepdefs.HiveStepde
fs()]; OR the constructors were not accessible for 'HiveStepdefs'
        at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:200)
        at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:110)
        at org.picocontainer.injectors.ConstructorInjector.access$100(ConstructorInjector.java:51)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:331)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
        at cucumber.runtime.java.picocontainer.PicoFactory.getInstance(PicoFactory.java:40)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        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 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.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 org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
        at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
        at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
        at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
        at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
        at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:157)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

Context & Motivation

I have different features and each has different setup to be executed before actual scenario execution and teardown after scenario execution.

Your Environment

  • Version used: 1.2.5
  • Operating System and version: Win 10
  • Link to your project: NA

Need sample project to showcase comparison between cucumber-jvm-parallel-plugin vs this plugin

Hi Benjamin,

It will be useful if you can please share very simple project which showcase comparison between cucumber-jvm-parallel-plugin vs this plugin

The sample project can have couple of feature files which just opens browser and goto google/facebook/yahoo.com

I had posted query http://tech.trivago.com/2017/06/30/cucable-maven-plugin-for-parallel-execution-of-cucumber-scenarios/#comment-3473516679

Thanks in advance.

Cross browser testing

Hi Lax,

Your plugin is fantastic in terms of parallel testing. I have tested that in my project. Now, I am trying cross-browser testing in my project using your plugin. Can you please send some template pom.xml for cross-browser testing if your plugin supports that?

Thanks
Sumanpreet Singh

Rerun.txt generated from failsafe plugin are generated empty(on a failing scenario).

Describe the bug
Rerun.txt files are generated empty.

My CucumberTemplate includes reference like "rerun:target/RerunFiles/[CUCABLE: RUNNER]_rerun.txt"

To Reproduce
Steps to reproduce the behavior:

  1. My CucumberTemplate includes reference like "rerun:target/RerunFiles/[CUCABLE:RUNNER].txt"
  2. Generated Runner Class are correctly mentioning the XXX_rerun.txt files
  3. on executing integration test with a failsafe plugin, failing scenario correctly generates the XXX_rerun.txt files.
  4. entry for the feature file path and line number is missing from XXX_rerun.txt

If I manually run the generated runner file outside the plugin, the XXX_rerun.txt contains the expected content.

Expected behavior
whilst the generated runner file are executed via the failsafe plugin, it is expected that on failing scenario rerun.txt should be generated with faulty feature path and line number(if configured)

Attachments
If applicable, add an attachment to help explain your problem.

Additional context
If I manually run the generated runner file outside the plugin, the XXX_rerun.txt contains the expected content.
any suggestion will help. thanks

Ability to provide Tags via command line

When test are executed from command line (e.g. mvn verify -Pparallel ) Tags can't be provided on command line.

How can it be done?

Also in addition to tags if single feature can also be configurable via command line it would help execute large features parallel as well.

Skip features Generation

Hello, I'm working on parallel execution of ours acceptance tests in my current project. After some research, I found that cucable-plugin is the most easy and clear plugin to generate runners based on template from ours .features files. But the generation of features files for each scenario is a behaviour that I need to avoid. Basically, I need cucable to generate runners, based on my .java template, for each one of my .features files, but not generating others features files.

I would like a parameter on pom or VM args that allow me to generate just runners and avoid the features generation.

Comment:
I know there is others plugins that have this behavior, but they are not so easy and clear to configure as cucable. Also, I didn't found another plugin that use a .java template file to generate runners from.

Feature Request: Implement support for jUnit annotations

Hi. Plugin is very nice, but can't figure out if it's possible to use BeforeClass, AfterClass and other jUnit/TestNG annotions. Tried like this but not working:

package parallel.runners;

import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;

import java.sql.SQLException;

@RunWith(Cucumber.class)
@CucumberOptions(
    monochrome = false,
    features = {"classpath:parallel/features/[FEATURE_FILE_NAME].feature"},
    format = {"json:target/cucumber-report/[FEATURE_FILE_NAME].json"},
    strict = false,
    dryRun = false,
    glue = {"classpath:com/project"},
    tags = {"~@ignore"}
)

public class [FEATURE_FILE_NAME] {

    [FEATURE_FILE_NAME]() {        
    }

    @BeforeClass
    public static void initSomething() {
        System.out.println("Success")
    }

}

class runner gets generated with all implementation but can't see anything printed

Not able to generate runners

I am trying to use the cucable in my current project but the resources are not getting generated
could you help me with this . I have given the pom i am using


4.0.0
com
vPOL
1.0.0

<jre.level>1.8</jre.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.failsafe.plugin.version>2.20.1</maven.failsafe.plugin.version>
<junit.version>4.12</junit.version>


com.
addd
19.0

<dependencies>
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.12</version>
		<scope>compile</scope>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-core</artifactId>
		<version>1.2.4</version>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-testng</artifactId>
		<version>1.2.4</version>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-java</artifactId>
		<version>1.2.4</version>
	</dependency>

	<dependency>
		<groupId>info.cukes</groupId>
		<artifactId>cucumber-junit</artifactId>
		<version>1.2.4</version>
	</dependency>

	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi</artifactId>
		<version>3.14</version>
	</dependency>

	<dependency>
	<groupId>org.apache.poi</groupId>
	<artifactId>poi-ooxml</artifactId>
	<version>3.14</version>
</dependency>

	<dependency>
		<groupId>jexcelapi</groupId>
		<artifactId>jxl</artifactId>
		<version>2.4.2</version>
	</dependency>
	<dependency>
		<groupId>com.amex.autobot</groupId>
		<artifactId>autobot-cucumber</artifactId>
		<version>1.1.1</version>
	</dependency>

	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-java</artifactId>
		<version>2.47.1</version>
	</dependency>

	<dependency>
		<groupId>xml-apis</groupId>
		<artifactId>xml-apis</artifactId>
		<version>1.4.01</version>
	</dependency>

	<dependency>
		<groupId>net.masterthought</groupId>
		<artifactId>cucumber-reporting</artifactId>
		<version>0.6.0</version>
	</dependency>

</dependencies>
<profiles>
<!-- <profile>
		<id>BuildVerificationvPol</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.18.1</version>
					 <configuration>
						<suiteXmlFiles>
							<suiteXmlFile>src/test/java/com/amex/viper/TestNg/testngBuildVerification.xml</suiteXmlFile>
						</suiteXmlFiles>
					</configuration> 
				</plugin>
			</plugins>
		</build>
	</profile>-->
	<!-- Run Parallel with Cucable -->
 <profile>
    <id>parallel</id>
    <build>
        <plugins>
         <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.0.2</version>
    </plugin>
          	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
          		
            <plugin>
                <groupId>com.trivago.rta</groupId>
                <artifactId>cucable-plugin</artifactId>
                    <version>0.0.9</version>
                <executions>
                    <execution>
                        <id>generate-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>parallel</goal>
                        </goals>
                        <configuration>
                            <sourceRunnerTemplateFile>src/test/resources/Parallel/cucable.template</sourceRunnerTemplateFile>
                            <sourceFeatures>src/test/resources/ParallelFeature</sourceFeatures>
                            <generatedFeatureDirectory>src/test/resources/Parallel/newFeature</generatedFeatureDirectory>
                            <generatedRunnerDirectory>src/test/java/com.amex.viper.parallel</generatedRunnerDirectory>
                            <numberOfTestRuns>1</numberOfTestRuns>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
              <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/java/com.amex.viper.parallel</source>		                
              </sources>
            </configuration>
          </execution>
        </executions>
	</plugin>
    
           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin> 
       
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <id>Run parallel tests</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                    </execution>
                </executions>
                <configuration>
                    <forkCount>5</forkCount>
                    <testFailureIgnore>true</testFailureIgnore>
                    <reuseForks>false</reuseForks>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <disableXmlReport>true</disableXmlReport>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.masterthought</groupId>
                <artifactId>cucumber-reporting</artifactId>
                <version>3.12.0</version>
                <executions>
                    <execution>
                        <id>report</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/test/resources/report</outputDirectory>
                            <cucumberOutput>src/test/resources/report/cucumber-report</cucumberOutput>
                            <projectName>My Report</projectName>
                            <buildNumber>1</buildNumber>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            	
           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.trivago.rta</groupId>
                        <artifactId>your-custom-maven-fail-rule</artifactId>
                        <version>0.0.9</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <yourRule implementation="com.example.YourFailRule"/>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>  
        </plugins>
    </build>
</profile>
	
	
	
	
	</profiles> 
There is no error message but its not generating the resources

[INFO] --- build-helper-maven-plugin:3.0.0:add-test-source (add-test-source) @ vPOL ---
[INFO] Test Source directory: C:\Users\sjanakir\Desktop\Automation\Scenario\vng\integration_tests. added.
[INFO]
[INFO] --- cucable-plugin:0.0.9:parallel (generate-test-resources) @ vPOL ---
[INFO] =====================================
[INFO] Cucable Maven Plugin, version 0.0.9
[INFO] =====================================
[INFO] ? sourceRunnerTemplateFile : src/test/resources/Parallel/cucable.template
[INFO] ? generatedRunnerDirectory : src/test/java/com.amex.viper.parallel
[INFO] ? sourceFeatures : src/test/resources/ParallelFeature
[INFO] ? generatedFeatureDirectory: src/test/resources/Parallel/newFeature
[INFO] ? numberOfTestRuns : 1
[INFO]
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ vPOL ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 331 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5:testCompile (default-testCompile) @ vPOL ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ vPOL ---
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -------------------

Being able to set "include/exclude tags" in the command line

It would be really helpful to not only be able to specify the tags for including/excluding in the test run in the POM config, but would also be great to be able to set this at run through the command by passing some parameters. This would help with running specific tests/suites and excluding others on demand.

Just an improvement :)

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.