Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
91c1fa02
Commit
91c1fa02
authored
Aug 04, 2014
by
Ben McMorran
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore set_input_value
parent
206e4a95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
common/test/acceptance/pages/studio/overview.py
+2
-2
common/test/acceptance/pages/studio/utils.py
+15
-8
No files found.
common/test/acceptance/pages/studio/overview.py
View file @
91c1fa02
...
...
@@ -11,7 +11,7 @@ from selenium.webdriver.common.keys import Keys
from
.course_page
import
CoursePage
from
.container
import
ContainerPage
from
.utils
import
set_input_value_and_save
,
click_css
,
confirm_prompt
from
.utils
import
set_input_value_and_save
,
set_input_value
,
click_css
,
confirm_prompt
class
CourseOutlineItem
(
object
):
...
...
@@ -82,7 +82,7 @@ class CourseOutlineItem(object):
"""
Enters new_name as the item's display name.
"""
set_input_value
_and_save
(
self
,
self
.
_bounded_selector
(
self
.
NAME_INPUT_SELECTOR
),
new_name
)
set_input_value
(
self
,
self
.
_bounded_selector
(
self
.
NAME_INPUT_SELECTOR
),
new_name
)
def
change_name
(
self
,
new_name
):
"""
...
...
common/test/acceptance/pages/studio/utils.py
View file @
91c1fa02
...
...
@@ -127,15 +127,22 @@ def confirm_prompt(page, cancel=False):
click_css
(
page
,
confirmation_button_css
,
require_notification
=
(
not
cancel
))
def
set_input_value
_and_save
(
page
,
css
,
value
):
def
set_input_value
(
page
,
css
,
value
):
"""
Sets the text field with
given label (display name) to the specified value, and presses Sav
e.
Sets the text field with
the given label (display name) to the specified valu
e.
"""
input_element
=
page
.
q
(
css
=
css
)
.
results
[
0
]
# Click in the input to give it the focus
action
=
ActionChains
(
page
.
browser
)
.
click
(
input_element
)
# Delete all of the characters that are currently there
for
_x
in
range
(
0
,
len
(
input_element
.
get_attribute
(
'value'
))):
action
=
action
.
send_keys
(
Keys
.
BACKSPACE
)
# Send the new text, then hit the enter key so that the change event is triggered).
action
.
send_keys
(
value
)
.
send_keys
(
Keys
.
ENTER
)
.
perform
()
input_element
.
click
()
# Select all, then input the value
input_element
.
send_keys
(
Keys
.
CONTROL
+
'a'
)
input_element
.
send_keys
(
value
)
# Return the input_element for chaining
return
input_element
def
set_input_value_and_save
(
page
,
css
,
value
):
"""
Sets the text field with given label (display name) to the specified value, and presses Save.
"""
set_input_value
(
page
,
css
,
value
)
.
send_keys
(
Keys
.
ENTER
)
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