Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
def verify_modified_weight():
    world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT),
                               PROBLEM_WEIGHT, "3.5", True)
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
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)
Exemplo n.º 9
0
def verify_modified_display_name_with_special_chars():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, "updated ' \" &", True)
Exemplo n.º 10
0
def i_can_modify_the_display_name_with_special_chars(step):
    world.get_setting_entry(DISPLAY_NAME).find_by_css(
        '.setting-input')[0].fill("updated ' \" &")
    verify_modified_display_name_with_special_chars()
Exemplo n.º 11
0
def i_can_modify_the_display_name(step):
    # Verifying that the display name can be a string containing a floating point value
    # (to confirm that we don't throw an error because it is of the wrong type).
    world.get_setting_entry(DISPLAY_NAME).find_by_css(
        '.setting-input')[0].fill('3.4')
    verify_modified_display_name()
Exemplo n.º 12
0
def set_weight(weight):
    world.get_setting_entry(PROBLEM_WEIGHT).find_by_css(
        '.setting-input')[0].fill(weight)
Exemplo n.º 13
0
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '', False)
Exemplo n.º 14
0
def verify_modified_randomization():
    world.verify_setting_entry(world.get_setting_entry(RANDOMIZATION),
                               RANDOMIZATION, "Per Student", True)
Exemplo n.º 15
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)
Exemplo n.º 16
0
def verify_modified_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '3.4', True)
Exemplo n.º 17
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)
Exemplo n.º 18
0
def verify_unset_display_name():
    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, 'Blank Advanced Problem', False)
Exemplo n.º 19
0
def i_can_modify_the_display_name(step):
    world.get_setting_entry(DISPLAY_NAME).find_by_css(
        '.setting-input')[0].fill('modified')
    verify_modified_display_name()