Show navigation

Today we learn how to plan a test. What's a test plan? What goes into a test plan? What can we test? How do web developers take a structured approach to testing? Plus, a few fun demos!

Implicit planning items

Sometimes some of the above are implicit, meaning they're not written down because everybody already knows about it. Be careful with your assumptions about who knows what, though! If you don't know your audience, you might be wrong about what they know. Even if you do know who is in your audience, some things may be up for debate!


Further Reading:

Check out this week's lecture for a full walk-through of the demo. To try out the demo yourself:

  1. clone the repo,
  2. use npm install to install the dependencies,
  3. run the command npm run server to start a server that will "serve" your pages so cypress can visit them, and finally
  4. in a new cli window (because the server is running in the first one), run the command npm run cypress-e2e to run the test

Visual regression demo

Go ahead and try this out! If you still have your server running from before, you can simply run the command:

npm run cypress-visual

It should pass the test. To see the test fail (which makes for a more interesting visual diff), edit the file /public/style.css on line 26, and run the cypress-visual command again.

The screenshots from your tests are located in /cypress/snapshots/, where there are folders called:

/base/
contains the baseline screenshots (what things used to look like)
/actual/
contains the actual screenshots (what they look like now)
/diff/
contains the images that combines the two to highlight the differences, respectively.
Table of ContentsWhat is a Test PlanWhat can be tested?Web Developers' Test Plans