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

Issues with Cucumber Expressions #2

Open
konarx opened this issue Mar 2, 2024 · 1 comment
Open

Issues with Cucumber Expressions #2

konarx opened this issue Mar 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@konarx
Copy link

konarx commented Mar 2, 2024

Related to #63

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

@Socolin
Copy link
Collaborator

Socolin commented Mar 24, 2024

This is not supported yet, only the regex are supported for now.

It should be implemented in the future. I don't think this should be such a big things to add.

@Socolin Socolin added the enhancement New feature or request label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants