Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace
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
Bienvenido Villabroza
thegoodplace
Commits
a3f249fe
Commit
a3f249fe
authored
Mar 18, 2020
by
thisLexic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created tests for all froyo pages
parent
9d9734eb
Pipeline
#1094
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
3 deletions
+68
-3
tests.py
thegoodplace/froyo/tests.py
+68
-3
No files found.
thegoodplace/froyo/tests.py
View file @
a3f249fe
...
@@ -10,12 +10,77 @@ class FroyoPagesTest(unittest.TestCase):
...
@@ -10,12 +10,77 @@ class FroyoPagesTest(unittest.TestCase):
def
tearDown
(
self
):
def
tearDown
(
self
):
self
.
browser
.
quit
()
self
.
browser
.
quit
()
def
test_can_display_
ingredients_list
(
self
):
def
test_can_display_
froyo_pages
(
self
):
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/ingredients_list/'
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/ingredients_list/'
)
correct_value
=
'Ingredients - List'
correct_value
=
'Ingredients - List'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
def
test_can_display_all_froyo_pages
(
self
):
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/ingredients_detail/'
)
self
.
fail
(
'Finish the test!'
)
correct_value
=
'Ingredients - Detail'
\ No newline at end of file
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/ingredients_create_form/'
)
correct_value
=
'Ingredients - Create'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/ingredients_update_form/'
)
correct_value
=
'Ingredients - Update'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/orders_list/'
)
correct_value
=
'Orders - List'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/orders_detail/'
)
correct_value
=
'Orders - Detail'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/orders_create_form/'
)
correct_value
=
'Orders - Create'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/orders_update_form/'
)
correct_value
=
'Orders - Update'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/recipes_list/'
)
correct_value
=
'Recipes - List'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/recipes_detail/'
)
correct_value
=
'Recipes - Detail'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/recipes_create_form/'
)
correct_value
=
'Recipes - Create'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
browser
.
get
(
'http://127.0.0.1:8000/froyo/recipes_update_form/'
)
correct_value
=
'Recipes - Update'
self
.
assertIn
(
correct_value
,
self
.
browser
.
title
)
detail
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
self
.
assertEqual
(
detail
.
get_attribute
(
'innerHTML'
),
correct_value
)
self
.
fail
(
'Test Finished!'
)
\ No newline at end of file
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