def click_delete_update_button(self): """ Clicks the delete update post button and confirms the delete notification. """ click_css(self, '.post-preview .delete-button', require_notification=False) confirm_prompt(self)
def click_delete_button(self, xblock_id, confirm=True): """ Click on the delete button for the given XBlock """ self._action_btn_for_xblock_id(xblock_id, "delete").click() if confirm: confirm_prompt(self) # this will also sync_on_notification() self.wait_for_ajax()
def discard_changes(self): """ Discards draft changes (which will then re-render the page). """ self.scroll_to_element('a.action-discard') click_css(self, 'a.action-discard', 0, require_notification=False) confirm_prompt(self) self.wait_for_ajax()
def delete(self, source_index): """ Delete the item with index source_index (based on vertical placement in page). Only visible items are counted in the source_index. The index of the first item is 0. """ # Click the delete button click_css(self, '.delete-button', source_index, require_notification=False) # Click the confirmation dialog button confirm_prompt(self)
def click_leave_team_link(self, remaining_members=0, cancel=False): """ Click on Leave Team link""" leave_team_css = '.leave-team-link' self.scroll_to_element(leave_team_css) self.wait_for_element_visibility(leave_team_css, 'Leave Team link is visible.') click_css(self, leave_team_css, require_notification=False) confirm_prompt(self, cancel, require_notification=False) if cancel is False: self.wait_for( lambda: self.join_team_button_present, description="Join Team button did not become present") self.wait_for_capacity_text(remaining_members)
def toggle_staff_lock(self, inherits_staff_lock=False): """ Toggles "hide from students" which enables or disables a staff-only lock. Returns True if the lock is now enabled, else False. """ was_locked_initially = self.is_staff_locked if not was_locked_initially: self.q(css='a.action-staff-lock').first.click() else: click_css(self, 'a.action-staff-lock', 0, require_notification=False) if not inherits_staff_lock: confirm_prompt(self) self.wait_for_ajax() return not was_locked_initially
def cancel_delete_membership_dialog(self): """Click 'delete' on the warning dialog.""" confirm_prompt(self, cancel=True)
def confirm_delete_membership_dialog(self): """Click 'delete' on the warning dialog.""" confirm_prompt(self, require_notification=False) self.wait_for_ajax()
def delete(self): """ Delete the group configuration. """ self.find_css('.actions .delete').first.click() confirm_prompt(self.page)
def delete_static_tab(self): """ Deletes a static page """ click_css(self, '.btn-default.delete-button.action-button', require_notification=False) confirm_prompt(self)
def delete(self, cancel=False): """ Clicks the delete button, then cancels at the confirmation prompt if cancel is True. """ click_css(self, self._bounded_selector('.delete-button'), require_notification=False) confirm_prompt(self, cancel)