Example #1
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)
def set_the_weight_to_abc(step, bad_weight):
    set_weight(bad_weight)
    # We show the clear button immediately on type, hence the "True" here.
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", True)
    world.save_component_and_reopen(step)
    # But no change was actually ever sent to the model, so on reopen, explicitly_set is False
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", False)
def verify_all_setting_entries(expected_entries):
    settings = world.browser.find_by_css(".wrapper-comp-setting")
    assert_equal(len(expected_entries), len(settings))
    for (counter, setting) in enumerate(settings):
        world.verify_setting_entry(
            setting, expected_entries[counter][0], expected_entries[counter][1], expected_entries[counter][2]
        )
def set_the_max_attempts(step, max_attempts_set, max_attempts_displayed, max_attempts_persisted):
    world.get_setting_entry(MAXIMUM_ATTEMPTS).find_by_css(
        '.setting-input')[0].fill(max_attempts_set)
    world.verify_setting_entry(world.get_setting_entry(
        MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_displayed, True)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(
        MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_persisted, True)
Example #5
0
def set_the_weight_to_abc(step, bad_weight):
    set_weight(bad_weight)
    # We show the clear button immediately on type, hence the "True" here.
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT),
                               PROBLEM_WEIGHT, "", True)
    world.save_component_and_reopen(step)
    # But no change was actually ever sent to the model, so on reopen, explicitly_set is False
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT),
                               PROBLEM_WEIGHT, "", False)
Example #6
0
def set_the_max_attempts(step, max_attempts_set, max_attempts_displayed,
                         max_attempts_persisted):
    world.get_setting_entry(MAXIMUM_ATTEMPTS).find_by_css(
        '.setting-input')[0].fill(max_attempts_set)
    world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS),
                               MAXIMUM_ATTEMPTS, max_attempts_displayed, True)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS),
                               MAXIMUM_ATTEMPTS, max_attempts_persisted, True)
Example #7
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
    )
Example #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
    )
Example #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
    )
Example #10
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
    )
Example #11
0
def i_can_revert_to_default_for_randomization(step):
    world.revert_setting_entry(RANDOMIZATION)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(RANDOMIZATION),
                               RANDOMIZATION, "Never", False)
Example #12
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)
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, 'Blank Advanced Problem', False)
def verify_modified_display_name_with_special_chars():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, "updated ' \" &", True)
def verify_modified_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '3.4', True)
def verify_modified_randomization():
    world.verify_setting_entry(world.get_setting_entry(RANDOMIZATION), RANDOMIZATION, "Per Student", True)
Example #17
0
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '', False)
Example #18
0
def verify_modified_display_name_with_special_chars():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, "updated ' \" &", True)
Example #19
0
def i_can_modify_video_display_name(_step):
    index = world.get_setting_entry_index(DISPLAY_NAME)
    world.set_field_value(index, '3.4')
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '3.4', True)
Example #20
0
def verify_modified_randomization():
    world.verify_setting_entry(world.get_setting_entry(RANDOMIZATION),
                               RANDOMIZATION, "Per Student", True)
Example #21
0
def verify_modified_display_name_with_html():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, "<script>alert('test')</script>", True)
Example #22
0
def i_can_modify_video_display_name(_step):
    index = world.get_setting_entry_index(DISPLAY_NAME)
    world.set_field_value(index, '3.4')
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '3.4', True)
Example #23
0
def i_can_revert_to_default_for_unset_weight(step):
    world.revert_setting_entry(PROBLEM_WEIGHT)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT),
                               PROBLEM_WEIGHT, "", False)
def verify_modified_weight():
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "3.5", True)
Example #25
0
def verify_modified_weight():
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT),
                               PROBLEM_WEIGHT, "3.5", True)
Example #26
0
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '', False)
Example #27
0
def verify_modified_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '3.4', True)
def i_can_revert_to_default_for_randomization(step):
    world.revert_setting_entry(RANDOMIZATION)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(RANDOMIZATION), RANDOMIZATION, "Never", False)
Example #29
0
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, 'Blank Advanced Problem', False)
def i_can_revert_to_default_for_unset_weight(step):
    world.revert_setting_entry(PROBLEM_WEIGHT)
    world.save_component_and_reopen(step)
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", False)