Skip to content

Configuration

Mahmoud Ali edited this page Apr 4, 2021 · 4 revisions

You can customize some behaviours from the Xamarin.Forms.TestingLibrary, most of it is accessed by the static TestingLibraryOptions. So in order to customize you simply set its values. These are the available options at the moment.

DebugOptions

TreeFormatter

In order to correctly show the debugging information, a tree is built with all the elements relevant properties and its children. You can customize how the tree is formatted.

You may provide a ITreeFormatter implementation. Accessible through TestingLibraryOptions.DebugOptions.TreeFormatter.

The default formatter uses Spectre.Console's project to print the tree. You can see its implementation here

OutputTextWriter

You can specify where the debug text is printed to. By default we will print it to the Console.Out, so the test runner show should it in the test panel if you are running the tests in any IDE, and of course, in the console if you are running through the command line.

You may provide a TextWriter implementation. Accessible through TestingLibraryOptions.DebugOptions.OutputTextWriter.

Clone this wiki locally