Commit 112a9aae authored by Ayn Collado's avatar Ayn Collado

Split main test into 12 different test methods

parent 999780e7
...@@ -9,85 +9,84 @@ class NewVisitorTest(unittest.TestCase): ...@@ -9,85 +9,84 @@ class NewVisitorTest(unittest.TestCase):
def tearDown(self): def tearDown(self):
self.browser.quit() self.browser.quit()
def test_every_test_is_in_here(self): def test_display_ingredients_list(self):
#test_display_ingredients_list
self.browser.get('http://localhost:8000/froyo/ingredients_list/') self.browser.get('http://localhost:8000/froyo/ingredients_list/')
header_value = 'Ingredients - List' header_value = 'Ingredients - List'
self.assertIn('Ingredients - List', self.browser.title) self.assertIn('Ingredients - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_detail def test_display_ingredients_detail(self):
self.browser.get('http://localhost:8000/froyo/ingredients_detail/') self.browser.get('http://localhost:8000/froyo/ingredients_detail/')
header_value = 'Ingredients - Detail' header_value = 'Ingredients - Detail'
self.assertIn('Ingredients - Detail', self.browser.title) self.assertIn('Ingredients - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_update_form def test_display_ingredients_update_form(self):
self.browser.get('http://localhost:8000/froyo/ingredients_update_form/') self.browser.get('http://localhost:8000/froyo/ingredients_update_form/')
header_value = 'Ingredients - Update' header_value = 'Ingredients - Update'
self.assertIn('Ingredients - Update', self.browser.title) self.assertIn('Ingredients - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_ingredients_create_form def test_display_ingredients_create_form(self):
self.browser.get('http://localhost:8000/froyo/ingredients_create_form/') self.browser.get('http://localhost:8000/froyo/ingredients_create_form/')
header_value = 'Ingredients - Create' header_value = 'Ingredients - Create'
self.assertIn('Ingredients - Create', self.browser.title) self.assertIn('Ingredients - Create', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_list def test_display_recipes_list(self):
self.browser.get('http://localhost:8000/froyo/recipes_list/') self.browser.get('http://localhost:8000/froyo/recipes_list/')
header_value = 'Recipes - List' header_value = 'Recipes - List'
self.assertIn('Recipes - List', self.browser.title) self.assertIn('Recipes - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_detail def test_display_recipes_detail(self):
self.browser.get('http://localhost:8000/froyo/recipes_detail/') self.browser.get('http://localhost:8000/froyo/recipes_detail/')
header_value = 'Recipes - Detail' header_value = 'Recipes - Detail'
self.assertIn('Recipes - Detail', self.browser.title) self.assertIn('Recipes - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_update_form def test_display_recipes_update_form(self):
self.browser.get('http://localhost:8000/froyo/recipes_update_form/') self.browser.get('http://localhost:8000/froyo/recipes_update_form/')
header_value = 'Recipes - Update' header_value = 'Recipes - Update'
self.assertIn('Recipes - Update', self.browser.title) self.assertIn('Recipes - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_recipes_create_form def test_display_recipes_create_form(self):
self.browser.get('http://localhost:8000/froyo/recipes_create_form/') self.browser.get('http://localhost:8000/froyo/recipes_create_form/')
header_value = 'Recipes - Create' header_value = 'Recipes - Create'
self.assertIn('Recipes - Create', self.browser.title) self.assertIn('Recipes - Create', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_list def test_display_orders_list(self):
self.browser.get('http://localhost:8000/froyo/orders_list/') self.browser.get('http://localhost:8000/froyo/orders_list/')
header_value = 'Orders - List' header_value = 'Orders - List'
self.assertIn('Orders - List', self.browser.title) self.assertIn('Orders - List', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_detail def test_display_orders_detail(self):
self.browser.get('http://localhost:8000/froyo/orders_detail/') self.browser.get('http://localhost:8000/froyo/orders_detail/')
header_value = 'Orders - Detail' header_value = 'Orders - Detail'
self.assertIn('Orders - Detail', self.browser.title) self.assertIn('Orders - Detail', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_update_form def test_display_orders_update_form(self):
self.browser.get('http://localhost:8000/froyo/orders_update_form/') self.browser.get('http://localhost:8000/froyo/orders_update_form/')
header_value = 'Orders - Update' header_value = 'Orders - Update'
self.assertIn('Orders - Update', self.browser.title) self.assertIn('Orders - Update', self.browser.title)
detail = self.browser.find_element_by_tag_name('h1') detail = self.browser.find_element_by_tag_name('h1')
self.assertEqual(detail.get_attribute('innerHTML'), header_value) self.assertEqual(detail.get_attribute('innerHTML'), header_value)
#test_display_orders_list def test_display_orders_create(self):
self.browser.get('http://localhost:8000/froyo/orders_create_form/') self.browser.get('http://localhost:8000/froyo/orders_create_form/')
header_value = 'Orders - Create' header_value = 'Orders - Create'
self.assertIn('Orders - Create', self.browser.title) self.assertIn('Orders - Create', self.browser.title)
......
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