def remove_story(step, title): for projectstory_form in world.browser.find_by_css('.dynamic-projectstory_set'): projectstory_id = projectstory_form['id'] if world.option_selected_by_text("%s-story" % projectstory_id, title): world.browser.check("%s-DELETE" % projectstory_id) return True raise ElementDoesNotExist, "Could not find associated story with title %s" % title
def change_story_weight(step, title, weight): for projectstory_form in world.browser.find_by_css('.dynamic-projectstory_set'): projectstory_id = projectstory_form['id'] if world.option_selected_by_text("%s-story" % projectstory_id, title): world.browser.fill("%s-weight" % projectstory_id, weight) return True raise ElementDoesNotExist, "Could not find associated story with title %s" % title