Alchemy Bootstrap Template

RPS

HTML elements needed?

  • 3 radio button inputs
  • button to submit
  • text field for result
  • text field for wins/losses

What state do I need?

  • userPick
  • wins / losses / totalPlays
  • randomRPS

What events am I listening for?

  • button click
    • generate random rps (0, 1, 2)
    • get user input
    • compare random rps to user choice
      • if guessed correctly -- increment the wins
      • else -- increment the losses

Making a plan

(bolded steps are mandatory, unbolded are for more advanced projects)

  1. Make a drawing of your app. Simple "wireframes"
  2. Once you have a drawing, name the HTML elements you'll need to realize your vision
  3. For each HTML element ask: Why do I need this?
  4. Ask which of out HTML elements are hard coded, and which are dynamically generated?
  5. Once we know why we need each element, think about how to implement the "Why" as a "How"
  6. Is there some state we need to initialize?
  7. Find all the 'events' (user clicks, form submit, on load etc) in your app. Ask one by one, "What happens when" for each of these events. Does any state change?
  8. Think about how to validate each of your steps
  9. Ask: should any of this work be abstracted into functions? (i.e., is the work complicated? can it be resused?)
  10. Consider your data model. What objects will you be using? What are the key/value pairs? What arrays do you need? What needs to live in local storage?
  11. Consider what features depend on what other features. Use this dependency logic to figure out what order to complete tasks.

To Run Cypress Tests

  • npm install
  • npm test
  • Cypress will open -- you should then click "run <#> integration spec(s)"
  • Make sure all tests pass