diff --git a/docs/Execution/Color-Output.md b/docs/Execution/Color-Output.md new file mode 100644 index 000000000..54e9bb9f7 --- /dev/null +++ b/docs/Execution/Color-Output.md @@ -0,0 +1,27 @@ +# Color Test Result Output + +## Configuration + +To enable the colorization of the test result output, you can turn the `trace.coloredOutput` to true in the [configuration](../Installation/Configuration.md) + +The color will only be visible in supported place, like in Rider test runner or in the console when running test using `dotnet test`. + +You can turn off the color by setting `NO_COLOR=1` environment variable. This can be useful when you run the tests on a build server that does not support colors. + +## Customization + +You can customize the colors by configuring a Hook and injecting `IColorOutputTheme` like in the following example. + +```csharp +[Binding] +public class Hooks +{ + [BeforeTestRun] + public static void ConfigureColor(IColorOutputTheme colorOutputTheme) + { + colorOutputTheme.Keyword = AnsiColor.Reset; + colorOutputTheme.Error = AnsiColor.Composite(AnsiColor.Bold, AnsiColor.Foreground(TerminalRgbColor.FromHex("FF8EF3"))); + colorOutputTheme.Done = AnsiColor.Foreground(TerminalRgbColor.FromHex("3A86FF")); + } +} +``` \ No newline at end of file diff --git a/docs/Installation/Configuration.md b/docs/Installation/Configuration.md index dbbe17c65..1c536ac24 100644 --- a/docs/Installation/Configuration.md +++ b/docs/Installation/Configuration.md @@ -123,12 +123,13 @@ Use this section to specify various test execution options. Use this section to determine the SpecFlow trace output. -| Attribute | Value | Description | -| --------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| traceSuccessfulSteps | true/false | Determines whether SpecFlow should trace successful step binding executions.
**Default:** true | -| traceTimings | true/false | Determines whether SpecFlow should trace execution time of the binding methods (only if the execution time is longer than the minTracedDuration value).
**Default:** false | -| minTracedDuration | TimeSpan (0:0:0.1) | Specifies a threshold for tracing the binding execution times.
**Default:** 0:0:0.1 (100 ms) | -| stepDefinitionSkeletonStyle | RegexAttribute/MethodNameUnderscores/MethodNamePascalCase/MethodNameRegex | Specifies the default [step definition style](../Bindings/Step-Definitions.html#step-matching-styles-rules).
**Default:** RegexAttribute | +| Attribute | Value | Description | +|-----------------------------|---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| traceSuccessfulSteps | true/false | Determines whether SpecFlow should trace successful step binding executions.
**Default:** true | +| traceTimings | true/false | Determines whether SpecFlow should trace execution time of the binding methods (only if the execution time is longer than the minTracedDuration value).
**Default:** false | +| minTracedDuration | TimeSpan (0:0:0.1) | Specifies a threshold for tracing the binding execution times.
**Default:** 0:0:0.1 (100 ms) | +| stepDefinitionSkeletonStyle | RegexAttribute/MethodNameUnderscores/MethodNamePascalCase/MethodNameRegex | Specifies the default [step definition style](../Bindings/Step-Definitions.html#step-matching-styles-rules).
**Default:** RegexAttribute | +| coloredOutput | true/false | Determine whether SpecFlow should color the test result output. See [Color Test Result Output](../Execution/Color-Output.md) for more details
**Default:** false
When this setting is enable you can disable color, for example to run it on a build server that does not support colors, with the environment variable `NO_COLOR=1` | ### `stepAssemblies`