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
cac47598
Commit
cac47598
authored
Jul 25, 2014
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use clear and send_keys instead of action chains in page object methods
parent
f6b278e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
common/test/acceptance/pages/studio/component_editor.py
+6
-7
No files found.
common/test/acceptance/pages/studio/component_editor.py
View file @
cac47598
from
bok_choy.page_object
import
PageObject
from
bok_choy.page_object
import
PageObject
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.common.action_chains
import
ActionChains
from
utils
import
click_css
from
utils
import
click_css
from
selenium.webdriver.support.ui
import
Select
from
selenium.webdriver.support.ui
import
Select
...
@@ -57,12 +56,12 @@ class ComponentEditorView(PageObject):
...
@@ -57,12 +56,12 @@ class ComponentEditorView(PageObject):
Sets the text field with given label (display name) to the specified value, and presses Save.
Sets the text field with given label (display name) to the specified value, and presses Save.
"""
"""
elem
=
self
.
get_setting_element
(
label
)
elem
=
self
.
get_setting_element
(
label
)
# Click in the field, delete the value there.
action
=
ActionChains
(
self
.
browser
)
.
click
(
elem
)
# Clear the current value, set the new one, then
for
_x
in
range
(
0
,
len
(
elem
.
get_attribute
(
'value'
))):
# Tab to move to the next field (so change event is triggered).
action
=
action
.
send_keys
(
Keys
.
BACKSPACE
)
elem
.
clear
(
)
# Send the new text, then Tab to move to the next field (so change event is triggered).
elem
.
send_keys
(
value
)
action
.
send_keys
(
value
)
.
send_keys
(
Keys
.
TAB
)
.
perform
(
)
elem
.
send_keys
(
Keys
.
TAB
)
self
.
save
()
self
.
save
()
def
set_select_value_and_save
(
self
,
label
,
value
):
def
set_select_value_and_save
(
self
,
label
,
value
):
...
...
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