Skip to content

Commit 1063bfd

Browse files
authored
Updating runsettings doc with recent changes to the test platform
1 parent 30a5d8c commit 1063bfd

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

docs/test/configure-unit-tests-by-using-a-dot-runsettings-file.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ Unit tests in Visual Studio can be configured by using a \*.runsettings file. (T
8282

8383
</CodeCoverage>
8484
</Configuration>
85-
</DataCollector>
85+
</DataCollector>
8686

87+
<!--Video data collector is only available with Visual Studio 2017 Update 5 and higher -->
88+
<DataCollector uri="datacollector://microsoft/VideoRecorder/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Screen and Voice Recorder">
89+
</DataCollector>
8790
</DataCollectors>
8891
</DataCollectionRunSettings>
8992

@@ -133,15 +136,23 @@ Unit tests in Visual Studio can be configured by using a \*.runsettings file. (T
133136

134137
#### Code coverage adapter
135138
The code coverage data collector creates a log of which parts of the application code have been exercised in the test. For more information about customizing the settings for code coverage, see [Customizing Code Coverage Analysis](../test/customizing-code-coverage-analysis.md).
139+
140+
#### Video data collector
141+
The video data collector captures a screen recording when tests are run. This is useful for troubleshooting UI tests. Video data collector is available only with Visual Studio 2017 Update 5 and later.
136142

137-
#### Other diagnostic data adapters
138-
The code coverage adapter is currently the only adapter that can be customized by using the run settings file.
139-
140-
To customize any other type of diagnostic data adapter, you must use a test settings file. For more information, see [Specifying Test Settings for Visual Studio Tests](/devops-test-docs/test/specifying-test-settings-for-visual-studio-tests).
143+
To customize any other type of diagnostic data adapter, you must use a test settings file. For more information, see [Specifying Test Settings for Visual Studio Tests](/devops-test-docs/test/specifying-test-settings-for-visual-studio-tests).
141144

142145
#### TestRunParameters
143-
TestRunParameters provides a way to define variables and values that are available to the tests at runtime.
144-
146+
TestRunParameters provides a way to define variables and values that are available to the tests at runtime. These variables can be accessed using the [TestContext](https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext(v=vs.140).aspx) object.
147+
148+
```
149+
[TestMethod]
150+
public void HomePageTest()
151+
{
152+
string appURL = TestContext.Properties["webAppUrl"];
153+
```
154+
To use TestContext, you must add a private [TestContext](https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext(v=vs.140).aspx) field and a public `TestContext` property to your test class.
155+
145156
### MSTest Run Settings
146157
These settings are specific to the test adapter that runs test methods that have the `[TestMethod]` attribute.
147158

0 commit comments

Comments
 (0)