Repository navigation
Expand file tree
/
Copy pathfunctional_test.py
More file actions
51 lines (36 loc) · 1.58 KB
/
Copy pathfunctional_test.py
File metadata and controls
51 lines (36 loc) · 1.58 KB
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
42
43
44
45
46
47
48
49
50
51
### Download Selenium web driver into env/bin folder
from selenium import webdriver
import unittest, time
'''
Run django server with python3 superlists/manage.py runserver
'''
class NewVisitorTest(unittest.TestCase):
#options = webdriver.ChromeOptions()
#options.add_argument('--ignore-certificate-errors')
#options.add_argument('--test-type')
#options.binary_location = ('chromedriver')
#driver = webdriver.Chrome(chrome_options = options)
#browser = webdriver.Chrome()
def setUp(self):
self.browser = webdriver.Chrome()
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-d- app. She goes to check
self.browser.get('http://localhost:8000')
#åtime.sleep(10)
# She notices the page title and header mention todo 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
# When she hits enter, the page updates, and now the page lists
# 1: Buy peacock feathers" as a new item in a to-do list
# There is still a text box inviting her ti add another item. She enters 'Use peacock feathers to make a fly'
# The page updates again, and now shows both items on her lists
# She visits the unique url generated by the sute to revisit her to-do lists
# Satisfied she goes to sleep
# browser.quit()
if __name__ == '__main__':
unittest.main(warnings='ignore')