Multiple Scenario Outlines are not getting executed in Cucumber 5.x.x: A possible bug?

518 views
Skip to first unread message

Subramanian Raghavan

unread,
Apr 17, 2020, 2:10:44 PM4/17/20
to Cukes
In my feature file, I have two Scenario Outlines, with their own Examples section. I have tagged each of these Scenario Outlines differently(@test1, @test2). 
When I try to run both Scenario Outlines with Cucumber 5.6.0, I get the following error:-
0 Scenarios
0 Steps
0m0.001s
Only one Scenario Outline at a time is getting executed successfully with Cucumber 5.6.0.
I got the same result with Cucumber 5.0.0

However, both scenario outlines are getting executed successfully when I downgrade to Cucumber 4.8.1.
Scenario Outlines also do not work when I run them with Cucumber 4.8.1 and JUnit Test Runner v 4.13

Please take a look below at the Feature file and JUnit Test Runner class that I am using

Feature File under test:-
@GoogleMapPageObjectFactory
Feature: GoogleMapPageObjectFactory
  
 Background: setUpGoogleMapPageObjectFactoryTest
  Given ChromeDriver is available for GoogleMap Page
  And GoogleMap Page is opened
  And all GoogleMap page elements are initialised 

  @test1
  Scenario Outline: captureScreenShotatStartGoogleMap
    When I capture screenshot on GoogleMap page to be stored at "<screenshotFilePathStart>"
  Then an image should be stored in local drive path "<screenshotFilePathStart>"

Examples:
| screenshotFilePathStart |
| F:\\Users\\User\\eclipse-workspace\\maven-demo\\screenshots\\GoogleMapPageObjectFactoryTest-start.jpg |
 
  @test2
  Scenario Outline: typeAndVerifyAddressGoogleMap
  When I type the "<searchAddress>" on GoogleMap Page
  Then I verify the section header contains "<searchAddress>" on GoogleMap Page
 
  Examples:
| searchAddress |
| Harvard Business School, Boston, MA 02163, United States |
  
  @test3
  Scenario: phnuminlinePopUpGoogleMap
  When I type the "phoneNumber" on GoogleMap Page
  Then I verify the inline popup window contains "phoneNumber" on GoogleMap Page

JUnit Test Runner Class:-
package com.selenium.cucumber.junit.testrunner;

import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class) 
@CucumberOptions(tags={"@test1","@test2"},
features= {"src/main/resources/com/selenium/cucumber/features/GoogleMapPageObjectFactory.feature"},
glue= {"com.selenium.cucumber.stepdef"}
public class GoogleMapPageObjectFactoryTestRunner {

}

George Dinwiddie

unread,
Apr 18, 2020, 12:31:16 PM4/18/20
to cu...@googlegroups.com
Subramanian,

Instead of
@CucumberOptions(tags={"@test1","@test2"},
try
@CucumberOptions(tags={"@test1 or @test2"},

See https://cucumber.netlify.app/docs/cucumber/api/#tags

- George

On 4/17/20 1:29 PM, Subramanian Raghavan wrote:
> In my feature file, I have two Scenario Outlines, with their own
> Examples section. I have tagged each of these Scenario Outlines
> differently(@test1, @test2).
> When I try to run both Scenario Outlines with Cucumber 5.6.0, I get the
> following error:-
> 0 Scenarios
> 0 Steps
> 0m0.001s
> Only one Scenario Outline at a time is getting executed successfully
> with Cucumber 5.6.0.
> I got the same result with Cucumber 5.0.0
>
> However, both scenario outlines are getting executed successfully when I
> downgrade to Cucumber 4.8.1.
> Scenario Outlines also do not work when I run them with Cucumber 4.8.1
> and JUnit Test Runner v 4.13
>
> Please take a look below at the Feature file and JUnit Test Runner class
> that I am using
>
> *_Feature File under test:-_*
> *JUnit Test Runner Class:-*
> package com.selenium.cucumber.junit.testrunner;
>
> import org.junit.runner.RunWith;
> import io.cucumber.junit.Cucumber;
> import io.cucumber.junit.CucumberOptions;
>
> @RunWith(Cucumber.class)
> @CucumberOptions(tags={"@test1","@test2"},
> features=
> {"src/main/resources/com/selenium/cucumber/features/GoogleMapPageObjectFactory.feature"},
> glue= {"com.selenium.cucumber.stepdef"}
> )
> public class GoogleMapPageObjectFactoryTestRunner {
>
> }
>
> --
> Posting rules: https://cucumber.io/support/posting-rules
> ---
> 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>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cukes/249b719a-d105-405d-a225-c4291daf7b6a%40googlegroups.com
> <https://groups.google.com/d/msgid/cukes/249b719a-d105-405d-a225-c4291daf7b6a%40googlegroups.com?utm_medium=email&utm_source=footer>.

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

Subramanian Raghavan

unread,
Apr 19, 2020, 6:04:22 AM4/19/20
to Cukes
Yes. I did try with "@test1 or @test2". The observed results were same which I reported

Shameem Akhtar

unread,
Apr 19, 2020, 10:50:27 AM4/19/20
to Cukes

Hi Subramanian,

Please use tags just as below:

@CucumberOptions(tags={"@test1,@test2"}

Instead of:

@CucumberOptions(tags={"@test1","@test2"}


Best Regards,
-Shameem
Reply all
Reply to author
Forward
0 new messages