-
Notifications
You must be signed in to change notification settings - Fork 0
/
functional_test.py
executable file
·41 lines (29 loc) · 1.54 KB
/
functional_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
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://127.0.0.1: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 straight away.
# She types "Buy peacock feathers" into a text box(Edith's hobby is
# tying fy-fishing lures)
# When she 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 her to add another item.
# She enters "Use peacock feathers to make a fly"(Edith is very methodical有条理)
# The page updates again, and now shows both items on her list.
# Edith wonders whether the site will remember her list. Then she
# sees that the site has generated a unique URL for her -- there is
# some explanatory text to that effect.
#She visits that url -- her to-do list is still here.
if __name__ == '__main__':
unittest.main(warnings='ignore')