title: Testing an WPF app with CodedUI tests, should the coded ui test project share a solution or not?
body: <p><em>First some context; we are developing a large desktop WPF application in .NET 4.5 targeting 64 bit Windows 7 and 8. We are using Visual Studio 2012.2 (soon to be .3 then probably 2013!) and TFS 2012 (again .2 soon to be .3 then 2013).</em></p>
  <p><em>Currently this product is all in a single large solution (just over 50 projects) yielding a WPF exe, a load of dlls and a nice MSI to install it.</em></p>
  <p><em>We use TFS (gated and scheduled) to build the solution, its installer (WiX) and run its tests (SpecFlow for BDD and MSTest unit tests) and this is working very well.</em></p>
  <p><em>I have a separate scheduled TFS build that deploys the MSI to physical test rig in a untrusted AD domain via a PowerShell script (see <a href="https://stackoverflow.com/questions/16542441/tfs2012-labdefault-11-template-deploy-scripts-fail-with-team-foundation-server">TFS2012 LabDefault.11 template deploy scripts fail with “Team Foundation Server could not complete the deployment task”</a> for details of the challenges involved with that!)</em></p>
  <p>OK so that's where I am, now I want to take things to the next step; CodedUI tests to drive full app integration test; I want to &quot;Smoke Test&quot; my builds.</p>
  <p>So being a simple soul I added a new project to my products solution; a CodedUI test project.</p>
  <p>This happily runs the locally installed product (rather then the just built one; as I ultimately want the CUIT to be running on a deployed test rig as a smoke test, and that rig has just installed the MSI I just built) and performs some UI tests with assertions.</p>
  <p>Now <strong>my problem is with the CUIT project as part of the products solution a local test run finds and runs my CUIT tests, and this is undesired</strong>. I only want to run the CUIT tests in a lab builds test phase.</p>
  <p>So <strong>is putting the CUIT project into the product solution a bad idea?</strong> or <strong>should it be a separate solution</strong>? Splitting them seems wrong somehow as they are related; the CUIT project is the full stack integration test for the solution's deployable application.</p>
  <p>Can I include the CUIT in the products solution and stop the test runner seeing the tests? or is it better just to have two solutions?</p>
  <p>What are the pros and cons folks?</p>
  <h1>Update</h1>
  <p>In the end we created a new solution containing a coded UI test project and ensured this was built with the same TFS build that built the UI solution. This allows us to load and run the coded UI tests locally without issues, the unit tests in the main UI project are left unmolested. Still seems a little disjointed but on a multiple person team per user test settings were too awkward splitting the coded UI into a different solution was simpler.</p>