Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
eec095a1
Commit
eec095a1
authored
11 years ago
by
JonahStanley
Browse files
Options
Downloads
Patches
Plain Diff
Changed naming of attempts to max_attempts and changed css_selector
parent
96c4d287
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/terrain/ui_helpers.py
+4
-4
4 additions, 4 deletions
common/djangoapps/terrain/ui_helpers.py
lms/djangoapps/courseware/features/navigation.py
+1
-1
1 addition, 1 deletion
lms/djangoapps/courseware/features/navigation.py
with
5 additions
and
5 deletions
common/djangoapps/terrain/ui_helpers.py
+
4
−
4
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
():
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/navigation.py
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment