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
eec095a1
Commit
eec095a1
authored
Jun 20, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed naming of attempts to max_attempts and changed css_selector
parent
96c4d287
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
common/djangoapps/terrain/ui_helpers.py
+4
-4
lms/djangoapps/courseware/features/navigation.py
+1
-1
No files found.
common/djangoapps/terrain/ui_helpers.py
View file @
eec095a1
...
...
@@ -58,7 +58,7 @@ def css_find(css, wait_time=5):
@world.absorb
def
css_click
(
css_selector
,
index
=
0
,
attempts
=
5
,
success_condition
=
lambda
:
True
):
def
css_click
(
css_selector
,
index
=
0
,
max_
attempts
=
5
,
success_condition
=
lambda
:
True
):
"""
Perform a click on a CSS selector, retrying if it initially fails.
...
...
@@ -72,7 +72,7 @@ def css_click(css_selector, index=0, attempts=5, success_condition=lambda: True)
assert
is_css_present
(
css_selector
)
attempt
=
0
result
=
False
while
attempt
<
attempts
:
while
attempt
<
max_
attempts
:
try
:
world
.
css_find
(
css_selector
)[
index
]
.
click
()
if
success_condition
():
...
...
@@ -90,7 +90,7 @@ def css_click(css_selector, index=0, attempts=5, success_condition=lambda: True)
@world.absorb
def
css_check
(
css_selector
,
index
=
0
,
attempts
=
5
,
success_condition
=
lambda
:
True
):
def
css_check
(
css_selector
,
index
=
0
,
max_
attempts
=
5
,
success_condition
=
lambda
:
True
):
"""
Checks a check box based on a CSS selector, retrying if it initially fails.
...
...
@@ -104,7 +104,7 @@ def css_check(css_selector, index=0, attempts=5, success_condition=lambda: True)
assert
is_css_present
(
css_selector
)
attempt
=
0
result
=
False
while
attempt
<
attempts
:
while
attempt
<
max_
attempts
:
try
:
world
.
css_find
(
css_selector
)[
index
]
.
check
()
if
success_condition
():
...
...
lms/djangoapps/courseware/features/navigation.py
View file @
eec095a1
...
...
@@ -83,7 +83,7 @@ def click_on_section(step, section):
world
.
css_click
(
section_css
)
subid
=
"ui-accordion-accordion-panel-"
+
str
(
int
(
section
)
-
1
)
subsection_css
=
'ul.ui-accordion-content-active[id=
\'
%
s
\'
]
[aria-expanded=
\'
true
\'
]
> li > a'
%
subid
subsection_css
=
'ul.ui-accordion-content-active[id=
\'
%
s
\'
]
> li > a'
%
subid
prev_url
=
world
.
browser
.
url
changed_section
=
lambda
:
prev_url
!=
world
.
browser
.
url
...
...
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