functional test will now find if Ingredients in the home page is linked to the Ingredients list

parent 6aeee73a
from selenium import webdriver from selenium import webdriver
import unittest import unittest
import time
class NewVisitorTest(unittest.TestCase): class NewVisitorTest(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -14,7 +15,17 @@ class NewVisitorTest(unittest.TestCase): ...@@ -14,7 +15,17 @@ class NewVisitorTest(unittest.TestCase):
# Check if the title of the homepage is Let's Make Froyo # Check if the title of the homepage is Let's Make Froyo
self.assertIn('Lets Make Froyo', self.browser.title) self.assertIn('Lets Make Froyo', self.browser.title)
# Check if Ingredients is available and select it to see the list of the Ingredients
Ingredients = self.browser.find_element_by_id('Ingredients')
self.assertEqual(Ingredients.get_attribute('innerHTML'), 'Ingredients')
Ingredients.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000/froyo/ingredients_list",
self.browser.getCurrentUr()
)
self.fail('Finish the test!') self.fail('Finish the test!')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(warnings='ignore') 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