Commit b7faf601 authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Fixed a logic error in functional_test.py

parent ee736cef
...@@ -62,15 +62,6 @@ class NewVisitorTest(unittest.TestCase): ...@@ -62,15 +62,6 @@ class NewVisitorTest(unittest.TestCase):
"Ingredients - Detail" "Ingredients - Detail"
) )
#Find and click back button to igredients list
back_button_to_ingredients_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_ingredients_list_from_detail.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/ingredients-list",
self.browser.current_url
)
#Find and click button to ingredients update #Find and click button to ingredients update
button_to_ingredients_update = self.browser.find_element_by_id("button_to_ingredients_update") button_to_ingredients_update = self.browser.find_element_by_id("button_to_ingredients_update")
button_to_ingredients_update.click() button_to_ingredients_update.click()
...@@ -88,9 +79,18 @@ class NewVisitorTest(unittest.TestCase): ...@@ -88,9 +79,18 @@ class NewVisitorTest(unittest.TestCase):
"Ingredients - Update" "Ingredients - Update"
) )
#Find and click back button to igredients detail
back_button_to_ingredients_detail_from_update = self.browser.find_element_by_id("back_button")
back_button_to_ingredients_detail_from_update.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/ingredients-detail",
self.browser.current_url
)
#Find and click back button to igredients list #Find and click back button to igredients list
back_button_to_ingredients_list_from_update = self.browser.find_element_by_id("back_button") back_button_to_ingredients_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_ingredients_list_from_update.click() back_button_to_ingredients_list_from_detail.click()
time.sleep(1) time.sleep(1)
self.assertEqual( self.assertEqual(
"http://localhost:8000/ingredients-list", "http://localhost:8000/ingredients-list",
...@@ -173,15 +173,6 @@ class NewVisitorTest(unittest.TestCase): ...@@ -173,15 +173,6 @@ class NewVisitorTest(unittest.TestCase):
"Recipes - Detail" "Recipes - Detail"
) )
#Find and click back button to recipes list
back_button_to_recipes_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_recipes_list_from_detail.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/recipes-list",
self.browser.current_url
)
#Find and click button to recipes update #Find and click button to recipes update
button_to_recipes_update = self.browser.find_element_by_id("button_to_recipes_update") button_to_recipes_update = self.browser.find_element_by_id("button_to_recipes_update")
button_to_recipes_update.click() button_to_recipes_update.click()
...@@ -199,9 +190,18 @@ class NewVisitorTest(unittest.TestCase): ...@@ -199,9 +190,18 @@ class NewVisitorTest(unittest.TestCase):
"Recipes - Update" "Recipes - Update"
) )
#Find and click back button to recipes detail
back_button_to_recipes_detail_from_update = self.browser.find_element_by_id("back_button")
back_button_to_recipes_detail_from_update.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/recipes-detail",
self.browser.current_url
)
#Find and click back button to recipes list #Find and click back button to recipes list
back_button_to_recipes_list_from_update = self.browser.find_element_by_id("back_button") back_button_to_recipes_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_recipes_list_from_update.click() back_button_to_recipes_list_from_detail.click()
time.sleep(1) time.sleep(1)
self.assertEqual( self.assertEqual(
"http://localhost:8000/recipes-list", "http://localhost:8000/recipes-list",
...@@ -284,15 +284,6 @@ class NewVisitorTest(unittest.TestCase): ...@@ -284,15 +284,6 @@ class NewVisitorTest(unittest.TestCase):
"Orders - Detail" "Orders - Detail"
) )
#Find and click back button to orders list
back_button_to_orders_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_orders_list_from_detail.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/orders-list",
self.browser.current_url
)
#Find and click button to orders update #Find and click button to orders update
button_to_orders_update = self.browser.find_element_by_id("button_to_orders_update") button_to_orders_update = self.browser.find_element_by_id("button_to_orders_update")
button_to_orders_update.click() button_to_orders_update.click()
...@@ -310,9 +301,18 @@ class NewVisitorTest(unittest.TestCase): ...@@ -310,9 +301,18 @@ class NewVisitorTest(unittest.TestCase):
"Orders - Update" "Orders - Update"
) )
#Find and click back button to orders detail
back_button_to_orders_detail_from_update = self.browser.find_element_by_id("back_button")
back_button_to_orders_detail_from_update.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/orders-list",
self.browser.current_url
)
#Find and click back button to orders list #Find and click back button to orders list
back_button_to_orders_list_from_update = self.browser.find_element_by_id("back_button") back_button_to_orders_list_from_detail = self.browser.find_element_by_id("back_button")
back_button_to_orders_list_from_update.click() back_button_to_orders_list_from_detail.click()
time.sleep(1) time.sleep(1)
self.assertEqual( self.assertEqual(
"http://localhost:8000/orders-list", "http://localhost:8000/orders-list",
......
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