def create_conversation_internal(context): create_message_external_to_internal(context) signed_in_internal(context) inbox_internal.go_to_using_context(context) go_to_thread() create_message_internal.enter_text_in_message_body('Body') create_message_internal.click_message_send_button()
def create_and_close_message_internal_to_external(context, subject='Subject', body='Body'): create_message_internal_to_external(context, subject=subject, body=body) inbox_internal.go_to_using_context(context) go_to_thread() create_message_internal.click_close_conversation_button() create_message_internal.click_confirm_close_conversation_button()
def external_user_reply_sent_to_correct_team(context): signed_in_internal(context) go_to_using_context(context) go_to_thread_internal() latest_message_body = page_helpers.get_body_from_last_message() assert latest_message_body == 'Reply body from respondent'
def close_and_reopen_a_conversation(context): create_and_close_message_internal_to_external(context, 'Message to ONS', 'Message body to ONS') inbox_internal.go_to_using_context(context, 'closed') internal_conversation_view.go_to_thread() create_message_internal.click_reopen_conversation_button()
def reply_to_first_message_in_message_box(context): inbox_internal.go_to_using_context(context, 'open') go_to_thread() create_message_internal.enter_text_in_message_body( 'Body of reply from ONS internal user') create_message_internal.click_message_send_button()
def internal_user_can_view_closed_message(context): inbox_internal.go_to_using_context(context, 'closed') go_to_thread()
def internal_user_can_view_open_message(context): inbox_internal.go_to_using_context(context, 'open') go_to_thread()
def internal_user_taken_to_specific_tab_and_page(context, conversation_tab, page): inbox_internal.go_to_using_context(context, conversation_tab) for _ in range(1, int(page)): wait_for_element_by_class_name(name='next', timeout=5, retry=1) browser.driver.find_element_by_class_name('next').click()
def conversation_in_my_messages_list(context): inbox_internal.go_to_using_context(context, 'my messages') assert len(inbox_internal.get_messages()) > 0
def conversation_in_open_list(context): inbox_internal.go_to_using_context(context, 'open') assert len(inbox_internal.get_messages()) > 0
def no_messages_in_closed_list(context): inbox_internal.go_to_using_context(context, 'closed') assert inbox_internal.get_no_closed_conversations_text()
def message_in_closed_list(context): inbox_internal.go_to_using_context(context, 'closed') assert len(inbox_internal.get_messages()) == 1