Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Midterm_Project
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
Ayn Collado
Midterm_Project
Commits
112a9aae
Commit
112a9aae
authored
Mar 18, 2020
by
Ayn Collado
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split main test into 12 different test methods
parent
999780e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
tests.py
thegoodplace/froyo/tests.py
+12
-13
No files found.
thegoodplace/froyo/tests.py
View file @
112a9aae
...
...
@@ -9,85 +9,84 @@ class NewVisitorTest(unittest.TestCase):
def
tearDown
(
self
):
self
.
browser
.
quit
()
def
test_every_test_is_in_here
(
self
):
#test_display_ingredients_list
def
test_display_ingredients_list
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/froyo/ingredients_list/'
)
header_value
=
'Ingredients - List'
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Ingredients - Detail'
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Ingredients - Update'
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Ingredients - Create'
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Recipes - List'
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Recipes - Detail'
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Recipes - Update'
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Recipes - Create'
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Orders - List'
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Orders - Detail'
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Orders - Update'
self
.
assertIn
(
'Orders - Update'
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
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/'
)
header_value
=
'Orders - Create'
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
...
...
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