nunit3-vs-adapter icon indicating copy to clipboard operation
nunit3-vs-adapter copied to clipboard

.runsettings file with VS Mac and NUnit 3 VS Adapter

Open LiohAu opened this issue 5 years ago • 5 comments

I don’t know if I am facing a bug or not, but the parameters of my .runsettings file are not accessible from the TestContext.Parameters variable when I run a test.

I am using VS Mac and I did not find a window to indicate the .runsettings to use, so I tried to add thoses lines of code to my .csproj, but that still does not work :

<PropertyGroup> <RunSettingsFilePath>$(MSBuildProjectDirectory).runsettings</RunSettingsFilePath> </PropertyGroup>

I am using NUnit with SPecFlow (if that matters).

Thanks for your help.

LiohAu avatar Aug 20 '20 07:08 LiohAu

image

If you don't see the same, please show a screenshot of how it looks on your side.

OsirisTerje avatar Aug 20 '20 07:08 OsirisTerje

Here is how it looks like on my side :

Capture d’écran 2020-08-20 à 10 14 34

The "Custom parameters" things seems to open a window that is more related to command line parameters to be passed to mono OR environment variables to be set for running.

Here how this window looks like :

Capture d’écran 2020-08-20 à 10 19 12

LiohAu avatar Aug 20 '20 08:08 LiohAu

Runsettings support in VS for Mac is currently on the backlog. https://developercommunity.visualstudio.com/idea/562230/how-to-select-runsettings-file-n-visual-studio-201.html

In the meantime, my suggestion would be to use the integrated terminal in VS for Mac for test runs and specify the runsettings file at the command-line.

kendrahavens avatar Aug 24 '20 18:08 kendrahavens

Nothing new on that topic ? If creating an UI that allows selection of the runsettings file is too long, could we provide the runsettings by a parameter in the .config or by an environment variable ?

LiohAu avatar Oct 22 '20 08:10 LiohAu

Faced the same issue, here is how you can call it from commandline and provide a runsettings file

dotnet test Your.TestCases.csproj -s yourConfig.runsettings --filter "SomeFilterKeyWord"

denislutz avatar Mar 14 '22 13:03 denislutz