-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctional_tests.py
72 lines (51 loc) · 2.37 KB
/
functional_tests.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from selenium import webdriver
import unittest
"""
the_host = "http://localhost:8000"
driver = webdriver.Firefox()
driver.get(the_host)
assert "Django" in driver.title
driver.close()
"""
class BacklogIntegrationTest(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.the_host = "http://localhost:8000"
def tearDown(self):
self.driver.close()
def test_start_page(self):
#User navigates to the start page
self.driver.get(self.the_host + "/")
#He mentions the start page content as it has the class ta-start-page-jumbo
self.assertTrue(self.driver.find_element_by_class_name('ta-start-page-jumbo'))
def test_meta_pages(self):
#User navigates to the imprint page
self.driver.get(self.the_host + "/imprint")
#He sees the imprint page
self.assertTrue(self.driver.find_element_by_class_name('ta-imprint'))
#He goes to the legal page
self.driver.get(self.the_host + "/legal")
#He sees the legal page
self.assertTrue(self.driver.find_element_by_class_name('ta-legal'))
def test_login_and_backlog_mgmt(self):
#User navigates to login to get the login mask
self.driver.get(self.the_host + "/login")
#User sees the login form
self.assertTrue(self.driver.find_element_by_class_name("ta-login-submit"))
self.assertTrue(self.driver.find_element_by_class_name("ta-login-form"))
#User sees the title of the page
self.assertTrue("FRNKN" in self.driver.title)
#User fills out form in order to login
username = self.driver.find_element_by_id("id_username")
password = self.driver.find_element_by_id("id_password")
username.send_keys("cabedn")
password.send_keys("HelloWorld12")
self.driver.find_element_by_class_name("ta-login-submit").click()
#The user gets redirected to /backlogs and sees the page title
self.assertTrue("FRNKN" in self.driver.title)
#The user sees a list with backlogs
self.assertTrue(self.driver.find_element_by_class_name('ta-backlog-projects'))
#He decides to use the first backlog and clicks on the button to navigate into the backlog detail view
self.driver.find_element_by_class_name("NOT DEFINED") #Test implementation has to be finished
if __name__ == '__main__':
unittest.main()