kiwigrid / gherkin-testcafe

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

Does gherkin-testcafe support Scenario Outline? #37

Closed ZeniStiks closed 5 years ago

ZeniStiks commented 5 years ago

Hi, I'm trying to write a simple test and I need to use Scanario Outline

Feature: feature 1

  Scenario Outline: scenario
    Given the user has <role> in app
    When action
    Then result

    Examples:
      | role  |
      | Admin |
      | User |

Given(/^the user has (.*) in app$/, async (t, role) => { console.log(role); }); After running this output I get is <role> and only one scenario is run when it should be two How do I access my example values? Tried examples in Support for data tables #14 but it's not working :/

Lukas-Kullmann commented 5 years ago

Hey @ZeniStiks,

this should be working. We use Scenario Outlines ourselves. It sould log twice. First, ['Admin'] and ['User'] second. (Note that your argument roleis an array as of gherkin-testcafe@2.0.0)

Unfortunately, I can only investigate on Monday. So have a nice weekend until then.

Please also note, that data tables and examples are two different things. The first one is data passed to the step. The second one duplicates the whole scenario for each example.

ZeniStiks commented 5 years ago

Yes, I understand that it's an array. Also a correction, output is [ '<role>' ]

Lukas-Kullmann commented 5 years ago

Well, that seems like a bug. I'm sorry for the inconvenience. But as I said, I can only investigate on Monday.

ZeniStiks commented 5 years ago

No problem, have a nice weekend!

ZeniStiks commented 5 years ago

A small update. I was messing around with different versions of gherkin-testcafe and it looks like scenario outlines are not working in latest version only(2.3.0) I hope this will provide some directions for the roots on this issue

Lukas-Kullmann commented 5 years ago

Hey @ZeniStiks,

I investigated the issue and found that it actually was a bug. I released v2.3.1 with a fix.