mini-serveur-ft.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. from selenium import webdriver
  2. browser = webdriver.Firefox()
  3. # Edith has heard about a cool new online to-do app. She goes
  4. # to check out its homepage
  5. browser.get('http://localhost:8081')
  6. # She notices the page title and header mention to-do lists
  7. assert 'Mini-Serveur' in browser.title
  8. # She is invited to enter a to-do item straight away
  9. # She types "Buy peacock feathers" into a text box (Edith's hobby
  10. # is tying fly-fishing lures)
  11. # When she hits enter, the page updates, and now the page lists
  12. # "1: Buy peacock feathers" as an item in a to-do list
  13. # There is still a text box inviting her to add another item. She
  14. # enters "Use peacock feathers to make a fly" (Edith is very methodical)
  15. # The page updates again, and now shows both items on her list
  16. # Edith wonders whether the site will remember her list. Then she sees
  17. # that the site has generated a unique URL for her -- there is some
  18. # explanatory text to that effect.
  19. # She visits that URL - her to-do list is still there.
  20. # Satisfied, she goes back to sleep
  21. browser.quit()