Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Midterm-Project-186050-Columbres
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alysha Columbres
Midterm-Project-186050-Columbres
Commits
8e26f4d4
Commit
8e26f4d4
authored
Mar 17, 2020
by
Alysha Columbres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed my functional_tests.py file
parent
1d655da3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
51 deletions
+15
-51
midtermproject_functional_tests.py
midtermproject_functional_tests.py
+15
-51
No files found.
midtermproject_functional_tests.py
View file @
8e26f4d4
from
selenium
import
webdriver
import
unittest
import
unittest
from
selenium
import
webdriver
class
NewVisitorTest
(
unittest
.
TestCase
):
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -12,99 +13,62 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -12,99 +13,62 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_display_ingredients_list
(
self
):
def
test_can_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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/ingredients_list'
,
self
.
browser
.
current_url
)
'http://localhost:8000/ingredients_list'
,
self
.
browser
.
getCurrentUrl
()
)
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/ingredients_detail'
,
self
.
browser
.
current_url
)
'http://localhost:8000/ingredients_detail'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_ingredients_update
(
self
):
def
test_can_display_ingredients_update
(
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/ingredients_update'
,
self
.
browser
.
current_url
)
'http://localhost:8000/ingredients_update'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_ingredients_create
(
self
):
def
test_can_display_ingredients_create
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients_create'
)
self
.
browser
.
get
(
'http://localhost:8000/ingredients_create'
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/ingredients_create'
,
self
.
browser
.
current_url
)
'http://localhost:8000/ingredients_create'
,
self
.
browser
.
getCurrentUrl
()
)
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/recipes_list'
,
self
.
browser
.
current_url
)
'http://localhost:8000/recipes_list'
,
self
.
browser
.
getCurrentUrl
()
)
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/recipes_detail'
,
self
.
browser
.
current_url
)
'http://localhost:8000/recipes_detail'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_recipes_update
(
self
):
def
test_can_display_recipes_update
(
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/recipes_update'
,
self
.
browser
.
current_url
)
'http://localhost:8000/recipes_update'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_recipes_create
(
self
):
def
test_can_display_recipes_create
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes_create'
)
self
.
browser
.
get
(
'http://localhost:8000/recipes_create'
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
self
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/recipes_create'
,
self
.
browser
.
current_url
)
'http://localhost:8000/recipes_create'
,
self
.
browser
.
getCurrentUrl
()
)
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/orders_list'
,
self
.
browser
.
current_url
)
'http://localhost:8000/orders_list'
,
self
.
browser
.
getCurrentUrl
()
)
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/orders_detail'
,
self
.
browser
.
current_url
)
'http://localhost:8000/orders_detail'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_orders_update
(
self
):
def
test_can_display_orders_update
(
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
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/orders_update'
,
self
.
browser
.
current_url
)
'http://localhost:8000/orders_update'
,
self
.
browser
.
getCurrentUrl
()
)
def
test_can_display_orders_create
(
self
):
def
test_can_display_orders_create
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders_create'
)
self
.
browser
.
get
(
'http://localhost:8000/orders_create'
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
self
.
assertEqual
(
self
.
assertIn
(
'http://localhost:8000/orders_create'
,
self
.
browser
.
current_url
)
'http://localhost:8000/orders_create'
,
self
.
browser
.
getCurrentUrl
()
)
self
.
fail
(
'Finish the test!'
)
self
.
fail
(
'Finish the test!'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment