Commit 644c25e8 authored by Patrick James Ong's avatar Patrick James Ong

Added .text to find element

parent 0a3ef6fa
...@@ -15,25 +15,25 @@ class NewVisitorTest(unittest.TestCase): ...@@ -15,25 +15,25 @@ class NewVisitorTest(unittest.TestCase):
def test_can_start_and_display_ingredients_list(self): def test_can_start_and_display_ingredients_list(self):
self.browser.get('http://localhost:8000/ingredients/list') self.browser.get('http://localhost:8000/ingredients/list')
self.assertIn('Ingredients - List', self.browser.title) self.assertIn('Ingredients - List', self.browser.title)
self.assertIn('Ingredients - List', self.browser.find_element_by_tag_name('h1')) self.assertIn('Ingredients - List', self.browser.find_element_by_tag_name('h1').text)
ingredients_list = self.browser.find_element_by_ID('ingredients-list') # ingredients_list = self.browser.find_element_by_ID('ingredients-list')
self.assertEqual('ul', ingredients_list.tag_name) # self.assertEqual('ul', ingredients_list.tag_name)
def test_can_display_ingredients_detail(self): def test_can_display_ingredients_detail(self):
self.browser.get('http://localhost:8000/ingredients/detail') self.browser.get('http://localhost:8000/ingredients/detail')
self.assertIn('Ingredients - Detail', self.browser.title) self.assertIn('Ingredients - Detail', self.browser.title)
self.assertIn('Ingredients - Detail', self.browser.find_element_by_tag_name('h1')) self.assertIn('Ingredients - Detail', self.browser.find_element_by_tag_name('h1').text)
def test_can_update_ingredient(self): def test_can_update_ingredient(self):
self.browser.get('http://localhost:8000/ingredients/update') self.browser.get('http://localhost:8000/ingredients/update')
self.assertIn('Ingredients - Update', self.browser.title) self.assertIn('Ingredients - Update', self.browser.title)
self.assertIn('Ingredients - Update', self.browser.find_element_by_tag_name('h1')) self.assertIn('Ingredients - Update', self.browser.find_element_by_tag_name('h1').text)
def test_can_create_new_ingredient(self): def test_can_create_new_ingredient(self):
self.browser.get('http://localhost:8000/ingredients/new') self.browser.get('http://localhost:8000/ingredients/new')
self.assertIn('Ingredients - Create', self.browser.title) self.assertIn('Ingredients - Create', self.browser.title)
self.assertIn('Ingredients - Create', self.browser.find_element_by_tag_name('h1')) self.assertIn('Ingredients - Create', self.browser.find_element_by_tag_name('h1').text)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_name').text) # self.assertIn('', self.browser.find_element_by_ID('new_ingredient_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_quantity').text) # self.assertIn('', self.browser.find_element_by_ID('new_ingredient_quantity').text)
...@@ -42,25 +42,25 @@ class NewVisitorTest(unittest.TestCase): ...@@ -42,25 +42,25 @@ class NewVisitorTest(unittest.TestCase):
def test_can_display_recipes_list(self): def test_can_display_recipes_list(self):
self.browser.get('http://localhost:8000/recipes/list') self.browser.get('http://localhost:8000/recipes/list')
self.assertIn('Recipes - List', self.browser.title) self.assertIn('Recipes - List', self.browser.title)
self.assertIn('Recipes - List', self.browser.find_element_by_tag_name('h1')) self.assertIn('Recipes - List', self.browser.find_element_by_tag_name('h1').text)
recipes_list = self.browser.find_element_by_ID('recipes-list') # recipes_list = self.browser.find_element_by_ID('recipes-list')
self.assertEqual('ul', recipes_list.tag_name) # self.assertEqual('ul', recipes_list.tag_name)
def test_can_display_recipes_detail(self): def test_can_display_recipes_detail(self):
self.browser.get('http://localhost:8000/recipes/detail') self.browser.get('http://localhost:8000/recipes/detail')
self.assertIn('Recipes - Detail', self.browser.title) self.assertIn('Recipes - Detail', self.browser.title)
self.assertIn('Recipes - Detail', self.browser.find_element_by_tag_name('h1')) self.assertIn('Recipes - Detail', self.browser.find_element_by_tag_name('h1').text)
def test_can_update_recipe(self): def test_can_update_recipe(self):
self.browser.get('http://localhost:8000/recipes/update') self.browser.get('http://localhost:8000/recipes/update')
self.assertIn('Recipes - Update', self.browser.title) self.assertIn('Recipes - Update', self.browser.title)
self.assertIn('Recipes - Update', self.browser.find_element_by_tag_name('h1')) self.assertIn('Recipes - Update', self.browser.find_element_by_tag_name('h1').text)
def test_can_create_new_recipe(self): def test_can_create_new_recipe(self):
self.browser.get('http://localhost:8000/recipes/new') self.browser.get('http://localhost:8000/recipes/new')
self.assertIn('Recipes - Create', self.browser.title) self.assertIn('Recipes - Create', self.browser.title)
self.assertIn('Recipes - Create', self.browser.find_element_by_tag_name('h1')) self.assertIn('Recipes - Create', self.browser.find_element_by_tag_name('h1').text)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_name').text) # self.assertIn('', self.browser.find_element_by_ID('new_recipe_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_ingredient').text) # self.assertIn('', self.browser.find_element_by_ID('new_recipe_ingredient').text)
...@@ -70,25 +70,25 @@ class NewVisitorTest(unittest.TestCase): ...@@ -70,25 +70,25 @@ class NewVisitorTest(unittest.TestCase):
def test_can_display_orders_list(self): def test_can_display_orders_list(self):
self.browser.get('http://localhost:8000/orders/list') self.browser.get('http://localhost:8000/orders/list')
self.assertIn('Orders - List', self.browser.title) self.assertIn('Orders - List', self.browser.title)
self.assertIn('Orders - List', self.browser.find_element_by_tag_name('h1')) self.assertIn('Orders - List', self.browser.find_element_by_tag_name('h1').text)
orders_list = self.browser.find_element_by_ID('orders-list') # orders_list = self.browser.find_element_by_ID('orders-list')
self.assertEqual('ul', orders_list.tag_name) # self.assertEqual('ul', orders_list.tag_name)
def test_can_display_orders_detail(self): def test_can_display_orders_detail(self):
self.browser.get('http://localhost:8000/orders/detail') self.browser.get('http://localhost:8000/orders/detail')
self.assertIn('Orders - Detail', self.browser.title) self.assertIn('Orders - Detail', self.browser.title)
self.assertIn('Orders - Detail', self.browser.find_element_by_tag_name('h1')) self.assertIn('Orders - Detail', self.browser.find_element_by_tag_name('h1').text)
def test_can_update_order(self): def test_can_update_order(self):
self.browser.get('http://localhost:8000/orders/update') self.browser.get('http://localhost:8000/orders/update')
self.assertIn('Orders - Update', self.browser.title) self.assertIn('Orders - Update', self.browser.title)
self.assertIn('Orders - Update', self.browser.find_element_by_tag_name('h1')) self.assertIn('Orders - Update', self.browser.find_element_by_tag_name('h1').text)
def test_can_create_new_order(self): def test_can_create_new_order(self):
self.browser.get('http://localhost:8000/orders/new') self.browser.get('http://localhost:8000/orders/new')
self.assertIn('Orders - Create', self.browser.title) self.assertIn('Orders - Create', self.browser.title)
self.assertIn('Orders - Create', self.browser.find_element_by_tag_name('h1')) self.assertIn('Orders - Create', self.browser.find_element_by_tag_name('h1').text)
# self.assertIn('', self.browser.find_element_by_ID('new_customer_name').text) # self.assertIn('', self.browser.find_element_by_ID('new_customer_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_size').text) # self.assertIn('', self.browser.find_element_by_ID('new_size').text)
......
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