1

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).

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.

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.

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 TFS2012 LabDefault.11 template deploy scripts fail with “Team Foundation Server could not complete the deployment task” for details of the challenges involved with that!)

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 "Smoke Test" my builds.

So being a simple soul I added a new project to my products solution; a CodedUI test project.

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.

Now 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. I only want to run the CUIT tests in a lab builds test phase.

So is putting the CUIT project into the product solution a bad idea? or should it be a separate solution? Splitting them seems wrong somehow as they are related; the CUIT project is the full stack integration test for the solution's deployable application.

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?

What are the pros and cons folks?

Update

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.

Community
  • 1
  • 1
Pete Stensønes
  • 5,595
  • 2
  • 39
  • 62
  • Would be nice if you can give some feedback to existing answers (to keep discussion alive) – Micha Jul 03 '13 at 05:38

2 Answers2

4

What I did was make one Solution and made a CUIT project within, I then made multiple Coded UI test's within that. This is good because using an orderedTest you can run them together and they also share a UIMap which helps too.

matthiasgh
  • 321
  • 1
  • 11
1

I also have/had this problem, because we are at the beginning of using CUIT. For now the CUIT remains in product solution. We do this because the tests should remain in memory of developers. When tests stay in on solution I'm afraid they get lost in oblivion. But indeed there is sometimes a bad feeling that the CUIT pollute the products solution, so i guess they will get their own solution after some time pass and the test become established.

Edit: If you use different Versions of Visual Studio you have to consider that for example a VS Prof. can’t build a solution with Code UI Tests. This means in “multi VS-version environments” you have to separate Coded UI Tests from “real” code.

Micha
  • 5,117
  • 8
  • 34
  • 47
  • The seperate coded UI test project+solution is what I'm working with now. Seems to be the only way to not have the CUIT tests picked up and run by the test runner (which I dont want) but I dont like it as it means people editing the main projects solution can remain unaware of the CUIT tests existence. – Pete Stensønes Jul 03 '13 at 07:40
  • Maybe this "helps" you for test runner "problem": http://stackoverflow.com/questions/12582025/how-to-exclude-tests-from-vs2012-test-runner – Micha Jul 03 '13 at 07:46
  • Thats why I'm trying this route now. I would prefer teh all in one souluition but want test runner to only find unit tests not CUITs, so far this is looking like the only option. – Pete Stensønes Jul 03 '13 at 08:03