My question focuses on if my installation currently matches the best practices for BDD with UI acceptance testing. I use WatiN with SpecFlow to create tests for receiving the user interface, and I deploy my application to AppHarbor (cloud platform as a service for .Net applications). AppHarbor runs your unit / integration tests during deployment and only pushes your site live if your tests pass. So I started by first writing a basic test with an error like this:
Scenario: Navigation to homepage When I navigate to / Then I should be on the application homepage
The steps associated with this test open a browser using WatiN and confirm that the title attribute for the presentation is set to "Welcome." I am checking the environment to decide which URL to test using the WatiN browser. For example, if in development, go to "http: // localhost: 49641 /" for home. Otherwise, go to "http://myappharborapp.com/".
My problem is that if you are deploying this application for the first time, the page or presentation doesn’t actually exist, so the test doesn’t work (because the site is not yet live. It will also fail if, for example, I add the “About” program later and I’ll write a failure first.When I click on updates, the test will fail because page “O” does not exist yet.
My question is: I am not following best practices regarding how you should customize your user interface tests? How should these tests be configured to pass in any environment?
Any insight is greatly appreciated!
source share