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
a90d7b5d
Commit
a90d7b5d
authored
Jul 25, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #491 from edx/lettuce-improvements
Misc improvements to make lettuce testing a bit saner
parents
c6b51782
df125290
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
23 deletions
+21
-23
cms/djangoapps/contentstore/features/advanced-settings.py
+9
-9
cms/static/js/base.js
+6
-5
common/djangoapps/terrain/browser.py
+1
-1
common/djangoapps/terrain/ui_helpers.py
+3
-6
requirements/edx/base.txt
+2
-2
No files found.
cms/djangoapps/contentstore/features/advanced-settings.py
View file @
a90d7b5d
...
...
@@ -2,7 +2,7 @@
#pylint: disable=W0621
from
lettuce
import
world
,
step
from
nose.tools
import
assert_false
,
assert_equal
,
assert_regexp_matches
,
assert_true
from
nose.tools
import
assert_false
,
assert_equal
,
assert_regexp_matches
from
common
import
type_in_codemirror
,
press_the_notification_button
KEY_CSS
=
'.key input.policy-key'
...
...
@@ -90,18 +90,18 @@ def the_policy_key_value_is_changed(step):
############# HELPERS ###############
def
assert_policy_entries
(
expected_keys
,
expected_values
):
for
counter
in
range
(
len
(
expected_keys
)
):
index
=
get_index_of
(
expected_keys
[
counter
]
)
assert_false
(
index
==
-
1
,
"Could not find key:
"
+
expected_keys
[
counter
]
)
assert_equal
(
expected_values
[
counter
]
,
world
.
css_find
(
VALUE_CSS
)[
index
]
.
value
,
"value is incorrect"
)
for
key
,
value
in
zip
(
expected_keys
,
expected_values
):
index
=
get_index_of
(
key
)
assert_false
(
index
==
-
1
,
"Could not find key:
{key}"
.
format
(
key
=
key
)
)
assert_equal
(
value
,
world
.
css_find
(
VALUE_CSS
)[
index
]
.
value
,
"value is incorrect"
)
def
get_index_of
(
expected_key
):
for
counter
in
range
(
len
(
world
.
css_find
(
KEY_CSS
)
)):
#
Sometimes get stale reference if I hold on to the array of elements
key
=
world
.
css_value
(
KEY_CSS
,
index
=
counter
)
for
i
,
element
in
enumerate
(
world
.
css_find
(
KEY_CSS
)):
# Sometimes get stale reference if I hold on to the array of elements
key
=
world
.
css_value
(
KEY_CSS
,
index
=
i
)
if
key
==
expected_key
:
return
counter
return
i
return
-
1
...
...
cms/static/js/base.js
View file @
a90d7b5d
...
...
@@ -60,12 +60,10 @@ $(document).ready(function() {
$
(
'.nav-dd .nav-item .title'
).
removeClass
(
'is-selected'
);
});
$
(
'.nav-dd .nav-item
.title
'
).
click
(
function
(
e
)
{
$
(
'.nav-dd .nav-item'
).
click
(
function
(
e
)
{
$subnav
=
$
(
this
).
parent
().
find
(
'.wrapper-nav-sub'
);
$title
=
$
(
this
).
parent
().
find
(
'.title'
);
e
.
preventDefault
();
e
.
stopPropagation
();
$subnav
=
$
(
this
).
find
(
'.wrapper-nav-sub'
);
$title
=
$
(
this
).
find
(
'.title'
);
if
(
$subnav
.
hasClass
(
'is-shown'
))
{
$subnav
.
removeClass
(
'is-shown'
);
...
...
@@ -75,6 +73,9 @@ $(document).ready(function() {
$
(
'.nav-dd .nav-item .wrapper-nav-sub'
).
removeClass
(
'is-shown'
);
$title
.
addClass
(
'is-selected'
);
$subnav
.
addClass
(
'is-shown'
);
// if propogation is not stopped, the event will bubble up to the
// body element, which will close the dropdown.
e
.
stopPropagation
();
}
});
...
...
common/djangoapps/terrain/browser.py
View file @
a90d7b5d
...
...
@@ -75,7 +75,7 @@ def initial_setup(server):
# If we were unable to get a valid session within the limit of attempts,
# then we cannot run the tests.
if
not
success
:
raise
IOError
(
"Could not acquire valid
ChromeDriver browser session."
)
raise
IOError
(
"Could not acquire valid
{driver} browser session."
.
format
(
driver
=
browser_driver
)
)
# Set the browser size to 1280x1024
world
.
browser
.
driver
.
set_window_size
(
1280
,
1024
)
...
...
common/djangoapps/terrain/ui_helpers.py
View file @
a90d7b5d
...
...
@@ -216,22 +216,19 @@ def save_the_html(path='/tmp'):
@world.absorb
def
click_course_content
():
course_content_css
=
'li.nav-course-courseware'
if
world
.
browser
.
is_element_present_by_css
(
course_content_css
):
world
.
css_click
(
course_content_css
)
world
.
css_click
(
course_content_css
)
@world.absorb
def
click_course_settings
():
course_settings_css
=
'li.nav-course-settings'
if
world
.
browser
.
is_element_present_by_css
(
course_settings_css
):
world
.
css_click
(
course_settings_css
)
world
.
css_click
(
course_settings_css
)
@world.absorb
def
click_tools
():
tools_css
=
'li.nav-course-tools'
if
world
.
browser
.
is_element_present_by_css
(
tools_css
):
world
.
css_click
(
tools_css
)
world
.
css_click
(
tools_css
)
@world.absorb
...
...
requirements/edx/base.txt
View file @
a90d7b5d
...
...
@@ -80,8 +80,8 @@ nosexcover==1.0.7
pep8==1.4.5
pylint==0.28
rednose==0.3
selenium==2.3
1
.0
splinter==0.5.
0
selenium==2.3
3
.0
splinter==0.5.
4
django_nose==1.1
django-jasmine==0.3.2
django_debug_toolbar
...
...
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