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
Patrick James Ong
thegoodplace
Commits
644c25e8
Commit
644c25e8
authored
Mar 18, 2020
by
Patrick James Ong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added .text to find element
parent
0a3ef6fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
functional_tests.py
thegoodplace/functional_tests.py
+18
-18
No files found.
thegoodplace/functional_tests.py
View file @
644c25e8
...
@@ -15,25 +15,25 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -15,25 +15,25 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_start_and_display_ingredients_list
(
self
):
def
test_can_start_and_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
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
ingredients_list
=
self
.
browser
.
find_element_by_ID
(
'ingredients-list'
)
#
ingredients_list = self.browser.find_element_by_ID('ingredients-list')
self
.
assertEqual
(
'ul'
,
ingredients_list
.
tag_name
)
#
self.assertEqual('ul', ingredients_list.tag_name)
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
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_update_ingredient
(
self
):
def
test_can_update_ingredient
(
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
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_create_new_ingredient
(
self
):
def
test_can_create_new_ingredient
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/ingredients/new'
)
self
.
browser
.
get
(
'http://localhost:8000/ingredients/new'
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_quantity').text)
# self.assertIn('', self.browser.find_element_by_ID('new_ingredient_quantity').text)
...
@@ -42,25 +42,25 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -42,25 +42,25 @@ class NewVisitorTest(unittest.TestCase):
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
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
recipes_list
=
self
.
browser
.
find_element_by_ID
(
'recipes-list'
)
#
recipes_list = self.browser.find_element_by_ID('recipes-list')
self
.
assertEqual
(
'ul'
,
recipes_list
.
tag_name
)
#
self.assertEqual('ul', recipes_list.tag_name)
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
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_update_recipe
(
self
):
def
test_can_update_recipe
(
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
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_create_new_recipe
(
self
):
def
test_can_create_new_recipe
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/recipes/new'
)
self
.
browser
.
get
(
'http://localhost:8000/recipes/new'
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_ingredient').text)
# self.assertIn('', self.browser.find_element_by_ID('new_recipe_ingredient').text)
...
@@ -70,25 +70,25 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -70,25 +70,25 @@ class NewVisitorTest(unittest.TestCase):
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
.
assertIn
(
'Orders - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
orders_list
=
self
.
browser
.
find_element_by_ID
(
'orders-list'
)
#
orders_list = self.browser.find_element_by_ID('orders-list')
self
.
assertEqual
(
'ul'
,
orders_list
.
tag_name
)
#
self.assertEqual('ul', orders_list.tag_name)
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
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_update_order
(
self
):
def
test_can_update_order
(
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
.
assertIn
(
'Orders - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Orders - Update'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
def
test_can_create_new_order
(
self
):
def
test_can_create_new_order
(
self
):
self
.
browser
.
get
(
'http://localhost:8000/orders/new'
)
self
.
browser
.
get
(
'http://localhost:8000/orders/new'
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
))
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
# self.assertIn('', self.browser.find_element_by_ID('new_customer_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_customer_name').text)
# self.assertIn('', self.browser.find_element_by_ID('new_size').text)
# self.assertIn('', self.browser.find_element_by_ID('new_size').text)
...
...
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