From 572c9269a32531c64494889e0538a95ec6d67fe7 Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Fri, 23 Jul 2021 16:36:36 -0400 Subject: First FT specced in comments, now uses unittest --- functional_tests.py | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/functional_tests.py b/functional_tests.py index d9f9595..d2cf17a 100644 --- a/functional_tests.py +++ b/functional_tests.py @@ -1,6 +1,40 @@ from selenium import webdriver +import unittest -browser = webdriver.Firefox() -browser.get('http://localhost:8000') +class NewVisitorTest(unittest.TestCase): + def setUp(self): + self.browser = webdriver.Firefox() -assert 'Django' in browser.title \ No newline at end of file + def tearDown(self): + self.browser.quit() + + def test_can_start_a_list_and_retrieve_it_later(self): + # Edith has heard about a cool new online to-do app. She goes to check out its + # homepage + self.browser.get('http://localhost:8000') + + # She notices the page title and header mention to-do lists + self.assertIn('To-Do', self.browser.title) + self.fail('Finish the test!') + + # She is invited to enter a to-do item + + # She types 'Buy peacock feathers' into a text box + + # When she hits enter, the page updates, and now the page lists + # "1: Buy peacock featers" + + # There is still a text box for her to enter more todos + # She enters 'Use peacock feathers to make a fly' + + # The page updates again and now shows both items in her list + + # Edith sees there is a unique url for her to come back to this list later on + + # She goes to that url and her list is still there! + + # She gets off the internet for today + + +if __name__ == '__main__': + unittest.main(warnings='ignore') -- cgit v1.2.3