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
fba50589
Commit
fba50589
authored
Jul 30, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a lettuce test for course team admins granting admin status
parent
c82ad6cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
16 deletions
+62
-16
cms/djangoapps/contentstore/features/common.py
+8
-0
cms/djangoapps/contentstore/features/course-team.feature
+13
-0
cms/djangoapps/contentstore/features/course-team.py
+33
-10
cms/templates/manage_users.html
+8
-6
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
fba50589
...
@@ -53,6 +53,14 @@ def i_have_opened_a_new_course(_step):
...
@@ -53,6 +53,14 @@ def i_have_opened_a_new_course(_step):
open_new_course
()
open_new_course
()
@step
(
'(I select|s?he selects) the new course'
)
def
select_new_course
(
_step
,
whom
):
course_link_xpath
=
'//div[contains(@class, "courses")]//a[contains(@class, "class-link")]//span[contains(., "{name}")]/..'
.
format
(
name
=
"Robot Super Course"
)
element
=
world
.
browser
.
find_by_xpath
(
course_link_xpath
)
element
.
click
()
@step
(
u'I press the "([^"]*)" notification button$'
)
@step
(
u'I press the "([^"]*)" notification button$'
)
def
press_the_notification_button
(
_step
,
name
):
def
press_the_notification_button
(
_step
,
name
):
css
=
'a.action-
%
s'
%
name
.
lower
()
css
=
'a.action-
%
s'
%
name
.
lower
()
...
...
cms/djangoapps/contentstore/features/course-team.feature
View file @
fba50589
...
@@ -32,3 +32,16 @@ Feature: Course Team
...
@@ -32,3 +32,16 @@ Feature: Course Team
And
I am viewing the course team settings
And
I am viewing the course team settings
When
I add
"dennis"
to the course team
When
I add
"dennis"
to the course team
Then
I should see
"Could not find user by email address"
somewhere on the page
Then
I should see
"Could not find user by email address"
somewhere on the page
Scenario
:
Admins should be able to make other people into admins
Given
I have opened a new course in Studio
And
the user
"emily"
exists
And
I am viewing the course team settings
And
I add
"emily"
to the course team
When
I make
"emily"
a course team admin
And
"emily"
logs
in
And
she selects the new course
And
she views the course team settings
Then
"emily"
should
be
marked
as
an
admin
And
she can add users
And
she can delete users
cms/djangoapps/contentstore/features/course-team.py
View file @
fba50589
...
@@ -8,8 +8,8 @@ PASSWORD = 'test'
...
@@ -8,8 +8,8 @@ PASSWORD = 'test'
EMAIL_EXTENSION
=
'@edx.org'
EMAIL_EXTENSION
=
'@edx.org'
@step
(
u'
I am viewing
the course team settings'
)
@step
(
u'
(I am viewing|s?he views)
the course team settings'
)
def
view_grading_settings
(
_step
):
def
view_grading_settings
(
_step
,
whom
):
world
.
click_course_settings
()
world
.
click_course_settings
()
link_css
=
'li.nav-course-settings-team a'
link_css
=
'li.nav-course-settings-team a'
world
.
css_click
(
link_css
)
world
.
css_click
(
link_css
)
...
@@ -41,29 +41,52 @@ def delete_other_user(_step, name):
...
@@ -41,29 +41,52 @@ def delete_other_user(_step, name):
world
.
css_click
(
to_delete_css
)
world
.
css_click
(
to_delete_css
)
@step
(
u'I make "([^"]*)" a course team admin'
)
def
make_course_team_admin
(
_step
,
name
):
admin_btn_css
=
'.user-item[data-email="{email}"] .user-actions .add-admin-role'
.
format
(
email
=
name
+
EMAIL_EXTENSION
)
world
.
css_click
(
admin_btn_css
)
@step
(
u'"([^"]*)" logs in$'
)
@step
(
u'"([^"]*)" logs in$'
)
def
other_user_login
(
_step
,
name
):
def
other_user_login
(
_step
,
name
):
log_into_studio
(
uname
=
name
,
password
=
PASSWORD
,
email
=
name
+
EMAIL_EXTENSION
)
log_into_studio
(
uname
=
name
,
password
=
PASSWORD
,
email
=
name
+
EMAIL_EXTENSION
)
@step
(
u's?he does( not)? see the course on (his|her) page'
)
@step
(
u's?he does( not)? see the course on (his|her) page'
)
def
see_course
(
_step
,
doesnt_see_course
,
gender
):
def
see_course
(
_step
,
inverted
,
gender
):
class_css
=
'span.class-name'
class_css
=
'span.class-name'
all_courses
=
world
.
css_find
(
class_css
,
wait_time
=
1
)
all_courses
=
world
.
css_find
(
class_css
,
wait_time
=
1
)
all_names
=
[
item
.
html
for
item
in
all_courses
]
all_names
=
[
item
.
html
for
item
in
all_courses
]
if
doesnt_see_course
:
if
inverted
:
assert
not
world
.
scenario_dict
[
'COURSE'
]
.
display_name
in
all_names
assert
not
world
.
scenario_dict
[
'COURSE'
]
.
display_name
in
all_names
else
:
else
:
assert
world
.
scenario_dict
[
'COURSE'
]
.
display_name
in
all_names
assert
world
.
scenario_dict
[
'COURSE'
]
.
display_name
in
all_names
@step
(
u's?he cannot delete users'
)
@step
(
u'"([^"]*)" should( not)? be marked as an admin'
)
def
cannot_delete
(
_step
):
def
marked_as_admin
(
_step
,
name
,
inverted
):
flag_css
=
'.user-item[data-email="{email}"] .flag-role.flag-role-admin'
.
format
(
email
=
name
+
EMAIL_EXTENSION
)
if
inverted
:
assert
world
.
is_css_not_present
(
flag_css
)
else
:
assert
world
.
is_css_present
(
flag_css
)
@step
(
u's?he can(not)? delete users'
)
def
can_delete_users
(
_step
,
inverted
):
to_delete_css
=
'a.remove-user'
to_delete_css
=
'a.remove-user'
assert
world
.
is_css_not_present
(
to_delete_css
)
if
inverted
:
assert
world
.
is_css_not_present
(
to_delete_css
)
else
:
assert
world
.
is_css_present
(
to_delete_css
)
@step
(
u's?he can
not
add users'
)
@step
(
u's?he can
(not)?
add users'
)
def
can
not_add
(
_step
):
def
can
_add_users
(
_step
,
inverted
):
add_css
=
'a.create-user-button'
add_css
=
'a.create-user-button'
assert
world
.
is_css_not_present
(
add_css
)
if
inverted
:
assert
world
.
is_css_not_present
(
add_css
)
else
:
assert
world
.
is_css_present
(
add_css
)
cms/templates/manage_users.html
View file @
fba50589
...
@@ -57,12 +57,14 @@
...
@@ -57,12 +57,14 @@
<ol
class=
"user-list"
>
<ol
class=
"user-list"
>
% for user in staff:
% for user in staff:
<li
class=
"user-item"
data-url=
"${reverse('course_team_user', kwargs=dict(
<
%
api_url =
reverse('course_team_user',
kwargs=
dict(
org=context_course.location.org,
org=
context_course.location.org,
course=context_course.location.course,
course=
context_course.location.course,
name=context_course.location.name,
name=
context_course.location.name,
email=user.email,
email=
user.email,
))}"
>
))
%
>
<li
class=
"user-item"
data-email=
"${user.email}"
data-url=
"${api_url}"
>
<
%
is_instuctor =
is_user_in_course_group_role(user,
context_course
.
location
,
'
instructor
',
check_staff=
False)
%
>
<
%
is_instuctor =
is_user_in_course_group_role(user,
context_course
.
location
,
'
instructor
',
check_staff=
False)
%
>
% if is_instuctor:
% if is_instuctor:
...
...
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