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
1606823475-practice
Commits
4dfa0ba5
Commit
4dfa0ba5
authored
Dec 21, 2019
by
Muhammad Ilham Peruzzi
Browse files
[RED] add functional test to delete todo feature
parent
4fde78e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
functional_tests/test_delete_todo.py
0 → 100644
View file @
4dfa0ba5
from
selenium
import
webdriver
from
selenium.common.exceptions
import
WebDriverException
from
selenium.webdriver.chrome.options
import
Options
from
selenium.webdriver.common.keys
import
Keys
import
time
import
unittest
import
environ
from
django.contrib.staticfiles.testing
import
StaticLiveServerTestCase
from
unittest
import
skip
from
.base
import
FunctionalTest
class
DeleteTodoTest
(
FunctionalTest
):
def
test_can_delete
(
self
):
self
.
browser
.
get
(
self
.
live_server_url
)
inputbox
=
self
.
browser
.
find_element_by_id
(
'id_new_item'
)
self
.
assertEqual
(
inputbox
.
get_attribute
(
'placeholder'
),
'Enter a to-do item'
)
inputbox
.
send_keys
(
'Buy peacock feathers'
)
inputbox
.
send_keys
(
Keys
.
ENTER
)
button
=
self
.
browser
.
find_elements_by_class_name
(
'to-do-list-delete-button'
)
button
[
0
].
click
()
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