Commit 68a6881f authored by Patrick James Ong's avatar Patrick James Ong

Added recipes in functional tests

parent 3fe16ba8
......@@ -34,6 +34,29 @@ class NewVisitorTest(unittest.TestCase):
self.assertIn('', self.browser.find_element_by_ID('new_ingredient_name').text)
self.assertIn('', self.browser.find_element_by_ID('new_ingredient_quantity').text)
# RECIPES
def test_can_display_recipes_list(self):
self.browser.get('http://localhost:8000/recipes/list')
self.assertIn('Recipes - List', self.browser.title)
recipes_list = self.browser.find_element_by_ID('recipes-list')
self.assertEqual('ul', recipes_list.tag_name)
def test_can_display_recipes_detail(self):
self.browser.get('http://localhost:8000/recipes/detail')
self.assertIn('Recipes - Detail', self.browser.title)
def test_can_update_recipe(self):
self.browser.get('http://localhost:8000/recipes/update')
self.assertIn('Recipes - Update', self.browser.title)
def test_can_create_new_recipe(self):
self.browser.get('http://localhost:8000/recipes/new')
self.assertIn('Recipes - Create', self.browser.title)
self.assertIn('', self.browser.find_element_by_ID('new_recipe_name').text)
self.assertIn('', self.browser.find_element_by_ID('new_recipe_quantity').text)
if __name__ == '__main__':
unittest.main(warnings='ignore')
\ No newline at end of file
Markdown is supported
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