Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Maroket_Project1
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
Moira
Maroket_Project1
Commits
c8510fc6
Commit
c8510fc6
authored
Mar 21, 2020
by
Moira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added functional tests
parent
31def305
Pipeline
#1147
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
174 additions
and
0 deletions
+174
-0
functional_tests.py
functional_tests.py
+174
-0
No files found.
functional_tests.py
0 → 100644
View file @
c8510fc6
from
selenium
import
webdriver
import
unittest
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
def
test_can_display_froyo_shop_home
(
self
):
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_ingredients_list
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
ingredients_list
=
self
.
browser
.
find_element_by_id
(
'ingredients_list'
)
ingredients_list
.
click
()
self
.
assertEqual
(
'http://localhost:8000/ingredients/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_list_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_ingredients_detail
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
ingredients_detail
=
self
.
browser
.
find_element_by_id
(
'ingredients_detail'
)
ingredients_detail
.
click
()
self
.
assertEqual
(
'http://localhost:8000/ingredients/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_detail_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_ingredients_update_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
ingredients_update_form
=
self
.
browser
.
find_element_by_id
(
'ingredients_update_form'
)
ingredients_update_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/ingredients/update_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_update_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_ingredients_create_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
ingredients_create_form
=
self
.
browser
.
find_element_by_id
(
'ingredients_create_form'
)
ingredients_create_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/ingredients/create_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"ingredients_create_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_recipes_list
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
recipes_list
=
self
.
browser
.
find_element_by_id
(
'recipe_list'
)
recipes_list
.
click
()
self
.
assertEqual
(
'http://localhost:8000/recipes/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_list_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_recipes_detail
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
recipes_detail
=
self
.
browser
.
find_element_by_id
(
'recipe_detail'
)
recipes_detail
.
click
()
self
.
assertEqual
(
'http://localhost:8000/recipes/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_detail_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_recipes_update_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
recipes_update_form
=
self
.
browser
.
find_element_by_id
(
'recipe_update_form'
)
recipes_update_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/recipes/update_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_update_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_recipes_create_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
recipes_create_form
=
self
.
browser
.
find_element_by_id
(
'recipe_create_form'
)
recipes_create_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/recipes/create_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"recipes_create_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_orders_list
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
orders_list
=
self
.
browser
.
find_element_by_id
(
'orders_list'
)
orders_list
.
click
()
self
.
assertEqual
(
'http://localhost:8000/orders/list'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_list_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_orders_detail
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
orders_detail
=
self
.
browser
.
find_element_by_id
(
'orders_detail'
)
orders_detail
.
click
()
self
.
assertEqual
(
'http://localhost:8000/orders/detail'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_detail_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_orders_update_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
orders_update_form
=
self
.
browser
.
find_element_by_id
(
'orders_update_form'
)
orders_update_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/orders/update_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_create_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
def
test_froyo_display_orders_create_form
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/home'
)
orders_create_form
=
self
.
browser
.
find_element_by_id
(
'orders_create_form'
)
orders_create_form
.
click
()
self
.
assertEqual
(
'http://localhost:8000/orders/create_form'
,
self
.
browser
.
current_url
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"orders_create_form_header"
))
home
=
self
.
browser
.
find_element_by_id
(
'home'
)
home
.
click
()
self
.
assertEqual
(
'http://localhost:8000/home'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'The Good Place Froyo Shop'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_home"
))
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
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