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
b749300d
Commit
b749300d
authored
Oct 07, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use css_has_value() to fix failure in course-overview.feature
parent
31980150
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
cms/djangoapps/contentstore/features/course-overview.py
+1
-1
cms/djangoapps/contentstore/features/grading.py
+1
-1
common/djangoapps/terrain/ui_helpers.py
+8
-13
No files found.
cms/djangoapps/contentstore/features/course-overview.py
View file @
b749300d
...
@@ -72,7 +72,7 @@ def i_click_the_text_span(step, text):
...
@@ -72,7 +72,7 @@ def i_click_the_text_span(step, text):
span_locator
=
'.toggle-button-sections span'
span_locator
=
'.toggle-button-sections span'
assert_true
(
world
.
browser
.
is_element_present_by_css
(
span_locator
))
assert_true
(
world
.
browser
.
is_element_present_by_css
(
span_locator
))
# first make sure that the expand/collapse text is the one you expected
# first make sure that the expand/collapse text is the one you expected
assert_
equal
(
world
.
browser
.
find_by_css
(
span_locator
)
.
value
,
text
)
assert_
true
(
world
.
css_has_value
(
span_locator
,
text
)
)
world
.
css_click
(
span_locator
)
world
.
css_click
(
span_locator
)
...
...
cms/djangoapps/contentstore/features/grading.py
View file @
b749300d
...
@@ -170,7 +170,7 @@ def i_change_grace_period(_step, grace_period):
...
@@ -170,7 +170,7 @@ def i_change_grace_period(_step, grace_period):
# this to happen, then we can end up with
# this to happen, then we can end up with
# an invalid value (e.g. "00:0048:00")
# an invalid value (e.g. "00:0048:00")
# which prevents us from saving.
# which prevents us from saving.
assert_true
(
world
.
css_has_value
(
grace_period_css
,
"00:00"
,
allow_blank
=
False
))
assert_true
(
world
.
css_has_value
(
grace_period_css
,
"00:00"
))
# Set the new grace period
# Set the new grace period
ele
.
value
=
grace_period
ele
.
value
=
grace_period
...
...
common/djangoapps/terrain/ui_helpers.py
View file @
b749300d
...
@@ -194,8 +194,7 @@ def is_css_not_present(css_selector, wait_time=5):
...
@@ -194,8 +194,7 @@ def is_css_not_present(css_selector, wait_time=5):
@world.absorb
@world.absorb
def
css_has_text
(
css_selector
,
text
,
index
=
0
,
def
css_has_text
(
css_selector
,
text
,
index
=
0
,
strip
=
False
):
strip
=
False
,
allow_blank
=
True
):
"""
"""
Return a boolean indicating whether the element with `css_selector`
Return a boolean indicating whether the element with `css_selector`
has `text`.
has `text`.
...
@@ -203,15 +202,12 @@ def css_has_text(css_selector, text, index=0,
...
@@ -203,15 +202,12 @@ def css_has_text(css_selector, text, index=0,
If `strip` is True, strip whitespace at beginning/end of both
If `strip` is True, strip whitespace at beginning/end of both
strings before comparing.
strings before comparing.
If `allow_blank` is False, wait for the element to have non-empty
text before making the assertion. This is useful for elements
that are populated by JavaScript after the page loads.
If there are multiple elements matching the css selector,
If there are multiple elements matching the css selector,
use `index` to indicate which one.
use `index` to indicate which one.
"""
"""
# If we're expecting a non-empty string, give the page
if
not
allow_blank
:
# a chance to fill in text fields.
if
text
:
world
.
wait_for
(
lambda
_
:
world
.
css_text
(
css_selector
,
index
=
index
))
world
.
wait_for
(
lambda
_
:
world
.
css_text
(
css_selector
,
index
=
index
))
actual_text
=
world
.
css_text
(
css_selector
,
index
=
index
)
actual_text
=
world
.
css_text
(
css_selector
,
index
=
index
)
...
@@ -224,18 +220,17 @@ def css_has_text(css_selector, text, index=0,
...
@@ -224,18 +220,17 @@ def css_has_text(css_selector, text, index=0,
@world.absorb
@world.absorb
def
css_has_value
(
css_selector
,
value
,
index
=
0
,
allow_blank
=
False
):
def
css_has_value
(
css_selector
,
value
,
index
=
0
):
"""
"""
Return a boolean indicating whether the element with
Return a boolean indicating whether the element with
`css_selector` has the specified `value`.
`css_selector` has the specified `value`.
If `allow_blank` is False, wait for the element to have
a value that is a non-empty string.
If there are multiple elements matching the css selector,
If there are multiple elements matching the css selector,
use `index` to indicate which one.
use `index` to indicate which one.
"""
"""
if
not
allow_blank
:
# If we're expecting a non-empty string, give the page
# a chance to fill in values
if
value
:
world
.
wait_for
(
lambda
_
:
world
.
css_value
(
css_selector
,
index
=
index
))
world
.
wait_for
(
lambda
_
:
world
.
css_value
(
css_selector
,
index
=
index
))
return
world
.
css_value
(
css_selector
,
index
=
index
)
==
value
return
world
.
css_value
(
css_selector
,
index
=
index
)
==
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