We started using StillAllive last month. One limitation with StillAlive and other intelligent monitoring solutions is that as your application changes with each deployment, your StillAlive monitoring recipe can break becoming incompatible with the latest version of your app. Our solution to this issue is including our StillAlive recipes as part of our cucumber suite. In this case our still_alive.feature file looks like:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Still alive user with spaces | |
In order to get alerts | |
As a vts employee | |
I want still alive to click through pages and let me know if everything is ok | |
Background: | |
Given I am a user with email: "user@test.com", password: "password" | |
And I have 3 spaces | |
And I have 2 tour books with 2 spaces each | |
And there are featured spaces | |
Scenario: Click around the site | |
And I go to http://www.ourapp.com/users/sign_in | |
And I fill in "user_email" with "user@test.com" | |
And I fill in "user_password" with "password" | |
And I press "Sign in" | |
And I follow "View Space" within "li.myspace_1" | |
And I should see "Space Details" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "View Space" within "#spaces .last" | |
And I should see "Space Details" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "Show Tour Book" within ".tour_book_1" | |
And I should see "Tour Book" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "Show Tour Book" within "#tour_book_items .last" | |
And I should see "Tour Book" within "title" | |
And I follow "View Space" within ".tour_book_space_1" | |
Then I should see "Space Details" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "View Space" within ".featured_space_1" | |
And I should see "Space Details" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "View Space" within "#featured_spaces .last" | |
And I should see "Space Details" within "title" | |
And I follow "my portfolio" within "#navigation" | |
Then I should see "My Portfolio" within "title" | |
And I follow "View Space" within ".myspace_2" | |
Then I should see "Space Details" within "title" | |
And I follow "dashboard" within "#navigation" | |
And I follow "Edit" within ".myspace_3" | |
Then I should see "Edit Space" within "h1" | |
And I follow "my portfolio" within "#navigation" | |
And I follow "Tour Books" within "#subnavigation" | |
And I follow "Edit" within "li.last" | |
And I should see "Edit Tour Book" within "title" | |
And I follow "Advanced Search" | |
And I should see "Search" within "title" | |
And I follow "View Space" within ".search-result4" | |
And I should see "Space Details" within "title" |
Since we are being naughty and still using web_steps.rb, we just needed to add the following to our paths.rb which converts the absolute url http://www.ourapp.com/users/sign_in to the relative /users/sign_in for testing within cucumber.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
when %r{(?:http://www.ourapp.com|^)(/.*)} | |
$1 |
Once that test worked within our cucumber suite, we copied everything but the Background to our StillAlive recipe.
Now if something we change in development is incompatible with our StillAlive recipe, we'll find out about it before we release to production.
No comments:
Post a Comment