Fakultas Ilmu Komputer UI

Commit 994f17dc authored by Rahmania Astrid Mochtar's avatar Rahmania Astrid Mochtar
Browse files

created FT for checking list of todo lists on display

parent 7f3f78e8
Pipeline #28214 failed with stages
in 32 minutes and 12 seconds
......@@ -33,6 +33,8 @@ class NewVisitorTest(FunctionalTest):
submitbutton.click()
time.sleep(1)
page_text = self.browser.find_element_by_tag_name('body').text
self.assertIn('1. Groceries', page_text)
# 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)
......@@ -55,6 +57,9 @@ class NewVisitorTest(FunctionalTest):
inputbox.send_keys('Buy peacock feathers')
submitbutton.click()
page_text = self.browser.find_element_by_tag_name('body').text
self.assertIn('1. Groceries', page_text)
# She notices that her list has a unique URL
time.sleep(1)
edith_list_url = self.browser.current_url
......@@ -80,13 +85,15 @@ class NewVisitorTest(FunctionalTest):
self.assertNotIn('Buy peacock feathers', page_text)
self.assertNotIn('make a fly', page_text)
self.assertIn('1. Groceries', page_text)
# Francis starts a new list by entering a new item. He
# is less interesting than Edith...
listinputbox = self.browser.find_element_by_id('id_new_list')
inputbox = self.browser.find_element_by_id('id_new_item')
submitbutton = self.browser.find_element_by_id('id_submit')
listinputbox.send_keys('Groceries')
listinputbox.send_keys('Other Groceries')
inputbox.send_keys('Buy milk')
submitbutton.click()
......@@ -101,4 +108,6 @@ class NewVisitorTest(FunctionalTest):
self.assertNotIn('Buy peacock feathers', page_text)
self.assertIn('Buy milk', page_text)
self.assertIn('1. Groceries', page_text)
self.assertIn('2. Other Groceries', page_text)
# Satisfied, they both go back to slee
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment