Using tagExpression makes the Feature or Scenario to run twice
Issue description
I am using wdio v6.1.12, node v12.13.1, cucumber-js v6.1.13, appium v17.1.0. I have tried to use tags on Feature or Scenario level, and in both tries, the feature or scenario is executed twice.
Steps to reproduce
npx wdio wdio.conf.js --cucumberOpts.tagExpression=@smoke
Expected behavior
Only to run 1 time
Actual behavior
The feature file or scenario is executed twice.
FYI By running the scenarios without tags or using --spec or --suite the tests are executed one time.
Hey, thanks for filing the issue. This seems indeed like bug. We would appreciate any help on this so please help us out! Have a look at our contributing guidelines and reach out if you have any questions. Cheers!
@gromanas can you provide a minimal reproducible example for people interested to pick up this bug to get started?
@christian-bromann Of course and I will come back with the exact steps to reproduce
Steps to reproduce:
1st scenario:
On top of a Feature file, you can add a custom tag such as @smoke
e.g.
@smoke
Feature: Login Show/Hide Functionality
As a Player I should be able to check Login Button and Show Hide functionality
Scenario: Player is able to add credentials and verify that the Login button is disabled or enabled according to his actions
Given The app is loaded
When I click login header button
And I enter "[email protected]" into the email input field
Then I verify that the status of Login button is "disabled"
When I enter "1234" into the password input field
Then I verify that the status of Login button is "enabled"
When I enter "" into the password input field
Then I verify that the status of Login button is "disabled"
When I enter "1234" into the password input field
When I enter "" into the email input field
Then I verify that the status of Login button is "disabled"
When I enter "[email protected]" into the email input field
And I enter "1234" into the password input field
Then I verify that the status of Login button is "enabled"
When I click close modal button
2nd scenario:
On top of a Scenario, you can add a custom tag such as @smoke
e.g.
Feature: Login Show/Hide Functionality
As a Player, I should be able to check Login Button and Show Hide functionality
@smoke
Scenario: Player is able to add credentials and verify that the Login button is disabled or enabled according to his actions
Given The app is loaded
When I click login header button
And I enter "[email protected]" into the email input field
Then I verify that the status of Login button is "disabled"
When I enter "1234" into the password input field
Then I verify that the status of Login button is "enabled"
When I enter "" into the password input field
Then I verify that the status of Login button is "disabled"
When I enter "1234" into the password input field
When I enter "" into the email input field
Then I verify that the status of Login button is "disabled"
When I enter "[email protected]" into the email input field
And I enter "1234" into the password input field
Then I verify that the status of Login button is "enabled"
When I click close modal button
In order to run the test in both scenarios you have to execute the command below
node_modules/.bin/wdio test/conf/wdio.conf.js --cucumberOpts.tagExpression=@smoke
Hi, @christian-bromann are there any updates on this one? Facing the same issue when I try to run some scenario or feature using tags.
@hiChandravanshi as you can see, no updates. I am not actively working on this issue so please get involved and help use find a solution.
@christian-bromann @gromanas For me it is working fine now. I removed the extra path pattern from the specs and it started working for me. The new code looks like specs: ["./features/*.feature"],

I do have same issue when i array the specs.
specs: [
['./test/specs/features/login/*.feature',
'./test/specs/features/landing/*.feature',
'./test/specs/features/account/*.feature',
]
]
This runs each feature file twice.
@MahadevMG Can you try this? It may resolve the issue for you
specs: ["./test/specs/features/**/*.feature"]