Integration Issue
This is the first time that I am really trying to bulid a serious integration tests framework for a project. By this I mean a set of tests that really test drive my application (through the UI, through high level overviews that cross cut the system, etc). This brings some interesting problems into the table.
For instance, I am not able to do something like:
> msbuild default.build /target:Integration
> msbuild default.buiild /target:Integration
During the build I am creating a virtual directory, and then I am hitting the site using Selenium, verifying stuff from the UI. The problem is that doing this will lock the build directory, so I can't run a build directly after that (for instance, if the build failed, or if two developers commits near one another).
Additional issue is that Selenium cannot be run from a service (require interacting with the desktop), so I sort of run the build service from a user desktop. I know that I can allow a service to interact with the desktop, but this requires an existing desktop, which means that I need a logged on user anyway.
Another issue is generating the database, once for the test and once for the deployed site, all of that while keep the dev machine DB alive and well (since it is something that developers will also run, usually before a commit).
Anyway, I am learning quite a bit of bad practices that I should avoid in the future at the moment :-)
Comments
I ran into the same issue with Selenium requiring desktop access which is irritating. I also encountered some intermittent problems during a build that were not reproducible with a subsequent manual build . Not sure if it's the same as what you're seeing but setting a ridiculously high timeout value was the answer (only invoked if an action does not complete so will not slow down good tests). I do sometimes have another problem with page navigation when the target page does not appear to have fully loaded when I start making asserts. I ended up using an ugly Thread.Sleep() hack here (your idea of a timebomb would be good as it would force me to look at a proper fix).
Regarding the database I simply use SQL Server DMO to dump the schema and then have a build database script that takes the database name as a parameter. Obviously you need to store test data for each environment. I have another script that dumps the current database content as a script that can be executed after a create. Experience has taught me that it's important to use the app to build test data (when you get that far) as direct SQL entry might not result in the same data as the app generates!
What do you mean high timeout value??
About Thread.Sleep(), selenium has a WaitForPageToLoad() method :-)
The problem with building the DB is that I may need to handle 3 - 5 different databases with different semantics for each (create schema , create schema & data, do not touch, warn if not match schema, etc).
I fully agree about letting the app create the data, although I have not given it though previously.
WaitForPageToLoad() was my first option but it did not help. It was as if the page had loaded but certain data (such as the title) were still from the old page. I would have loved to dig through the source and understand why but I didn't have the time. One day...
Comment preview