Spaces:
Sleeping
Sleeping
Commit ·
f45fc66
1
Parent(s): 6b88f68
First FT specced out in comments, and now uses unittest
Browse files- functional_tests.py +26 -4
functional_tests.py
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
|
|
| 1 |
from selenium import webdriver
|
| 2 |
|
| 3 |
-
browser = webdriver.Firefox()
|
| 4 |
-
browser.get("http://localhost:8000")
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import unittest
|
| 2 |
from selenium import webdriver
|
| 3 |
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
class NewVisitorTest(unittest.TestCase):
|
| 6 |
+
def setUp(self):
|
| 7 |
+
self.browser = webdriver.Firefox()
|
| 8 |
+
|
| 9 |
+
def tearDown(self):
|
| 10 |
+
self.browser.quit()
|
| 11 |
+
|
| 12 |
+
def test_can_start_a_todo_list(self):
|
| 13 |
+
# Edith has heard about a cool new online to-do app.
|
| 14 |
+
# She goes to check out its homepage
|
| 15 |
+
self.browser.get("http://localhost:8000")
|
| 16 |
+
|
| 17 |
+
# She notices the page title and header mention to-do lists
|
| 18 |
+
self.assertIn("To-Do", self.browser.title)
|
| 19 |
+
|
| 20 |
+
# She is invited to enter a to-do item straight away
|
| 21 |
+
self.fail("Finish the test!")
|
| 22 |
+
|
| 23 |
+
[...]
|
| 24 |
+
|
| 25 |
+
# Satisfied, she goes back to sleep
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__":
|
| 29 |
+
unittest.main()
|