Missing steps during mvn test

30 views
Skip to first unread message

fmap...@gmail.com

unread,
May 9, 2018, 8:53:48 AM5/9/18
to Cukes
Hi,

This is my Cucumber runner (in src/test/java) :

@RunWith(ExtendedCucumber.class)


@ExtendedCucumberOptions(jsonReport = "target/cucumber.json", retryCount = 3, detailedReport = true,
detailedAggregatedReport
= true, overviewReport = true, jsonUsageReport = "target/cucumber-usage.json",
usageReport
= true, toPDF = true, outputFolder = "target")


@CucumberOptions(plugin = { "html:target/cucumber-html-report", "json:target/cucumber.json", "pretty:target/cucumber-pretty.txt",
   
"usage:target/cucumber-usage.json", "junit:target/cucumber-results.xml" }, features = { "src/test/resources" }, glue = { "src/test/java" })

public class CucumberTest {}


Multiple "feature" files in src/test/resources directory.

Multiple "step definitions" files in src/test/java directory.


During the execution of the "mvn test" command, I obtain this error message : "You can implement missing steps with the snippets below...." => All steps defined in my files are missing !


My main dependencies :


<dependency>
 
<groupId>org.springframework.boot</groupId>
 
<artifactId>spring-boot-starter-web</artifactId>
 
</dependency>


 
<dependency>
 
<groupId>org.springframework.boot</groupId>
 
<artifactId>spring-boot-starter-data-jpa</artifactId>
 
</dependency>


 
<dependency>
 
<groupId>org.springframework.boot</groupId>
 
<artifactId>spring-boot-starter-test</artifactId>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>info.cukes</groupId>
 
<artifactId>cucumber-java8</artifactId>
 
<version>${cucumber.version}</version>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>org.assertj</groupId>
 
<artifactId>assertj-core</artifactId>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>info.cukes</groupId>
 
<artifactId>cucumber-junit</artifactId>
 
<version>${cucumber.version}</version>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>info.cukes</groupId>
 
<artifactId>cucumber-spring</artifactId>
 
<version>${cucumber.version}</version>
 
<scope>test</scope>
 
</dependency>


 
<dependency>
 
<groupId>com.github.mkolisnyk</groupId>
 
<artifactId>cucumber-runner</artifactId>
 
<version>1.3.3</version>
 
</dependency>

...
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-surefire-plugin</artifactId>
 
<version>2.20</version>
 
<dependencies>
 
<dependency>
 
<groupId>org.apache.maven.surefire</groupId>
 
<artifactId>surefire-junit47</artifactId>
 
<version>2.20</version>
 
</dependency>
 
</dependencies>
 
</plugin>





Any ideas ?

Thank you in advance

FMA

aslak hellesoy

unread,
May 9, 2018, 8:55:46 AM5/9/18
to Cucumber Users
Step definitions have to be in the same package (or sub package) as the feature files.


--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fmap...@gmail.com

unread,
May 9, 2018, 9:35:15 AM5/9/18
to Cukes
Thank for your response but it's always the same problem !

Step definitions and feature files are in the same package.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.

George Dinwiddie

unread,
May 9, 2018, 10:02:44 AM5/9/18
to cu...@googlegroups.com
FMA,

On 5/9/18 9:35 AM, fmap...@gmail.com wrote:
> Thank for your response but it's always the same problem !
>
> Step definitions and feature files are in the same package.
>
> Le mercredi 9 mai 2018 14:55:46 UTC+2, Aslak Hellesøy a écrit :
>
> Step definitions have to be in the same package (or sub package) as
> the feature files.
>
> On Wed, May 9, 2018 at 1:26 PM, <fmap...@gmail.com <javascript:>> wrote:
>
> Hi,
>
> This is my Cucumber runner (in src/test/java) :
>
> |
> @RunWith(ExtendedCucumber.class)
>
>
> @ExtendedCucumberOptions(jsonReport
> ="target/cucumber.json",retryCount =3,detailedReport =true,
> detailedAggregatedReport =true,overviewReport
> =true,jsonUsageReport ="target/cucumber-usage.json",
> usageReport =true,toPDF =true,outputFolder ="target")
>
>
> @CucumberOptions(plugin
> ={"html:target/cucumber-html-report","json:target/cucumber.json","pretty:target/cucumber-pretty.txt",
> "usage:target/cucumber-usage.json","junit:target/cucumber-results.xml"},features
> ={"src/test/resources"},glue ={"src/test/java"})
>
> publicclassCucumberTest{}
>
> |
>
> Multiple "feature" files in src/test/resources directory.
>
> Multiple "step definitions" files in src/test/java directory.

Are your features and step definitions in the root package, or do you
have subdirectories under src/test/resources and src/test/java?

>
>
> *During the execution of the "/mvn test/" command, I obtain this
> error message : "Y/ou can implement missing steps with the
> snippets below..../" => *All steps defined in my files are missing !
>

- George

--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

fmap...@gmail.com

unread,
May 11, 2018, 1:41:41 AM5/11/18
to Cukes
Hi,

"Are your features and step definitions in the root package, or do you 
have subdirectories under src/test/resources and src/test/java? "

My features and step definitions are in a package like com.xxx.yyy.zzz under src/test/java.

George Dinwiddie

unread,
May 11, 2018, 10:06:22 AM5/11/18
to cu...@googlegroups.com
On 5/11/18 1:41 AM, fmap...@gmail.com wrote:
> Hi,
>
> "Are your features and step definitions in the root package, or do you
> have subdirectories under src/test/resources and src/test/java? "
>
> My features and step definitions are in a package like com.xxx.yyy.zzz
> under src/test/java.

So your features are in the src/test/resources/com/xxx/yyy/zzz directory?

- George

>
>
> Le mercredi 9 mai 2018 16:02:44 UTC+2, George Dinwiddie a écrit :
>
> FMA,
>
> --
> Posting rules: http://cukes.info/posting-rules.html
> ---
> You received this message because you are subscribed to the Google
> Groups "Cukes" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cukes+un...@googlegroups.com
> <mailto:cukes+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Björn Rasmusson

unread,
May 12, 2018, 3:04:54 PM5/12/18
to Cukes
The simplest (and best?) way when using a runner class with a @CucumberOptions annotation is not to specify the "feature" and "glue" parameters, but to rely on the defaults.
That is place the runner class, the feature files, and the glue classes all in the same package.

That is if the runner class has the following package declaration:
package xxx.yyy.zzz;
(and is placed in the directory src/test/java/xxx/yyy/zzz/),
then place the feature files in the directory src/test/resources/xxx/yyy/zzz/ (or sub directories)
and place the glue code file in the directory src/test/java/xxx/yyy/zzz/ (that is also in the package xxx.yyy.zzz), or sub packages
and as I said, do not specify the "feature" and "glue" parameters in @CucumberOptions annotation.

/Björn
Reply all
Reply to author
Forward
0 new messages