Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using tagExpression makes the Feature or Scenario to run twice #385

Open
gromanas opened this issue Jul 31, 2020 · 9 comments
Open

Using tagExpression makes the Feature or Scenario to run twice #385

gromanas opened this issue Jul 31, 2020 · 9 comments

Comments

@gromanas
Copy link

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.

@christian-bromann
Copy link
Member

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!

@christian-bromann
Copy link
Member

@gromanas can you provide a minimal reproducible example for people interested to pick up this bug to get started?

@gromanas
Copy link
Author

gromanas commented Jul 31, 2020

@christian-bromann Of course and I will come back with the exact steps to reproduce

@gromanas
Copy link
Author

gromanas commented Aug 3, 2020

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 "valid-user@test.com" 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 "valid-user@test.com" 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 "valid-user@test.com" 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 "valid-user@test.com" 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

@hiChandravanshi
Copy link

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.

@christian-bromann
Copy link
Member

@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.

@hiChandravanshi
Copy link

@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"],
image

@MahadevMG
Copy link

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.

@hiChandravanshi
Copy link

@MahadevMG Can you try this? It may resolve the issue for you

  specs: ["./test/specs/features/**/*.feature"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants