Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI 40 Project 1
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
Kevin Daniel Sibug
CSCI 40 Project 1
Commits
e2288c49
Commit
e2288c49
authored
Mar 21, 2020
by
Kevin Sibug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the functional test
parent
c59a96ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
geckodriver.exe
geckodriver.exe
+0
-0
lab1_functional_test.py
lab1_functional_test.py
+67
-0
No files found.
geckodriver.exe
0 → 100644
View file @
e2288c49
File added
lab1_functional_test.py
0 → 100644
View file @
e2288c49
from
selenium
import
webdriver
import
unittest
import
time
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
def
test_can_check_pages
(
self
):
# Eleanor is about to record her customer's individual order
# She goes to check out the homepage of the application.
self
.
browser
.
get
(
'http://localhost:8000'
)
# She notices the page title and header mention
# 'The Good Place FroYo Shop'
# self.assertIn('The Good Place FroYo Shop', self.browser.title)
# She checks if the possible actions directs her to the correct page
# She checks the ingredients pages
self
.
browser
.
get
(
'http://localhost:8000/ingredients/list/'
)
self
.
assertIn
(
'Ingredients - List'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/ingredients/detail/'
)
self
.
assertIn
(
'Ingredients - Detail'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/ingredients/update_form/'
)
self
.
assertIn
(
'Ingredients - Update'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/ingredients/create_form/'
)
self
.
assertIn
(
'Ingredients - Create'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
#She checks the Recipes pages
self
.
browser
.
get
(
'http://localhost:8000/recipes/list/'
)
self
.
assertIn
(
'Recipes - List'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/recipes/detail/'
)
self
.
assertIn
(
'Recipes - Detail'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/recipes/update_form/'
)
self
.
assertIn
(
'Recipes - Update'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/recipes/create_form/'
)
self
.
assertIn
(
'Recipes - Create'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
#She checks the Orders pages
self
.
browser
.
get
(
'http://localhost:8000/orders/list/'
)
self
.
assertIn
(
'Orders - List'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/orders/detail/'
)
self
.
assertIn
(
'Orders - Detail'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/orders/update_form/'
)
self
.
assertIn
(
'Orders - Update'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
self
.
browser
.
get
(
'http://localhost:8000/orders/create_form/'
)
self
.
assertIn
(
'Orders - Create'
,
self
.
browser
.
title
)
time
.
sleep
(
3
)
time
.
sleep
(
5
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
\ 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