3

I have created a simple test class and added [AllureNUnit] attribute to test class according to this

[TestFixture]
[AllureNUnit]
public class Class1
{
    [Test]
    public void CreateHierarchy()
    {

    }
}

I also created allureConfig.json file where I have configured an allure output directory

{
"allure": {
  "directory": "allure-results"
}
}

I am running my test using VS 2017... The test has executed but I can not find anywhere a specified allure-results folder. Where is the allure-results folder?

As I undestand the specified directory is a relative path from some working directory. If so then what is the default working direcotry and do I have a possibility to change a working directory? Or I need to configure an absolute path in the configuration file

Alexcei Shmakov
  • 2,203
  • 3
  • 19
  • 34

1 Answers1

1

According to this, default working directory in NUnit 3.* is the working directory of console runner. So I could not find result folder using Visual Studio 2017. It is in somewhere system folder.

Solution:

We need to set either absolute path in allure.config or set working directory for NUnit programmatically e.g.:

[OneTimeSetUp]
public void Init()
{
   Environment.CurrentDirectory = Path.GetDirectoryName(GetType().Assembly.Location);
}

Then the allure-results folder will be in the Environment.CurrentDirectory

Alexcei Shmakov
  • 2,203
  • 3
  • 19
  • 34