Make student profile CSV download a background task, add cohort column

This commit is contained in:
Daniel Friedman
2014-09-26 17:01:04 -04:00
parent bb58e4b3ce
commit ba3f7f9409
17 changed files with 351 additions and 114 deletions

View File

@@ -92,9 +92,9 @@ def click_a_button(step, button): # pylint: disable=unused-argument
# Expect to see a message that grade report is being generated
expected_msg = "Your grade report is being generated! You can view the status of the generation task in the 'Pending Instructor Tasks' section."
world.wait_for_visible('#grade-request-response')
world.wait_for_visible('#report-request-response')
assert_in(
expected_msg, world.css_text('#grade-request-response'),
expected_msg, world.css_text('#report-request-response'),
msg="Could not find grade report generation success message."
)
@@ -113,7 +113,8 @@ def click_a_button(step, button): # pylint: disable=unused-argument
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
world.css_click('input[name="list-profiles-csv"]')
else:
raise ValueError("Unrecognized button option " + button)

View File

@@ -44,3 +44,12 @@ Feature: LMS.Instructor Dash Data Download
| Role |
| instructor |
| staff |
Scenario: Generate & download a student profile report
Given I am "<Role>" for a course
When I click "Download profile information as a CSV"
Then I see a student profile csv file in the reports table
Examples:
| Role |
| instructor |
| staff |

View File

@@ -68,14 +68,23 @@ length=0"""
assert_in(expected_config, world.css_text('#data-grade-config-text'))
@step(u"I see a grade report csv file in the reports table")
def find_grade_report_csv_link(step): # pylint: disable=unused-argument
# Need to reload the page to see the grades download table
def verify_report_is_generated(report_name_substring):
# Need to reload the page to see the reports table updated
reload_the_page(step)
world.wait_for_visible('#report-downloads-table')
# Find table and assert a .csv file is present
expected_file_regexp = 'edx_999_Test_Course_grade_report_\d{4}-\d{2}-\d{2}-\d{4}\.csv'
expected_file_regexp = 'edx_999_Test_Course_{0}_'.format(report_name_substring) + '\d{4}-\d{2}-\d{2}-\d{4}\.csv'
assert_regexp_matches(
world.css_html('#report-downloads-table'), expected_file_regexp,
msg="Expected grade report filename was not found."
msg="Expected report filename was not found."
)
@step(u"I see a grade report csv file in the reports table")
def find_grade_report_csv_link(step): # pylint: disable=unused-argument
verify_report_is_generated('grade_report')
@step(u"I see a student profile csv file in the reports table")
def find_student_profile_report_csv_link(step): # pylint: disable=unused-argument
verify_report_is_generated('student_profile_info')