SlideShare a Scribd company logo
1 of 10
NetApp Update Center Testing
Guide
Before testing pleasemakesure you have completed the necessary configuration
outlined in the installation guide.
Testing Tools
After some experimentation we are currently using 2 main testing tools.
For Update Center unit testing in Ruby we are currently using Rspec for Rails.
For Update Center integration and acceptance testing we are using Selenium IDE with the Firefox
extension.
Rspec
For unit testing in Ruby we are currently using version 2.13.1 of a Ruby Gem named Rspec for Rails.
rspec-rails is a testing framework for Rails 3.x and 4.x. rspec-rails is a gem that wraps Rails testing
behaviors into RSpec’s example groups. For example, in RSpec the controller example group is based on
ActionController::TestCase::Behavior. There are also example groups for views and helpers
● Rspec for Rails Github Page
● Rpec Online Rdoc
● Addition Rdoc Examples and Documentation
This gem and its required setup should already be completed if you cloned the existing github
repository for Snap Creator Update Center.
If this is not the case and you need to install it, simply edit your Gemfile and add rspec-rails to both the
:development and :test groups in the Gemfile:
group :development, :test do
gem 'rspec-rails', '~> 2.13.1'
end
Then save the Gemfile and at the command line run command:
bundle install
This should install the required Gem. See the Installation guide for any additional setup and
configuration.
Commands for Testing with Rspec
If you have not done so first run bundle install using the command
bundle install
Next run the command
rake routes
After bundle install and rake routes complete successfully you are now able to prepare the database for
testing
Before running you test with Rspec,you need to ensure that the test database structure is current. For
this you can use the following rake commands:
rake db:migrate
...
rake db:test:load
The rake db:migrate above runs any pending migrations on the development environment and updates
db/schema.rb. The rake db:test:load recreates the test database from the current db/schema.rb.
On subsequent attempts,it is a good idea to first run the command
db:test:prepare
db:test:prepare will first check for pending migrations and warn you appropriately.
Check out additional useful Rake commands located at the bottom of the Testing Guide
Note: If you receive a warning about migrations after running db:test:prepare , you must first run rake
db:migrate above. See the list of useful rake commands towards the end of this document.
Now that the database is setup for testing you must first start the server for testing. Open a new
command window on the Update Center root directory. Then type the command:
rails s
This command is a shortcut for stating the server you can alternately run command:
rails server
They will both start the Update Center web server,you should see the output below after running the rails
s or rails server command
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-10-18 03:08:44] INFO WEBrick 1.3.1
[2013-10-18 03:08:44] INFO ruby 2.0.0 (2013-06-27) [i386-mingw32]
[2013-10-18 03:08:44] INFO WEBrick::HTTPServer#start: pid=13340 port=3000
Note - You can stop the server by typing Ctrl-C in the command window running the server.
After this information is printed in the command window you are ready to start running your test. Switch
back to you first command window, then you can run all Rspec test for Snap Creator Update Center by
running the command
bundle exec rspec spec/
If you prefer to run an individual test instead of the full suite simply run the same command above with
the full path of the test file. The example below runs the test named users_pages_spec.
bundle exec rspec spec/requests/users_pages_spec.rb
Rpec output
The output from Rspec will list the time taken to run the test, the number of "examples" or test run, and
the number of failures. When all test are passing you will see a similar output as below, each dot on the
top line is a test that was ran. Below we took 0.27518 seconds to run the test and ran 39 tests and had 0
failures.
.......................................
Finished in 0.27518 seconds
39 examples, 0 failures
Randomized with seed 37381
If a test case fails its dot will become a 'F' to reflect the failure (see example below) and also Rspec will
also give additional information to help you locate the failure.For each failing test Rspec will list
1. the test name,
2. the assert that failed
3. the expected outcome
4. location of the file containing the failing test
An example output with a failing test is below
.........F.............................
Failures:
1) User when password confimation != password
Failure/Error: it { should_not be_valid }
expected #<User id: nil, name: "Example User", email: "user@example.com", created_at:
nil> not to be valid
# ./spec/models/user_spec.rb:88:in `block (3 levels) in <top (required)>'
Finished in 0.23503 seconds
39 examples, 1 failure
Failed examples:
rspec ./spec/models/user_spec.rb:88 # User when password confimation != password
Randomized with seed 13879
In the above output
● the test name is shown in the line
1) User when password confimation != password
● the assert that failed in the line
Failure/Error: it { should_not be_valid }
● the expected outcome in the line
expected #<User id: nil, name: "Example User", email: "user@example.com", created_at: nil> not
to be valid
● the location of the file containing the failing test, the line number of the failing test and the failing test
name with the output
rspec ./spec/models/user_spec.rb:88 # User when password confirmation != password
Note if you are getting failing test that really should be passing, try restarting the server.
Selenium
For integration and acceptance testing we are using Selenium IDE. Selenium can be used in many ways.
We are using the Selenium IDE through the Selenium Firefox plugin. This testing suite is currently using
Firefox version 24 with the Selenium Plugin.
Note if you didn't have it already you will first need to install the Firefox Web Browser.
● Firefox.
Next install the Selenium IDE Plugin
● Selenium IDE Firefox Plugin
Also check out the Selenium homepage for release notes and additional examples
Below is a screen shot of the Selenium IDE plugin running in Firefox.
Note: The selenium folder contains a subfolder for each suite of test, for example the signin_page_test
subfolder contains the test suite for the signin page. The test suites and individual test are stored as .html
file and the full test suite for each folder will have a filename ending in test_suite. For example the test
suite for the user sign in page is named signin_page_test_suite.html and its relative path is
seleniumsignin_page_testsignin_page_test_suite.html
Using Selenium
To open a test suite, in the Selenium window you want to click File -> Open Test Suite... Then browse to
the Update Center root folder, then into the selenium folder where all Selenium test are contained. To
open the signin page test suite navigate to the folder seleniumsignin_page_test Then open the file
named signin_page_test_suite.html Selenium now has the test suite loaded and it is ready to run. The
example below has the signin_page_test_suite.html loaded
The individual test cases for the test suite are listed in the left column. The actual test code is located in
the right hand pane in the shot above. To run the entire test suite click the green arrow button with the
three green rectangles
To run just the single test highlighted in the left pane click the green arrow with only one green rectangle.
After running the entire test suite you will see an output screen similar the one below.
Note: annotated for detail
Once all test are passing you should get a output screen that looks like the one below
List of USEFUL rake commands and their descriptions:
Recreate the test database from the current environment's database schema
rake db:test:clone
Recreate the test database from the development structure
db:test:clone_structure
Recreate the test database from the current schema.rb
rake db:test:load
Check for pending migrations and load the test schema
rake db:test:prepare
Empty the test database.
rake db:test:purge
**You can see all of these rake task and their description by running*
rake --tasks --describe
Revision Date Details Author
Version1.1 10/21/2013 Updateddocument
withGithubMarkdown
JasonBrown
Version1.0 9/29/2013 CreatedTestingGuide JasonBrown

More Related Content

What's hot

Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPressHarshad Mane
 
Selenium – testing tool jack
Selenium – testing tool jackSelenium – testing tool jack
Selenium – testing tool jackJackseen Jeyaluck
 
R12 d49656 gc10-apps dba 24
R12 d49656 gc10-apps dba 24R12 d49656 gc10-apps dba 24
R12 d49656 gc10-apps dba 24zeesniper
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghEngineor
 
Automation Pending Items List
Automation Pending Items ListAutomation Pending Items List
Automation Pending Items Listwlxfeedpartner1
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium WorkshopClever Moe
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using SeleniumWeifeng Zhang
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Engineor
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
Selenium notes
Selenium notesSelenium notes
Selenium noteswholcomb
 
Selenium XPath Performance Problems in IE
Selenium XPath Performance Problems in IESelenium XPath Performance Problems in IE
Selenium XPath Performance Problems in IEClever Moe
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkDmytro Chyzhykov
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suiteakashdprajapati
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionAmr E. Mohamed
 

What's hot (20)

Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
 
Selenium Introduction
Selenium IntroductionSelenium Introduction
Selenium Introduction
 
Selenium
SeleniumSelenium
Selenium
 
Selenium – testing tool jack
Selenium – testing tool jackSelenium – testing tool jack
Selenium – testing tool jack
 
R12 d49656 gc10-apps dba 24
R12 d49656 gc10-apps dba 24R12 d49656 gc10-apps dba 24
R12 d49656 gc10-apps dba 24
 
CodeShip
CodeShipCodeShip
CodeShip
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
 
Automation Pending Items List
Automation Pending Items ListAutomation Pending Items List
Automation Pending Items List
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium Workshop
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)
 
Selenium Handbook
Selenium HandbookSelenium Handbook
Selenium Handbook
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Selenium notes
Selenium notesSelenium notes
Selenium notes
 
Selenium XPath Performance Problems in IE
Selenium XPath Performance Problems in IESelenium XPath Performance Problems in IE
Selenium XPath Performance Problems in IE
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suite
 
Selenium
SeleniumSelenium
Selenium
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 

Viewers also liked

Tablas de Daimiel. Itinerario Peatonal 1. Isla del Pan
Tablas de Daimiel. Itinerario Peatonal 1. Isla del PanTablas de Daimiel. Itinerario Peatonal 1. Isla del Pan
Tablas de Daimiel. Itinerario Peatonal 1. Isla del PanJoseGabrielMegia
 
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.JoseGabrielMegia
 
10 Ice Breaker Games - How to get to know your office
10 Ice Breaker Games - How to get to know your office10 Ice Breaker Games - How to get to know your office
10 Ice Breaker Games - How to get to know your officeElodie A.
 
9 Qualities Santa Looks For When Recruiting Elves
9 Qualities Santa Looks For When Recruiting Elves9 Qualities Santa Looks For When Recruiting Elves
9 Qualities Santa Looks For When Recruiting ElvesElodie A.
 
Spiritual Leadership Thesis
Spiritual Leadership ThesisSpiritual Leadership Thesis
Spiritual Leadership ThesisVictor Tan
 
10 Challenges That Every First-Time Manager Will Face
10 Challenges That Every First-Time Manager Will Face10 Challenges That Every First-Time Manager Will Face
10 Challenges That Every First-Time Manager Will FaceElodie A.
 
20 Inspiring Quotes
20 Inspiring Quotes20 Inspiring Quotes
20 Inspiring QuotesElodie A.
 
How Millennials are Affecting the Workplace
How Millennials are Affecting the WorkplaceHow Millennials are Affecting the Workplace
How Millennials are Affecting the WorkplaceElodie A.
 
Do You Struggle With Employee Recognition?
Do You Struggle With Employee Recognition?Do You Struggle With Employee Recognition?
Do You Struggle With Employee Recognition?Elodie A.
 
Secrets to a Great Team
Secrets to a Great TeamSecrets to a Great Team
Secrets to a Great TeamElodie A.
 

Viewers also liked (12)

Install Guide
Install GuideInstall Guide
Install Guide
 
Tablas de Daimiel. Itinerario Peatonal 1. Isla del Pan
Tablas de Daimiel. Itinerario Peatonal 1. Isla del PanTablas de Daimiel. Itinerario Peatonal 1. Isla del Pan
Tablas de Daimiel. Itinerario Peatonal 1. Isla del Pan
 
www.raio.ro
www.raio.rowww.raio.ro
www.raio.ro
 
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.
Tablas de Daimiel. Itinerario peatonal 2. Laguna Permanente.
 
10 Ice Breaker Games - How to get to know your office
10 Ice Breaker Games - How to get to know your office10 Ice Breaker Games - How to get to know your office
10 Ice Breaker Games - How to get to know your office
 
9 Qualities Santa Looks For When Recruiting Elves
9 Qualities Santa Looks For When Recruiting Elves9 Qualities Santa Looks For When Recruiting Elves
9 Qualities Santa Looks For When Recruiting Elves
 
Spiritual Leadership Thesis
Spiritual Leadership ThesisSpiritual Leadership Thesis
Spiritual Leadership Thesis
 
10 Challenges That Every First-Time Manager Will Face
10 Challenges That Every First-Time Manager Will Face10 Challenges That Every First-Time Manager Will Face
10 Challenges That Every First-Time Manager Will Face
 
20 Inspiring Quotes
20 Inspiring Quotes20 Inspiring Quotes
20 Inspiring Quotes
 
How Millennials are Affecting the Workplace
How Millennials are Affecting the WorkplaceHow Millennials are Affecting the Workplace
How Millennials are Affecting the Workplace
 
Do You Struggle With Employee Recognition?
Do You Struggle With Employee Recognition?Do You Struggle With Employee Recognition?
Do You Struggle With Employee Recognition?
 
Secrets to a Great Team
Secrets to a Great TeamSecrets to a Great Team
Secrets to a Great Team
 

Similar to Testing Guide

Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails AppsRabble .
 
Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautureszahid32
 
Selenium Installation
Selenium InstallationSelenium Installation
Selenium InstallationSachin-QA
 
Query Management system-Iv review
Query Management system-Iv reviewQuery Management system-Iv review
Query Management system-Iv reviewlogeshprabu
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and ExtensionsYana Altunyan
 
Ruby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraRuby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraAndolasoft Inc
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium InstallationANKUR-BA
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - InstallationRajesh-QA
 
Selenium institute in bangalore
Selenium institute in bangaloreSelenium institute in bangalore
Selenium institute in bangaloreTIB Academy
 
How To Test Everything
How To Test EverythingHow To Test Everything
How To Test Everythingnoelrap
 
Rails Testing
Rails TestingRails Testing
Rails Testingmikeblake
 
Selenium
SeleniumSelenium
Seleniumnil65
 

Similar to Testing Guide (20)

Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
Rspec
RspecRspec
Rspec
 
Database Management Assignment Help
Database Management Assignment Help Database Management Assignment Help
Database Management Assignment Help
 
Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails Apps
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautures
 
Selenium Installation
Selenium InstallationSelenium Installation
Selenium Installation
 
Query Management system-Iv review
Query Management system-Iv reviewQuery Management system-Iv review
Query Management system-Iv review
 
TDD, BDD, RSpec
TDD, BDD, RSpecTDD, BDD, RSpec
TDD, BDD, RSpec
 
Tdd
TddTdd
Tdd
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
 
Ruby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraRuby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybara
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium Installation
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - Installation
 
Selenium institute in bangalore
Selenium institute in bangaloreSelenium institute in bangalore
Selenium institute in bangalore
 
How To Test Everything
How To Test EverythingHow To Test Everything
How To Test Everything
 
Rails Testing
Rails TestingRails Testing
Rails Testing
 
Selenium
SeleniumSelenium
Selenium
 
Codeception
CodeceptionCodeception
Codeception
 

Testing Guide

  • 1. NetApp Update Center Testing Guide Before testing pleasemakesure you have completed the necessary configuration outlined in the installation guide. Testing Tools After some experimentation we are currently using 2 main testing tools. For Update Center unit testing in Ruby we are currently using Rspec for Rails. For Update Center integration and acceptance testing we are using Selenium IDE with the Firefox extension. Rspec For unit testing in Ruby we are currently using version 2.13.1 of a Ruby Gem named Rspec for Rails. rspec-rails is a testing framework for Rails 3.x and 4.x. rspec-rails is a gem that wraps Rails testing behaviors into RSpec’s example groups. For example, in RSpec the controller example group is based on ActionController::TestCase::Behavior. There are also example groups for views and helpers ● Rspec for Rails Github Page ● Rpec Online Rdoc ● Addition Rdoc Examples and Documentation This gem and its required setup should already be completed if you cloned the existing github repository for Snap Creator Update Center. If this is not the case and you need to install it, simply edit your Gemfile and add rspec-rails to both the
  • 2. :development and :test groups in the Gemfile: group :development, :test do gem 'rspec-rails', '~> 2.13.1' end Then save the Gemfile and at the command line run command: bundle install This should install the required Gem. See the Installation guide for any additional setup and configuration. Commands for Testing with Rspec If you have not done so first run bundle install using the command bundle install Next run the command rake routes After bundle install and rake routes complete successfully you are now able to prepare the database for testing Before running you test with Rspec,you need to ensure that the test database structure is current. For this you can use the following rake commands: rake db:migrate ... rake db:test:load The rake db:migrate above runs any pending migrations on the development environment and updates db/schema.rb. The rake db:test:load recreates the test database from the current db/schema.rb. On subsequent attempts,it is a good idea to first run the command db:test:prepare
  • 3. db:test:prepare will first check for pending migrations and warn you appropriately. Check out additional useful Rake commands located at the bottom of the Testing Guide Note: If you receive a warning about migrations after running db:test:prepare , you must first run rake db:migrate above. See the list of useful rake commands towards the end of this document. Now that the database is setup for testing you must first start the server for testing. Open a new command window on the Update Center root directory. Then type the command: rails s This command is a shortcut for stating the server you can alternately run command: rails server They will both start the Update Center web server,you should see the output below after running the rails s or rails server command => Booting WEBrick => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2013-10-18 03:08:44] INFO WEBrick 1.3.1 [2013-10-18 03:08:44] INFO ruby 2.0.0 (2013-06-27) [i386-mingw32] [2013-10-18 03:08:44] INFO WEBrick::HTTPServer#start: pid=13340 port=3000 Note - You can stop the server by typing Ctrl-C in the command window running the server. After this information is printed in the command window you are ready to start running your test. Switch back to you first command window, then you can run all Rspec test for Snap Creator Update Center by running the command bundle exec rspec spec/ If you prefer to run an individual test instead of the full suite simply run the same command above with the full path of the test file. The example below runs the test named users_pages_spec. bundle exec rspec spec/requests/users_pages_spec.rb Rpec output The output from Rspec will list the time taken to run the test, the number of "examples" or test run, and the number of failures. When all test are passing you will see a similar output as below, each dot on the
  • 4. top line is a test that was ran. Below we took 0.27518 seconds to run the test and ran 39 tests and had 0 failures. ....................................... Finished in 0.27518 seconds 39 examples, 0 failures Randomized with seed 37381 If a test case fails its dot will become a 'F' to reflect the failure (see example below) and also Rspec will also give additional information to help you locate the failure.For each failing test Rspec will list 1. the test name, 2. the assert that failed 3. the expected outcome 4. location of the file containing the failing test An example output with a failing test is below .........F............................. Failures: 1) User when password confimation != password Failure/Error: it { should_not be_valid } expected #<User id: nil, name: "Example User", email: "user@example.com", created_at: nil> not to be valid # ./spec/models/user_spec.rb:88:in `block (3 levels) in <top (required)>' Finished in 0.23503 seconds 39 examples, 1 failure Failed examples: rspec ./spec/models/user_spec.rb:88 # User when password confimation != password Randomized with seed 13879 In the above output ● the test name is shown in the line 1) User when password confimation != password ● the assert that failed in the line Failure/Error: it { should_not be_valid } ● the expected outcome in the line expected #<User id: nil, name: "Example User", email: "user@example.com", created_at: nil> not to be valid
  • 5. ● the location of the file containing the failing test, the line number of the failing test and the failing test name with the output rspec ./spec/models/user_spec.rb:88 # User when password confirmation != password Note if you are getting failing test that really should be passing, try restarting the server. Selenium For integration and acceptance testing we are using Selenium IDE. Selenium can be used in many ways. We are using the Selenium IDE through the Selenium Firefox plugin. This testing suite is currently using Firefox version 24 with the Selenium Plugin. Note if you didn't have it already you will first need to install the Firefox Web Browser. ● Firefox. Next install the Selenium IDE Plugin ● Selenium IDE Firefox Plugin Also check out the Selenium homepage for release notes and additional examples Below is a screen shot of the Selenium IDE plugin running in Firefox.
  • 6. Note: The selenium folder contains a subfolder for each suite of test, for example the signin_page_test subfolder contains the test suite for the signin page. The test suites and individual test are stored as .html file and the full test suite for each folder will have a filename ending in test_suite. For example the test suite for the user sign in page is named signin_page_test_suite.html and its relative path is seleniumsignin_page_testsignin_page_test_suite.html Using Selenium To open a test suite, in the Selenium window you want to click File -> Open Test Suite... Then browse to the Update Center root folder, then into the selenium folder where all Selenium test are contained. To open the signin page test suite navigate to the folder seleniumsignin_page_test Then open the file
  • 7. named signin_page_test_suite.html Selenium now has the test suite loaded and it is ready to run. The example below has the signin_page_test_suite.html loaded The individual test cases for the test suite are listed in the left column. The actual test code is located in the right hand pane in the shot above. To run the entire test suite click the green arrow button with the three green rectangles To run just the single test highlighted in the left pane click the green arrow with only one green rectangle. After running the entire test suite you will see an output screen similar the one below. Note: annotated for detail
  • 8. Once all test are passing you should get a output screen that looks like the one below
  • 9. List of USEFUL rake commands and their descriptions: Recreate the test database from the current environment's database schema rake db:test:clone Recreate the test database from the development structure db:test:clone_structure Recreate the test database from the current schema.rb rake db:test:load Check for pending migrations and load the test schema rake db:test:prepare
  • 10. Empty the test database. rake db:test:purge **You can see all of these rake task and their description by running* rake --tasks --describe Revision Date Details Author Version1.1 10/21/2013 Updateddocument withGithubMarkdown JasonBrown Version1.0 9/29/2013 CreatedTestingGuide JasonBrown