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
6207de94
Commit
6207de94
authored
Oct 16, 2015
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fixup] fix quality violations
parent
cfe21a70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
common/test/acceptance/tests/helpers.py
+7
-2
No files found.
common/test/acceptance/tests/helpers.py
View file @
6207de94
...
...
@@ -207,13 +207,16 @@ def select_option_by_text(select_browser_query, option_text):
from being raised while the DOM is still being rewritten
"""
def
select_option
(
query
,
value
):
""" Get the first select element that matches the query and select the desired value. """
try
:
select
=
Select
(
query
.
first
.
results
[
0
])
select
.
select_by_visible_text
(
value
)
return
True
except
StaleElementReferenceException
:
return
False
EmptyPromise
(
lambda
:
select_option
(
select_browser_query
,
option_text
),
'Selected option {}'
.
format
(
option_text
))
.
fulfill
()
msg
=
'Selected option {}'
.
format
(
option_text
)
EmptyPromise
(
lambda
:
select_option
(
select_browser_query
,
option_text
),
msg
)
.
fulfill
()
def
get_selected_option_text
(
select_browser_query
):
...
...
@@ -224,8 +227,9 @@ def get_selected_option_text(select_browser_query):
from being raised while the DOM is still being rewritten
"""
def
get_option
(
query
):
""" Get the first select element that matches the query and return its value. """
try
:
select
=
Select
(
select_browser_
query
.
first
.
results
[
0
])
select
=
Select
(
query
.
first
.
results
[
0
])
return
(
True
,
select
.
first_selected_option
.
text
)
except
StaleElementReferenceException
:
return
(
False
,
None
)
...
...
@@ -233,6 +237,7 @@ def get_selected_option_text(select_browser_query):
text
=
Promise
(
lambda
:
get_option
(
select_browser_query
),
'Retrieved selected option text'
)
.
fulfill
()
return
text
def
get_options
(
select_browser_query
):
"""
Returns all the options for the given select.
...
...
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