Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1406568923-practice
Commits
0ea0536b
Commit
0ea0536b
authored
Oct 03, 2019
by
emil farisan
Browse files
make funtional_tests an app, use LiveServer
parent
6acea56d
Changes
2
Hide whitespace changes
Inline
Side-by-side
functional_tests/__init__.py
0 → 100644
View file @
0ea0536b
functional_tests.py
→
functional_tests
/tests
.py
View file @
0ea0536b
from
django.test
import
LiveServerTestCase
from
selenium
import
webdriver
from
selenium.webdriver.common.keys
import
Keys
import
unittest
import
time
class
NewVisitorTest
(
unittest
.
TestCase
):
class
NewVisitorTest
(
LiveServer
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
self
.
browser
.
implicitly_wait
(
3
)
...
...
@@ -20,7 +20,7 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_start_a_list_and_retrieve_it_later
(
self
):
# Edith has heard about a cool new online to-do app. She goes
# to check out its homepage
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
self
.
live_server_url
)
# She notices the page title and header mention to-do lists
self
.
assertIn
(
'To-Do'
,
self
.
browser
.
title
)
...
...
@@ -64,7 +64,3 @@ class NewVisitorTest(unittest.TestCase):
# She visits that URL - her to-do list is still there.
# Satisfied, she goes back to sleep
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
Write
Preview
Supports
Markdown
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