kiwigrid / gherkin-testcafe

Run testcafe tests with gherkin syntax
MIT License
69 stars 2 forks source link

Tags not working #60

Closed Kerhael closed 4 years ago

Kerhael commented 4 years ago

Hello,

We are currently setting testcafe on our app.

We are using the following versions:

Here is .testcaferc.json

{
    "browsers": "chrome",
    "debugMode": false,
    "debugOnFail": false,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "concurrency": 1,
    "assertionTimeout": 30000,
    "selectorTimeout": 30000,
    "pageLoadTimeout": 30000,
    "speed": 1,
    "color": true
}

Here is our feature:

Feature: feature1
@test1
  Scenario: test1
    Given Step1
    And Step2
    Then Step3
    And Step4

@test2
  Scenario: test1
    Given Step1
    And Step2
    Then Step3
    And Step4

When launching npm run gherkin-testcafe resources features/**/*.feature --tags ~@test1, both test1 and test2 are launched.

Would you have any idea on what we are missing here?

Thanks a lot

Kerhael commented 4 years ago

When debugging directly in gherkin-testcafe, we can see that --tags is not present within process.argv:

args [
  '/home/.../bin/node',
  '/.../testcafe/node_modules/.bin/gherkin-testcafe',
  'resources',
  'features/**/*.feature',
  '@test1'
]

Then tagsIndex is -1

Still investigating...

Kerhael commented 4 years ago

OK, not a testcafe issue. We need to add -- before sending arguments to npm run script. Here is the correct command: npm run gherkin-testcafe resources features/**/*.feature -- --tags ~@test1