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

Find step definitions context menu option doesnt work if ReqNRoll is in a global using file #415

Open
davemello opened this issue Jan 23, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@davemello
Copy link

Reqnroll Version

2.2.1

Which test runner are you using?

NUnit

Test Runner Version Number

2.2.1

.NET Implementation

.NET 6.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

No response

Issue Description

Find step definitions context menu option doesnt work if ReqNRoll is in a global using file

Steps to Reproduce

Reqnroll added to global using file

global using Reqnroll;
global using Reqnroll.BoDi;

On step definition class, if user right clicks on a step method, there is no option to Find step definitions

Image

Only if you add a using statement to step class will option appear

Link to Repro Project

No response

@davemello davemello added the bug Something isn't working label Jan 23, 2025
@clrudolphi
Copy link
Contributor

I can't recreate this.

Which version of the Reqnroll for VisualStudio 2022 extension do you have installed? (Extensions/Manage Extensions). The latest is v 2024.8.234

You mention adding global using Reqnroll; to a 'global using file'. Did you do that manually? Was this project created by Reqnroll's VisualStudio Extension's new project wizard? (You get prompted for which version of .net and which test framework to use?) If so, the new project already has a global using file (called ImplicitUsings.cs) and Reqnroll is already included in it.

Has the project been built? (Most of the features of the Reqnroll VisualStudio extension won't work without first building the solution).

@davemello
Copy link
Author

Hi

Reqnroll for VisualStudio 2022 extension is latest version -2024.8.234

Manually added to a custom usings file - GlobalUsings.cs as this is not a new project, we are porting over from SpecFlow.

Yes project has been built

@clrudolphi
Copy link
Contributor

Please check your project's csproj file. Does it have a <PropertyGroup> with a setting for <ImplicitUsings>? Is it set to Enable or Disable?

It should look something like the below. If it is missing, try adding it.

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
    <PackageReference Include="Reqnroll" Version="2.2.2-local" />
    <PackageReference Include="NUnit" Version="4.2.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
    <PackageReference Include="Reqnroll.NUnit" Version="2.2.1" />
  </ItemGroup>
  <ItemGroup>
    <None Include="reqnroll.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
</Project>

@davemello
Copy link
Author

Here is my csproj file

<Project Sdk="Microsoft.NET.Sdk">

   <PropertyGroup>
      <TargetFramework>net8.0</TargetFramework>
      <AssemblyName>Kneat.Gx.Web.Client.AutoTest</AssemblyName>
      <RootNamespace>Kneat.Gx.Web.Client.AutoTest</RootNamespace>
      <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
	   <ImplicitUsings>enable</ImplicitUsings>

   </PropertyGroup>

   <ItemGroup>
      <PackageReference Include="Kneat.Automation.Core.NetStandard" Version="2402.2.1" />
      <PackageReference Include="Kneat.Gx.Data.Builder" Version="2401.1.4" />
      <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
      <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
      <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
      <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
      <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
      <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
      <PackageReference Include="NLog" Version="5.3.1" />
      <PackageReference Include="nunit" Version="4.1.0" />
      <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
      <PackageReference Include="Reqnroll.NUnit" Version="2.2.1" />
      <PackageReference Include="FluentAssertions" Version="6.12.0" />
   </ItemGroup>



   <ItemGroup>
      <None Update="appsettings.json">
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="NLog.config">
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="reqnroll.json">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
      <None Update="TestFiles\IDP-fake-xml.xml">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
      <None Update="TestFiles\testFileDgn.dgn">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
      <None Update="TestFiles\testFileDwg.dwg">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
      <None Update="TestFiles\testFilePdf.pdf">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
      <None Update="TestFiles\testFileZip.zip">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
   </ItemGroup>
  
</Project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants