cucumber.options tags are ignored when running tests from Gradle
See original GitHub issueSummary
The problem is fully described in this stackoverflow question: https://stackoverflow.com/questions/49919757/cucumber-2-4-0-tags-not-working-with-gradle-4-6
Feature:
Feature: Restaurant
@dev
Scenario: Eat cukes
Given I have 10 cukes in my belly
Then I eat 1 more cukes
@pro
Scenario: Eat mushrooms
Given I have 10 mushrooms in my belly
Then I eat 1 more mushrooms
Expected Behavior
./gradlew -Dcucumber.options="--tags @dev" clean test
Should only run tests with @dev tag
Current Behavior
./gradlew -Dcucumber.options="--tags @dev" clean test
Runs all tests, no matter what tag they have.
Steps to Reproduce (for bugs)
Context & Motivation
Our projects use Gradle as build tool, we can’t change to Maven in which the cucumber.options tags do work.
Your Environment
cucumber 2.4.0 Junit jupiter 5.1.1 JUnit Platform 1.1.1 Gradle 4.6/4.7 Java 1.8
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Cucumber Test execution for gradle project via command line ...
I am looking for a solution where we can run specific tags irrespective of what tag is mentioned in Runtest.java. More precisely pass...
Read more >Using Cucumber with Gradle with tags - Handverdrahtet
I want to run Cucumber from Gradle with the possibility to specify tags. ... 'not @Ignore' : findProperty('tags') + ' and not @Ignore'....
Read more >Run Gradle Cucumber Tests from Command Line
This will help us to run multiple tags in cucumber. (Cucumber6 and above uses, cucumber.filter.tags , so for the lower version use cucumber....
Read more >Cucumber Tags - Tools QA
How to run Cucumber Tests in Groups with Cucumber Tags; How to ignore Cucumber Tests; Logically ANDing and ORing Tags. What are Cucumber...
Read more >Using Cucumber with Gradle - Baeldung
Cucumber is a test automation tool that supports Behavior-Driven ... For example, there are options to filter tests based on names and tags....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem was related to the fact that Gradle forks the test execution into different JVMs, so the initial -D parameters don’t reach the tests.
I would suggest improve the Gradle documentation with the necessary configuration to bridge the JVM parameters:
build.gradle:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.