You are previewing The Way of the Web Tester.
O'Reilly logo
The Way of the Web Tester

Book Description

This book is for everyone who needs to test the web. As a tester, you'll automate your tests. As a developer, you'll build more robust solutions. And as a team, you'll gain a vocabulary and a means to coordinate how to write and organize automated tests for the web. Follow the testing pyramid and level up your skills in user interface testing, integration testing, and unit testing. Your new skills will free you up to do other, more important things while letting the computer do the one thing it's really good at: quickly running thousands of repetitive tasks.

Table of Contents

  1. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">&#160;</span>AcknowledgementsAcknowledgements
  2. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">&#160;</span>It&#8217;s Good to See You!It’s Good to See You!
    1. How to Read This Book
    2. A Few Conventions
    3. Fun Bits with Purpose
    4. Online Resources
  3. Part I. Mapping the Pyramid
    1. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">1. </span>The Testing PyramidThe Testing Pyramid
      1. It Was Beautiful
      2. The Wheels on the Bus
      3. Three Hard Lessons Learned
      4. Enter the Testing Pyramid
      5. UI Tests
      6. Integration Tests
      7. Unit Tests
      8. Rules of Thumb
      9. Who’s Writing These Things
      10. What We’ve Learned So Far
    2. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">2. </span>Smoking User Interface TestsSmoking User Interface Tests
      1. Another Botched Release
      2. Enter the User Interface Test
      3. How They Work
      4. HTML Is for Asserting
      5. CSS Is for Selecting
      6. What We’ve Learned So Far
    3. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">3. </span>Adding UI Tests to Legacy SystemsAdding UI Tests to Legacy Systems
      1. Step 1: Confirm You’re on the Right Test Page
      2. Step 2: Figure Out Your CSS Selectors
      3. Step 3: Make Your Assertions
      4. What We’ve Learned So Far
    4. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">4. </span>Connecting the Dots with Integration TestsConnecting the Dots with Integration Tests
      1. There Is No UI
      2. Enter the Integration Test
      3. How the Web Works
      4. Talking HTTP
      5. Taking a REST
      6. What We’ve Learned So Far
    5. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">5. </span>Integration Testing RESTful Web ServicesIntegration Testing RESTful Web Services
      1. Testing the RESTful Permit API
      2. HTTP GET
      3. HTTP POST
      4. HTTP PUT
      5. HTTP DELETE
      6. What We’ve Learned So Far
    6. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">6. </span>Covering Our Bases with Unit TestsCovering Our Bases with Unit Tests
      1. Everything Is Awesome!
      2. The Challenge with UI Tests
      3. Enter the Unit Test
      4. How They Work
      5. Turning It Up
      6. What We’ve Learned So Far
    7. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">7. </span>Unit Testing in the Browser with JavaScriptUnit Testing in the Browser with JavaScript
      1. Magic in the Browser
      2. JavaScript and the Pyramid
      3. Bug Hunt
      4. Step 1: Scan the HTML
      5. Step 2: Check the JavaScript
      6. Step 3: Write the Tests
      7. Static vs. Dynamic Typing
      8. Open Mic
      9. What We’ve Learned So Far
    8. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">8. </span>Climbing the PyramidClimbing the Pyramid
      1. The Pyramid in Action
      2. Start with the Unit Tests
      3. Step Up to the Integration Tests
      4. Reach for the UI Tests
      5. The Inverted Pyramid
      6. How to Deal with Flaky Tests
      7. What We’ve Learned So Far
  4. Part II. Exploring the Pyramid
    1. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">9. </span>Programming 101Programming 101
      1. The Mechanics of Programming
      2. The Importance of Style
      3. Naming
      4. Spacing
      5. Dealing with Duplication
      6. Playing the Game
      7. Step 1: Fix the Spacing
      8. Step 2: Choose Good Names
      9. Step 3: Tackle Duplication in the Class
      10. Step 4: Remove Duplication in the Test
      11. What We’ve Learned So Far
    2. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">10. </span>Organizing Tests: Bringing Method to the MadnessOrganizing Tests: Bringing Method to the Madness
      1. The Land of Confusion
      2. The Beauty of Isolation
      3. The Clarity of Context
      4. Intruder Alert
      5. What We’ve Learned So Far
    3. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">11. </span>Effective MockingEffective Mocking
      1. Listen to the Music
      2. Enter the Mock
      3. Step 1: Prepare the Mock
      4. Step 2: Set Expectations
      5. The Shackles of Coupling
      6. The Swamp of Mocking
      7. Ports and Adapters
      8. Open Mic
      9. What We’ve Learned So Far
    4. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">12. </span>Writing Tests FirstWriting Tests First
      1. Where to Begin
      2. What Is Test-Driven Development (TDD)?
      3. Step 1: Write a Failing Test
      4. Step 2: Make the Test Pass
      5. Step 3: Refactor
      6. Advantages of Working This Way
      7. Seeing It in Action
      8. Cycle, Rinse, Repeat
      9. Open Mic
      10. What We’ve Learned So Far
      11. Final Words
    5. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">A1. </span>CSS Cheat SheetCSS Cheat Sheet
    6. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">A2. </span>Google Chrome Developer ToolsGoogle Chrome Developer Tools
  5. <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="toc-secnum">&#160;</span>BibliographyBibliography