Ruby-on-Rails
  Home arrow Ruby-on-Rails arrow Commands for Acceptance Testing
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
RUBY-ON-RAILS

Commands for Acceptance Testing
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2010-07-29

    Table of Contents:
  • Commands for Acceptance Testing
  • Accessor Commands
  • Element Locators
  • The First Acceptance Test

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Commands for Acceptance Testing


    (Page 1 of 4 )

    In this second part of a three-part article series on acceptance testing with Ruby on Rails, you will learn the various commands that are performed during this process, and start your first acceptance test. This article is excerpted from chapter 11 of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).

    Assertion Commands

    Assertions, or checks, verify that the state of the application is as expected after one or more actions have been executed by Selenium. For example, you can test that the title of the page or the value of a variable is correct.

    Assertions are split into three groups that behave somewhat differently:

    1. Assertions (assert) abort the test if they fail.
    2. Verifications (verify) log the error and allow the test to continue. 
       
    3. Wait for (waitFor) assertions wait for the specified event to happen. They can be used for testing Ajax functionality. For example, you can wait for the value of an element on the page to be updated by an Ajax request.

    Table 11-2 shows a partial list of supported Selenium assertions.

    Table 11-2. Commonly Used Selenium Assertions  

     

     

    Name

    Description

    assertLocation (location)

    Asserts the location of the currently loaded page; for example, that it’s /forumand not /catalog

    assertTitle(title)

    Asserts that the title of the currently loaded page is correct

    assertTextPresent(text)

    Asserts that the specified text is present on the page

     

     

    Verification and wait for assertions use the same format. Use verifyLocation(/forum) to verify that the location is /forum, and use waitForLocation(/forum) to wait for that page to be loaded.

    More Ruby-on-Rails Articles
    More By Apress Publishing


     

    RUBY-ON-RAILS ARTICLES

    - Application Deployment with Capistrano
    - Deploying an Application to the Server
    - Secure Application Deployment with Ruby on R...
    - Installing the Database for Application Depl...
    - Application Deployment
    - Recording Acceptance Tests
    - Commands for Acceptance Testing
    - Acceptance Testing
    - Checkout and Order Processing: the User Side
    - Checkout and Order Processing: the Administr...
    - Online Order Processing: Using PayPal
    - Order and Payment Handling for an Ecommerce ...
    - Checkout and Order Processing for an Ecommer...
    - Getting Text and Currency Working for Multip...
    - Translating a Site for Multiple Language Sup...





     


     


    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek