Пример #1
0
def tasks_correctly_selected_after_reload(step):
    reload_the_page(step)
    verifyChecklist2Status(2, 7, 29)
    # verify that task 7 is still selected by toggling its checkbox state and
    # making sure that it deselects
    toggleTask(1, 6)
    verifyChecklist2Status(1, 7, 14)
def save_component_and_reopen(step):
    world.css_click("a.save-button")
    world.wait_for_ajax_complete()
    # We have a known issue that modifications are still shown within the edit window after cancel (though)
    # they are not persisted. Refresh the browser to make sure the changes WERE persisted after Save.
    reload_the_page(step)
    edit_component_and_select_settings()
Пример #3
0
def xml_only_video(step):
    # Create a new video *without* metadata. This requires a certain
    # amount of rummaging to make sure all the correct data is present
    step.given('I have clicked the new unit button')

    # Wait for the new unit to be created and to load the page
    world.wait(1)

    location = world.scenario_dict['COURSE'].location
    store = get_modulestore(location)

    parent_location = store.get_items(Location(category='vertical', revision='draft'))[0].location

    youtube_id = 'ABCDEFG'
    world.scenario_dict['YOUTUBE_ID'] = youtube_id

    # Create a new Video component, but ensure that it doesn't have
    # metadata. This allows us to test that we are correctly parsing
    # out XML
    video = world.ItemFactory.create(
        parent_location=parent_location,
        category='video',
        data='<video youtube="1.00:%s"></video>' % youtube_id
    )

    # Refresh to see the new video
    reload_the_page(step)
Пример #4
0
def xml_only_video(step):
    # Create a new video *without* metadata. This requires a certain
    # amount of rummaging to make sure all the correct data is present
    step.given('I have clicked the new unit button')

    # Wait for the new unit to be created and to load the page
    world.wait(1)

    location = world.scenario_dict['COURSE'].location
    store = get_modulestore(location)

    parent_location = store.get_items(Location(category='vertical', revision='draft'))[0].location

    youtube_id = 'ABCDEFG'
    world.scenario_dict['YOUTUBE_ID'] = youtube_id

    # Create a new Video component, but ensure that it doesn't have
    # metadata. This allows us to test that we are correctly parsing
    # out XML
    video = world.ItemFactory.create(
        parent_location=parent_location,
        category='video',
        data='<video youtube="1.00:%s"></video>' % youtube_id
    )

    # Refresh to see the new video
    reload_the_page(step)
Пример #5
0
def video_name_persisted(step):
    world.css_click("a.save-button")
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(world.get_setting_entry("Display Name"), "Display Name", "3.4", True)
Пример #6
0
def save_component_and_reopen(step):
    world.css_click("a.save-button")
    # We have a known issue that modifications are still shown within the edit window after cancel (though)
    # they are not persisted. Refresh the browser to make sure the changes
    # WERE persisted after Save.
    reload_the_page(step)
    edit_component_and_select_settings()
Пример #7
0
def tasks_correctly_selected_after_reload(step):
    reload_the_page(step)
    verifyChecklist2Status(2, 7, 29)
    # verify that task 7 is still selected by toggling its checkbox state and
    # making sure that it deselects
    toggleTask(1, 6)
    verifyChecklist2Status(1, 7, 14)
Пример #8
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(world.get_setting_entry('Display Name'),
                               'Display Name', '3.4', True)
Пример #9
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '3.4', True)
Пример #10
0
def find_grade_report_csv_link(step):  # pylint: disable=unused-argument
    # Need to reload the page to see the grades download table
    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'
    assert_regexp_matches(world.css_html('#report-downloads-table'),
                          expected_file_regexp,
                          msg="Expected grade report filename was not found.")
Пример #11
0
def find_grade_report_csv_link(step):  # pylint: disable=unused-argument
    # Need to reload the page to see the grades download table
    reload_the_page(step)
    world.wait_for_visible('#report-downloads-table')
    # Find table and assert a .csv file is present
    quoted_id = http.urlquote(world.course_key).replace('/', '_')
    expected_file_regexp = quoted_id + '_grade_report_\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.")
Пример #12
0
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
    quoted_id = http.urlquote(world.course_key).replace("/", "_")
    expected_file_regexp = quoted_id + "_" + 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 report filename was not found."
    )
Пример #13
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(
        world.get_setting_entry(DISPLAY_NAME),
        DISPLAY_NAME, '3.4', True
    )
Пример #14
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(
        world.get_setting_entry('Display Name'),
        'Display Name', '3.4', True
    )
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
    quoted_id = http.urlquote(world.course_key).replace('/', '_')
    expected_file_regexp = quoted_id + '_' + 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 report filename was not found.")
Пример #16
0
def find_grade_report_csv_link(step):  # pylint: disable=unused-argument
    # Need to reload the page to see the grades download table
    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'
    assert_regexp_matches(
        world.css_html('#report-downloads-table'), expected_file_regexp,
        msg="Expected grade report filename was not found."
    )
Пример #17
0
def find_grade_report_csv_link(step):  # pylint: disable=unused-argument
    # Need to reload the page to see the grades download table
    reload_the_page(step)
    world.wait_for_visible('#report-downloads-table')
    # Find table and assert a .csv file is present
    quoted_id = http.urlquote(world.course_key).replace('/', '_')
    expected_file_regexp = quoted_id + '_grade_report_\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."
    )
Пример #18
0
def test_then_i_see_the_set_dates_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_END_DATE_CSS, '12/26/2013')
    verify_date_or_time(ENROLLMENT_START_DATE_CSS, '12/01/2013')
    verify_date_or_time(ENROLLMENT_END_DATE_CSS, '12/10/2013')

    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
    # Unset times get set to 12 AM once the corresponding date has been set.
    verify_date_or_time(COURSE_END_TIME_CSS, DEFAULT_TIME)
    verify_date_or_time(ENROLLMENT_START_TIME_CSS, DEFAULT_TIME)
    verify_date_or_time(ENROLLMENT_END_TIME_CSS, DUMMY_TIME)
Пример #19
0
def test_then_i_see_the_set_dates_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_END_DATE_CSS, '12/26/2013')
    verify_date_or_time(ENROLLMENT_START_DATE_CSS, '12/01/2013')
    verify_date_or_time(ENROLLMENT_END_DATE_CSS, '12/10/2013')

    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
    # Unset times get set to 12 AM once the corresponding date has been set.
    verify_date_or_time(COURSE_END_TIME_CSS, DEFAULT_TIME)
    verify_date_or_time(ENROLLMENT_START_TIME_CSS, DEFAULT_TIME)
    verify_date_or_time(ENROLLMENT_END_TIME_CSS, DUMMY_TIME)
Пример #20
0
def test_then_i_see_cleared_dates_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_END_DATE_CSS, '')
    verify_date_or_time(ENROLLMENT_START_DATE_CSS, '')
    verify_date_or_time(ENROLLMENT_END_DATE_CSS, '')

    verify_date_or_time(COURSE_END_TIME_CSS, '')
    verify_date_or_time(ENROLLMENT_START_TIME_CSS, '')
    verify_date_or_time(ENROLLMENT_END_TIME_CSS, '')

    # Verify course start date (required) and time still there
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
Пример #21
0
def test_then_i_see_cleared_dates_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_END_DATE_CSS, '')
    verify_date_or_time(ENROLLMENT_START_DATE_CSS, '')
    verify_date_or_time(ENROLLMENT_END_DATE_CSS, '')

    verify_date_or_time(COURSE_END_TIME_CSS, '')
    verify_date_or_time(ENROLLMENT_START_TIME_CSS, '')
    verify_date_or_time(ENROLLMENT_END_TIME_CSS, '')

    # Verify course start date (required) and time still there
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
Пример #22
0
def test_then_i_see_the_set_dates_on_refresh(step):
    reload_the_page(step)
    i_see_the_set_dates()
Пример #23
0
def test_the_previously_set_start_date_is_shown_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
def cancel_component(step):
    world.css_click("a.action-cancel")
    # We have a known issue that modifications are still shown within the edit window after cancel (though)
    # they are not persisted. Refresh the browser to make sure the changes were not persisted.
    reload_the_page(step)
Пример #25
0
def videoalpha_name_persisted(step):
    world.css_click('a.save-button')
    reload_the_page(step)
    world.edit_component()
    world.verify_setting_entry(world.get_setting_entry('Display Name'), 'Display Name', '3.4', True)
Пример #26
0
def test_the_previously_set_start_date_is_shown_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/20/2013')
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
def save_component_and_reopen(step):
    save_component()
    # We have a known issue that modifications are still shown within the edit window after cancel (though)
    # they are not persisted. Refresh the browser to make sure the changes WERE persisted after Save.
    reload_the_page(step)
    edit_component_and_select_settings()
Пример #28
0
def cancel_component(step):
    world.css_click("a.action-cancel")
    # We have a known issue that modifications are still shown within the edit window after cancel (though)
    # they are not persisted. Refresh the browser to make sure the changes were not persisted.
    reload_the_page(step)
Пример #29
0
def test_my_new_course_start_date_is_shown_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/22/2013')
    # Time should have stayed from before attempt to clear date.
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
Пример #30
0
def changes_not_persisted(step):
    reload_the_page(step)
    name_id = '#course-grading-assignment-name'
    ele = world.css_find(name_id)[0]
    assert(ele.value == 'Homework')
Пример #31
0
def changes_not_persisted(step):
    reload_the_page(step)
    name_id = "#course-grading-assignment-name"
    assert_equal(world.css_value(name_id), "Homework")
Пример #32
0
def test_my_new_course_start_date_is_shown_on_refresh(step):
    reload_the_page(step)
    verify_date_or_time(COURSE_START_DATE_CSS, '12/22/2013')
    # Time should have stayed from before attempt to clear date.
    verify_date_or_time(COURSE_START_TIME_CSS, DUMMY_TIME)
Пример #33
0
def changes_not_persisted(step):
    reload_the_page(step)
    name_id = '#course-grading-assignment-name'
    assert(world.css_value(name_id) == 'Homework')
Пример #34
0
def video_name_persisted(step):
    world.css_click('a.save-button')
    reload_the_page(step)
    world.edit_component()
    world.verify_setting_entry(world.get_setting_entry('Display Name'),
                               'Display Name', '3.4', True)
Пример #35
0
def changes_not_persisted(step):
    reload_the_page(step)
    name_id = '#course-grading-assignment-name'
    assert_equal(world.css_value(name_id), 'Homework')
Пример #36
0
def test_then_i_see_the_set_dates_on_refresh(step):
    reload_the_page(step)
    i_see_the_set_dates()