reqnroll / Reqnroll

Open-source Cucumber-style BDD test automation framework for .NET.
https://reqnroll.net
BSD 3-Clause "New" or "Revised" License
310 stars 32 forks source link

Issues with Cucumber Expressions #63

Closed konarx closed 4 months ago

konarx commented 4 months ago

Reqnroll Version

1.0.1

Which test runner are you using?

NUnit

Test Runner Version Number

4.5.0

.NET Implementation

.NET 6.0

Test Execution Method

ReSharper Test Runner

Content of reqnroll.json configuration file

{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",
  "bindingAssemblies": [
    {
      "assembly": "My.External.NuGet"
    }
  ]
}

Issue Description

I am using Rider with the latest build of the Rider.Reqnroll plugin. In a pretty easy Scenario:

@login
Scenario: Invalid login to My App
    When the user fills credentials as, username: my_user and password: 123pass456
    And clicks Login
    Then the user is not successfully logged in My App

I have a Step Definition, based on Cucumber Expressions:

[When("the user fills credentials as, username: {word} and password: {word}")]
public async Task WhenTheUserFillsCredentialsAsUsernameAndPassword(string username, string password)
{
     _scenarioContext["currentUser"] = username;
     await _loginPage.FillCredentials(username, password);
}

This causes two issues:

  1. The execution marks the test as Inconclusive and gives me the following log:

    When the user fills credentials as, username: my_user and password: 123pass456 -> No matching step definition found for the step. Use the following code to create one: [When(@"the user fills credentials as, username: my_user and password: (.)pass(.)")] public void WhenTheUserFillsCredentialsAsUsernameMy_UserAndPasswordPass(int p0, int p1) { _scenarioContext.Pending(); }

    It seems like it does not support Cucumber Expressions. Is that a known issue? Do I do something wrong?

  2. While the other Step Definitions are ok (they are not using Cucumber Expressions but Regex), all the other Steps within the same .feature file marked as "Cannot find a matching step definition", but the runner identifies them and run the tests successfully! Strange, uh? image

Steps to Reproduce

Implement the above Scenario

Link to Repro Project

No response

gasparnagy commented 4 months ago

@konarx could you please move this issue to the Reqroll.Rider project. I think it does not yet support cucumber expresssions.

konarx commented 4 months ago

Sure, I'll be happy to, but maybe the Documentation should state that it does not support Cucumber Expressions yet, just to avoid misunderstandings like this one.

Edit: Apologies, I just saw that there is not even a section for Rider plugin in the Documentation. My bad. 😅