Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI40-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
Andrea Tsai
CSCI40-Midterm-Project
Commits
8c6ee144
Commit
8c6ee144
authored
Mar 25, 2020
by
littleredpanda14
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented functional test
parent
d4cf4c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
functional_test.py
functional_test.py
+16
-15
No files found.
functional_test.py
View file @
8c6ee144
...
@@ -7,9 +7,11 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -7,9 +7,11 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
def
tearDown
(
self
):
self
.
browser
.
quit
()
self
.
browser
.
quit
()
def
test_can_summon_janet_with_all_froyo_info
(
self
):
def
test_can_summon_janet_with_all_froyo_info
(
self
):
# Eleanor wants to find out more about the Froyo Shop
# Eleanor wants to find out more about the Froyo Shop
# She calls on The Good Place's omniscient database Janet to find out more.
# She calls on The Good Place's omniscient database Janet to find out more.
...
@@ -19,7 +21,6 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -19,7 +21,6 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
# 'Hi. My name is Janet.'
# 'Hi. My name is Janet.'
self
.
assertIn
(
'Hi. My name is Janet.'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Hi. My name is Janet.'
,
self
.
browser
.
title
)
#Janet gives Eleanor all the information she has on the Froyo shop which includes:
#Janet gives Eleanor all the information she has on the Froyo shop which includes:
#Ingredients, Recipes and Orders
#Ingredients, Recipes and Orders
froyo
=
self
.
browser
.
find_element_by_id
(
'janet'
)
froyo
=
self
.
browser
.
find_element_by_id
(
'janet'
)
...
@@ -40,7 +41,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -40,7 +41,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Ingredients - List'
Janet tells her.
#
"It is called the 'Ingredients - List'"
Janet tells her.
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
...
@@ -55,11 +56,11 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -55,11 +56,11 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Ingredients - Detail'
Janet tells her.
#
"It is called the 'Ingredients - Detail'"
Janet tells her.
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
# Eleanor wants to update the ingredient
information
because she can. So she asks Janet
# Eleanor wants to update the ingredient
details
because she can. So she asks Janet
# to give her an ingredients update form.
# to give her an ingredients update form.
ingredients_update_form
=
self
.
browser
.
find_element_by_id
(
'ingredients_update'
)
ingredients_update_form
=
self
.
browser
.
find_element_by_id
(
'ingredients_update'
)
ingredients_update_form
.
click
()
ingredients_update_form
.
click
()
...
@@ -70,7 +71,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -70,7 +71,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Ingredients - Update'
Janet tells her.
#
"It is called the 'Ingredients - Update'"
Janet tells her.
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
title
)
...
@@ -85,12 +86,12 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -85,12 +86,12 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Ingredients - Create'
Janet tells her.
#
"It is called the 'Ingredients - Create'"
Janet tells her.
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
#Eleanor decides that she now wants to look at the recipes
#
Eleanor decides that she now wants to look at the recipes
#Janet shows her the list of recipes.
#
Janet shows her the list of recipes.
recipes_list
=
self
.
browser
.
find_element_by_id
(
'recipes_list'
)
recipes_list
=
self
.
browser
.
find_element_by_id
(
'recipes_list'
)
recipes_list
.
click
()
recipes_list
.
click
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
@@ -100,7 +101,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -100,7 +101,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Recipes - List'
Janet tells her.
#
"It is called the 'Recipes - List'"
Janet tells her.
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
...
@@ -114,7 +115,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -114,7 +115,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Recipes - Detail'
Janet tells her.
#
"It is called the 'Recipes - Detail'"
Janet tells her.
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
...
@@ -129,7 +130,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -129,7 +130,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Recipes - Update'
Janet tells her.
#
"It is called the 'Recipes - Update'"
Janet tells her.
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
title
)
...
@@ -144,7 +145,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -144,7 +145,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Recipes - Create'
Janet tells her.
#
"It is called the 'Recipes - Create'"
Janet tells her.
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
...
@@ -159,7 +160,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -159,7 +160,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Orders - List'
Janet tells her.
#
"It is called the 'Orders - List'"
Janet tells her.
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
...
@@ -174,7 +175,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -174,7 +175,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
#
It is called the 'Orders - Detail'
Janet tells her.
#
"It is called the 'Orders - Detail'"
Janet tells her.
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
...
@@ -220,7 +221,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
...
@@ -220,7 +221,7 @@ class WelcomeToTheGoodPlaceTest(unittest.TestCase):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
assertEqual
(
self
.
assertEqual
(
'http://localhost:8000/froyo
/ingredients
'
,
'http://localhost:8000/froyo'
,
self
.
browser
.
getCurrentUrl
()
self
.
browser
.
getCurrentUrl
()
)
)
...
...
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