Commit e2288c49 authored by Kevin Sibug's avatar Kevin Sibug

Added the functional test

parent c59a96ca
File added
from selenium import webdriver
import unittest
import time
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_check_pages(self):
# Eleanor is about to record her customer's individual order
# She goes to check out the homepage of the application.
self.browser.get('http://localhost:8000')
# She notices the page title and header mention
# 'The Good Place FroYo Shop'
# self.assertIn('The Good Place FroYo Shop', self.browser.title)
# She checks if the possible actions directs her to the correct page
# She checks the ingredients pages
self.browser.get('http://localhost:8000/ingredients/list/')
self.assertIn('Ingredients - List',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/ingredients/detail/')
self.assertIn('Ingredients - Detail',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/ingredients/update_form/')
self.assertIn('Ingredients - Update',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/ingredients/create_form/')
self.assertIn('Ingredients - Create',self.browser.title)
time.sleep(3)
#She checks the Recipes pages
self.browser.get('http://localhost:8000/recipes/list/')
self.assertIn('Recipes - List',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/recipes/detail/')
self.assertIn('Recipes - Detail',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/recipes/update_form/')
self.assertIn('Recipes - Update',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/recipes/create_form/')
self.assertIn('Recipes - Create',self.browser.title)
time.sleep(3)
#She checks the Orders pages
self.browser.get('http://localhost:8000/orders/list/')
self.assertIn('Orders - List',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/orders/detail/')
self.assertIn('Orders - Detail',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/orders/update_form/')
self.assertIn('Orders - Update',self.browser.title)
time.sleep(3)
self.browser.get('http://localhost:8000/orders/create_form/')
self.assertIn('Orders - Create',self.browser.title)
time.sleep(3)
time.sleep(5)
self.fail('Finish the test!')
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