diff --git a/.gitignore b/.gitignore index a69ac34..b54c323 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ db.sqlite3 .venv -"__pycache__" -"*.pyc" +__pycache__ +*.pyc diff --git a/functional_tests.py b/functional_tests.py index 1aa31f1..cb08aaf 100644 --- a/functional_tests.py +++ b/functional_tests.py @@ -1,7 +1,35 @@ +import unittest from selenium import webdriver -browser = webdriver.Firefox() -browser.get("http://localhost:8000") +class NewVisitorTest(unittest.TestCase): + def setUp(self): + self.browser = webdriver.Firefox() + + def tearDown(self): + self.browser.quit() + + def test_can_start_a_todo_list(self): + # Ig has heard about a cool new online to-do app. + # He goes to check out its homepage + self.browser.get("http://localhost:8000") + # He notices the page title and header mention to-do lists + self.assertIn("To-Do", self.browser.title) -assert "Congratulations!" in browser.title -print("OK") + # He is invited to enter a to-do item straight away + self.fail("Finish the test!") + + # He types "Buy peacock feathers" into a text box + # (Ig's hobby is tying fly-fishing lures) + + # When he hits enter, the page updates, and now the page lists + # "1: Buy peacock feathers" as an item in a to-do list + + # There is still a text box inviting him to add another item. + # He enters "Use peacock feathers to make a fly" (Ig is very methodical) + + # The page updates again, and now shows both items on his list + + # Satisfied, he goes back to sleep + +if __name__ == "__main__": + unittest.main() \ No newline at end of file