0%

Book Description

The World Wide Web has come a long way from static HTML pages. Today's developers enforce and enjoy standards, and we have built the web's primitive tools into advanced libraries, frameworks, and platforms.With these new freedoms come new responsibilities. Developers can now write some amazing bugs. A bug in a web page, hosted in a free web browser, can render expensive servers useless. Modern editors help rapidly write tangled and crufty code, the perfect habitat for bugs of every species, in situations that are hard to debug. We need help from the mortal enemy of the bug: Test-First Programming. This Short Cut seeks fixes for the hardest situation in web development; proactive test cases for Ajax code. We survey existing techniques, and invent new ones. Our goal is heads-down programming, without repeatedly clicking on a web browser.

Table of Contents

  1. Test Driven Ajax (on Rails)
    1. Prerequisites
      1. Prerequisites
      2. Web Testing Challenges
      3. What's the Deal with Ajax?
      4. What's Test-First Programming?
      5. Why Test-First?
      6. Target Semantics, not Syntax
      7. Feedback
      8. A Wiki Test Runner
    2. Enough Planning! Now Rush to Coding...
      1. Authoring
      2. Sprouting a Class
      3. assert_select Divides and Conquers HTML
    3. YAML !omap
      1. assert_routing
    4. assert_xpath Queries XHTML Details
      1. Multi-level assert_xpath
    5. Why YPath?
    6. In-Place Editing (without Ajax.InPlaceEditor()!)
      1. Monkey Patching
    7. Lexing JavaScript with assert_js
      1. Super-Strict Lexing
      2. assert_argument
    8. Simulate Ajax Server Hits with xhr :get
    9. Simulate Ajax Posts with select_form
    10. Using an IFRAME to Test Web Sites
      1. link_to_remote
      2. Escaping Too Little or Too Much!
    11. assert_params
    12. Wiki Tests Wiki
      1. Drive our Test Page with JavaScript
      2. JavaScript Glue
      3. JavaScriptGenerator#click
    13. Red Bar
      1. The Web 2.0 Look (more or less!)
      2. The Error Transcript
    14. assert_ajax
      1. Ajax.Responders
      2. Closing the Loop
    15. Green Bar
      1. Usability
    16. Conclusion(s)
      1. Productization
      2. Code Review
      3. Acknowledgments
      4. Colophon
    17. About the Author
3.17.128.129