Skip to content

Set Allure-Result directory #2154

Discussion options

You must be logged in to vote

Hello, @ZhouZhengCarlos!

Changing the configuration at runtime is not possible at the moment. What you can do instead is to create the configuration file you need before the tests start executing and point the ALLURE_CONFIG env variable to it. If you do that early enough, Allure will pick the config you've just crafted and use it.

I advise you to use an assembly-level SetUpFixture for such a task (i.e., a SetUpFixture with no namespace) to be sure it affects all tests in the assembly. The following should do the trick:

using System.Text;
using System.Text.Json;
using Allure.Net.Commons;
using NUnit.Framework;

[SetUpFixture]
class PrepareOutputDirectoryFixture
{
    string? path;

    [On…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZhouZhengCarlos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants