Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, April 9th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
8b0e7c57
Commit
8b0e7c57
authored
11 years ago
by
JonahStanley
Browse files
Options
Downloads
Patches
Plain Diff
Made a new command css_has_class that will safely check the class and get around stale elements
parent
d86502bd
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/features/common.py
+1
-7
1 addition, 7 deletions
cms/djangoapps/contentstore/features/common.py
common/djangoapps/terrain/ui_helpers.py
+13
-0
13 additions, 0 deletions
common/djangoapps/terrain/ui_helpers.py
with
14 additions
and
7 deletions
cms/djangoapps/contentstore/features/common.py
+
1
−
7
View file @
8b0e7c57
...
...
@@ -223,13 +223,7 @@ def shows_captions(step, show_captions):
# Prevent cookies from overriding course settings
world
.
browser
.
cookies
.
delete
(
'
hide_captions
'
)
if
show_captions
==
'
does not
'
:
attempt
=
0
while
attempt
<
5
:
try
:
assert
world
.
css_find
(
'
.video
'
)[
0
].
has_class
(
'
closed
'
)
except
:
attempt
+=
1
assert_true
(
attempt
<
5
,
"
There was a stale reference exception in accessing the class of the video
"
)
assert
world
.
css_has_class
(
'
.video
'
,
'
closed
'
)
else
:
assert
world
.
is_css_not_present
(
'
.video.closed
'
)
...
...
This diff is collapsed.
Click to expand it.
common/djangoapps/terrain/ui_helpers.py
+
13
−
0
View file @
8b0e7c57
...
...
@@ -182,6 +182,19 @@ def css_html(css_selector, index=0, max_attempts=5):
return
''
@world.absorb
def
css_has_class
(
css_selector
,
class_name
,
index
=
0
,
max_attempts
=
5
):
attempt
=
0
found
=
False
while
attempt
<
max_attempts
and
not
found
:
try
:
return
world
.
css_find
(
css_selector
)[
index
].
has_class
(
class_name
)
found
=
True
except
:
attempt
+=
1
return
False
@world.absorb
def
css_visible
(
css_selector
):
assert
is_css_present
(
css_selector
),
"
{} is not present
"
.
format
(
css_selector
)
...
...
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