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 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)
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)
def set_the_max_attempts(step, max_attempts_set): # on firefox with selenium, the behaviour is different. eg 2.34 displays as 2.34 and is persisted as 2 index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) world.css_fill('.wrapper-comp-setting .setting-input', max_attempts_set, index=index) if world.is_firefox(): world.trigger_event('.wrapper-comp-setting .setting-input', index=index) world.save_component_and_reopen(step) value = int(world.css_value('input.setting-input', index=index)) assert value >= 0
def set_the_max_attempts(step, max_attempts_set): # on firefox with selenium, the behaviour is different. # eg 2.34 displays as 2.34 and is persisted as 2 index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) world.set_field_value(index, max_attempts_set) world.save_component_and_reopen(step) value = world.css_value('input.setting-input', index=index) assert value != "", "max attempts is blank" assert int(value) >= 0
def set_the_max_attempts(step, max_attempts_set): # on firefox with selenium, the behavior is different. # eg 2.34 displays as 2.34 and is persisted as 2 index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) world.set_field_value(index, max_attempts_set) world.save_component_and_reopen(step) value = world.css_value('input.setting-input', index=index) assert value != "", "max attempts is blank" assert int(value) >= 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)
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 my_change_to_weight_is_persisted(step): world.save_component_and_reopen(step) verify_modified_weight()
def my_display_name_change_is_persisted_on_save(step): world.save_component_and_reopen(step) verify_modified_display_name()
def special_chars_persisted_on_save(step): world.save_component_and_reopen(step) verify_modified_display_name_with_special_chars()
def my_display_name_is_persisted_on_save(step): world.save_component_and_reopen(step) verify_unset_display_name()
def my_change_to_randomization_is_persisted(step): world.save_component_and_reopen(step) verify_modified_randomization()