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
6ca099d5
Commit
6ca099d5
authored
Mar 12, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acceptance tests for beta instructor dash
LMS-1203
parent
74714c4e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
34 deletions
+75
-34
lms/djangoapps/instructor/features/common.py
+31
-0
lms/djangoapps/instructor/features/data_download.feature
+10
-0
lms/djangoapps/instructor/features/data_download.py
+6
-0
lms/static/coffee/src/instructor_dashboard/data_download.coffee
+28
-34
No files found.
lms/djangoapps/instructor/features/common.py
View file @
6ca099d5
...
...
@@ -7,12 +7,24 @@ Define common steps for instructor dashboard acceptance tests.
from
__future__
import
absolute_import
from
django.conf
import
settings
from
lettuce
import
world
,
step
from
mock
import
patch
from
nose.tools
import
assert_in
# pylint: disable=E0611
from
courseware.tests.factories
import
StaffFactory
,
InstructorFactory
@step
(
u'Given I am "([^"]*)" for a very large course'
)
def
make_staff_or_instructor_for_large_course
(
step
,
role
):
make_large_course
(
step
,
role
)
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
"MAX_ENROLLMENT_INSTR_BUTTONS"
:
0
})
def
make_large_course
(
step
,
role
):
i_am_staff_or_instructor
(
step
,
role
)
@step
(
u'Given I am "([^"]*)" for a course'
)
def
i_am_staff_or_instructor
(
step
,
role
):
# pylint: disable=unused-argument
## In summary: makes a test course, makes a new Staff or Instructor user
...
...
@@ -99,5 +111,24 @@ def click_a_button(step, button): # pylint: disable=unused-argument
world
.
css_click
(
'input[name="list-profiles"]'
)
elif
button
==
"Download profile information as a CSV"
:
# Go to the data download section of the instructor dash
go_to_section
(
"data_download"
)
# Don't do anything else, next step will handle clicking & downloading
else
:
raise
ValueError
(
"Unrecognized button option "
+
button
)
@step
(
u'I visit the "([^"]*)" tab'
)
def
click_a_button
(
step
,
tab_name
):
# pylint: disable=unused-argument
# course_info, membership, student_admin, data_download, analytics, send_email
tab_name_dict
=
{
'Course Info'
:
'course_info'
,
'Membership'
:
'membership'
,
'Student Admin'
:
'student_admin'
,
'Data Download'
:
'data_download'
,
'Analytics'
:
'analytics'
,
'Email'
:
'send_email'
,
}
go_to_section
(
tab_name_dict
[
tab_name
])
lms/djangoapps/instructor/features/data_download.feature
View file @
6ca099d5
...
...
@@ -7,6 +7,7 @@ Feature: LMS.Instructor Dash Data Download
### todos when more time can be spent on instructor dashboard
#Scenario: Download profile information as a CSV
#Scenario: Download student anonymized IDs as a CSV
## Need to figure out how to assert csvs will download without actually downloading them
Scenario
:
List enrolled students' profile information
Given
I am
"<Role>"
for a course
...
...
@@ -17,6 +18,15 @@ Feature: LMS.Instructor Dash Data Download
|
instructor
|
|
staff
|
Scenario
:
List enrolled students' profile information for a large course
Given
I am
"<Role>"
for a very large course
When
I visit the
"Data Download"
tab
Then
I do not see a button to 'List enrolled students' profile information'
Examples
:
|
Role
|
|
instructor
|
|
staff
|
Scenario
:
View the grading configuration
Given
I am
"<Role>"
for a course
When
I click
"Grading Configuration"
...
...
lms/djangoapps/instructor/features/data_download.py
View file @
6ca099d5
...
...
@@ -9,6 +9,7 @@ acceptance tests.
from
lettuce
import
world
,
step
from
nose.tools
import
assert_in
,
assert_regexp_matches
# pylint: disable=E0611
from
terrain.steps
import
reload_the_page
from
splinter.request_handler.request_handler
import
RequestHandler
@step
(
u'I see a table of student profiles'
)
...
...
@@ -39,6 +40,11 @@ def find_student_profile_table(step): # pylint: disable=unused-argument
assert_in
(
datum
,
world
.
css_text
(
'#data-student-profiles-table'
))
@step
(
u"I do not see a button to 'List enrolled students' profile information'"
)
def
no_student_profile_table
(
step
):
# pylint: disable=unused-argument
world
.
is_css_not_present
(
'input[name="list-profiles"]'
)
@step
(
u"I see the grading configuration for the course"
)
def
find_grading_config
(
step
):
# pylint: disable=unused-argument
# Find the grading configuration display
...
...
lms/static/coffee/src/instructor_dashboard/data_download.coffee
View file @
6ca099d5
...
...
@@ -54,40 +54,34 @@ class DataDownload
@
$list_studs_btn
.
click
(
e
)
=>
url
=
@
$list_studs_btn
.
data
'endpoint'
# handle csv special case
if
$
(
e
.
target
).
data
'csv'
# redirect the document to the csv file.
url
+=
'/csv'
location
.
href
=
url
else
# Dynamically generate slickgrid table for displaying student profile information
@
clear_display
()
@
$download_display_table
.
text
gettext
(
'Loading...'
)
# fetch user list
$
.
ajax
dataType
:
'json'
url
:
url
error
:
std_ajax_err
=>
@
clear_display
()
@
$download_request_response_error
.
text
gettext
(
"Error getting student list."
)
success
:
(
data
)
=>
@
clear_display
()
# display on a SlickGrid
options
=
enableCellNavigation
:
true
enableColumnReorder
:
false
forceFitColumns
:
true
rowHeight
:
35
columns
=
({
id
:
feature
,
field
:
feature
,
name
:
feature
}
for
feature
in
data
.
queried_features
)
grid_data
=
data
.
students
$table_placeholder
=
$
'<div/>'
,
class
:
'slickgrid'
@
$download_display_table
.
append
$table_placeholder
grid
=
new
Slick
.
Grid
(
$table_placeholder
,
grid_data
,
columns
,
options
)
# grid.autosizeColumns()
# Dynamically generate slickgrid table for displaying student profile information
@
clear_display
()
@
$download_display_table
.
text
gettext
(
'Loading...'
)
# fetch user list
$
.
ajax
dataType
:
'json'
url
:
url
error
:
std_ajax_err
=>
@
clear_display
()
@
$download_request_response_error
.
text
gettext
(
"Error getting student list."
)
success
:
(
data
)
=>
@
clear_display
()
# display on a SlickGrid
options
=
enableCellNavigation
:
true
enableColumnReorder
:
false
forceFitColumns
:
true
rowHeight
:
35
columns
=
({
id
:
feature
,
field
:
feature
,
name
:
feature
}
for
feature
in
data
.
queried_features
)
grid_data
=
data
.
students
$table_placeholder
=
$
'<div/>'
,
class
:
'slickgrid'
@
$download_display_table
.
append
$table_placeholder
grid
=
new
Slick
.
Grid
(
$table_placeholder
,
grid_data
,
columns
,
options
)
# grid.autosizeColumns()
@
$grade_config_btn
.
click
(
e
)
=>
url
=
@
$grade_config_btn
.
data
'endpoint'
...
...
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