Infrastructure for executing interactive UI tests in Visual Studio.
Перейти к файлу
Steve Dower 3f18aaa011 Fixed line endings. 2015-07-29 16:06:48 -07:00
Build Renames to Get-Wix for proper style, and switches to IO.Compression.ZipFile instead of the shell. 2015-05-05 09:06:32 -07:00
Installer Fixes version number in installer. 2015-06-13 15:38:41 -07:00
VSTestHost Fixed line endings. 2015-07-29 16:06:48 -07:00
.gitattributes Add initial .gitattributes and .gitignore 2015-05-02 10:39:29 -05:00
.gitignore Updates build to remove dependency on old files. 2015-05-05 08:44:33 -07:00
.hgeol Fixed line endings. 2015-07-29 16:06:48 -07:00
BuildVSTestHost.ps1 Renames to Get-Wix for proper style, and switches to IO.Compression.ZipFile instead of the shell. 2015-05-05 09:06:32 -07:00
DeveloperGuide.md Move HowThisWholeCrazyThingWorks.txt 2015-05-02 10:45:20 -05:00
DisableSkipVerification.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
DisableVSTestHost12.0.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
DisableVSTestHost14.0.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
EnableSkipVerification.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
EnableVSTestHost12.0.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
EnableVSTestHost14.0.reg Converts registry files to UTF-8. 2015-06-13 13:07:35 -07:00
LICENSE Initial commit 2015-04-24 11:52:11 -07:00
README.md Added Gitter badge 2015-05-05 03:13:19 +00:00
VSTestHost.sln [WIP] Adds per-test settings and screen recording. 2015-06-10 18:27:14 -07:00

README.md

VisualStudio-TestHost

Join the chat at https://gitter.im/Microsoft/VisualStudio-TestHost

Infrastructure for executing interactive UI tests in Visual Studio.

Quick Start

The latest release will install the required components into all supported versions of Visual Studio. After installing a new version of Visual Studio, you will need to reinstall the test host.

Test settings files are used to specify the version of Visual Studio to launch. Example file

Add the [HostType("VSTestHost")] attribute to your unit tests, and your test will now launch VS and run within its process. The VS instance will be reused between tests, so make sure you clean everything up regardless of whether your test passes or fails. In PTVS we use a helper class with IDisposable to ensure that failed tests do not affect later ones.

Use the VSTestContext static class to access the global service provider and DTE objects of the running Visual Studio instance. You can obtain a UI automation object with AutomationElement.FromHandle(VSTestContext.DTE.MainWindow.HWnd).

For information about how this extension works, see the Developer Guide.

Supported Versions

The following versions of Visual Studio may be used as test targets:

  • Visual Studio 2010 Professional and higher
  • Visual Studio 2012 Professional and higher
  • Visual Studio 2013 Community and higher
  • Visual Studio Express 2013 for Web or Desktop with Update 2
  • Visual Studio 2015 RC Community and higher

The following versions of Visual Studio may be used to launch tests:

  • Visual Studio 2013 Community and higher
  • Visual Studio 2015 RC Community and higher

(The difference in support is due to changes in the unit test framework.)

Test Settings

These settings should be specified in a .testsettings file before launching tests.

Setting Description Values
VSApplication The registry key name "VisualStudio", "WDExpress", "VWDExpress", "Mock"
VSExecutable The executable name "devenv", "wdexpress", "vwdexpress"
VSVersion The version number "10.0", "11.0", "12.0" or "14.0"
VSHive The hive name "Exp" or blank
VSLaunchTimeoutInSeconds The number of seconds to wait for launch Any number, or blank
VSDebugMixedMode Use native debugging for tests "True", "False" or blank

If VSApplication is set to Mock, no instance of Visual Studio will be launched and tests will be run in the current process. In this case, the VSTestContext.IsMock property will be true and VSTestContext.ServiceProvider should be set by your test run initializer.