Example #1
0
    def test_c11220(self):
        log.info("Send contact message in p2p chat with airplane mode")
        menu = Menu(self.driver)
        chat_list = ChatListScreen(self.driver)
        contact = ContactScreen(self.driver)
        chat = ChatScreen(self.driver)
        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.CONTACT],
                   menu.wenums.CHATS)
        contact.tap_contact(self.FRIEND)

        log.info("Verify contact message sent.")
        Verify.true(chat.is_contact_share(self.FRIEND),
                    "No contact message in list")

        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.scroll_down_try()

        log.info("Verify message status updated")
        Verify.true(chat.get_send_status(self.MESSAGE_TYPE),
                    "Message status not updated")
Example #2
0
    def test_c8186(self):
        log.info("Select '{}' images and send it to the private chat".format(
            str(self.SELECT_NUMBER)))
        menu = Menu(self.driver)
        gallery = GalleryScreen(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        profile = OtherProfileScreen(self.driver)
        storage = StorageScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.tap_open_profile()
        profile.open_storage()
        exist_images_in_chat = storage.get_count_images()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.MEDIA], menu.wenums.CHATS,
                   menu.wenums.GO_TO_GALLERY)
        gallery.tap_filter_photo()
        gallery.multiselect(self.SELECT_NUMBER)
        gallery.tap_send_btn()
        chat.tap_open_profile()
        profile.open_storage()

        log.info("Verify '{}' images sent to the chat".format(
            str(self.SELECT_NUMBER)))
        actual = storage.get_count_images(exist_images_in_chat)
        Verify.equals(self.SELECT_NUMBER, actual,
                      "Not all images sent to the chat")
Example #3
0
    def test_c11223(self):
        log.info("Edit message from p2p chat with airplane mode")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.set_chat_msg(self.TEXT_MESSAGE)
        chat.tap_send_btn()
        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.open_context_menu(self.TEXT_MESSAGE)
        chat.tap_context_option(self.CONTEXT_OPTION)
        log.info("Edit message '{}' and set: '{}'".format(self.TEXT_MESSAGE, self.EDIT_MESSAGE))
        chat.set_chat_msg(self.EDIT_MESSAGE)
        chat.tap_send_btn()
        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.scroll_down_try()

        log.info("Verify edited message display")
        Verify.contains(self.EDIT_MESSAGE, chat.get_text_msg(), "No sent message in list")

        log.info("Verify message status updated")
        Verify.true(chat.get_send_status(self.MESSAGE_TYPE), "Message status not updated")
Example #4
0
def parser(client, payload, main_number):
    data = bert.decode(bytes(payload))

    if data[0] == Atom("Profile"):
        contacts = data[3][0][6]
        for field in contacts:
            if field[0] == Atom('Contact') and field[1].split(
                    b'_')[0] == string_to_bytes(main_number):
                log.debug('Main profile found')
                global user_id
                user_id = field[1]
                print(user_id)
        for field in data:
            if field and list == type(field):
                for room in field[0]:
                    if room and list == type(room) and room[0][0] == Atom(
                            'Room'):
                        global room_id
                        room_id = room[-1][1]
                        print(room_id)
        client.publish(topic="events/1//api/anon//",
                       payload=bytearray(history_group(user_id, room_id)),
                       qos=2,
                       retain=False)

    if data[0] == Atom('Message') and data[-1] == Atom('clear'):
        log.debug("Verify history removed")
        for field in data:
            if field and list == type(field) and tuple == type(field[0]):
                Verify.equals(b'History was removed', field[0][3],
                              'No history removed')
        client.disconnect()
Example #5
0
    def test_c11221(self):
        log.info(
            "Send photo without compressing (as a file) with airplane mode")
        menu = Menu(self.driver)
        gallery = GalleryScreen(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.MEDIA], menu.wenums.CHATS,
                   menu.wenums.GO_TO_GALLERY)
        gallery.open_preview_image()
        gallery.open_curtain()
        gallery.tap_send_as_file()

        log.info("Verify media message sent without compressing (as a file)")
        Verify.true(chat.is_file_message_displayed(),
                    "No sent file message in list")

        chat.airplane_mode()
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.scroll_down_try()

        log.info("Verify message status updated")
        Verify.true(chat.get_send_status(self.MESSAGE_TYPE),
                    "Message status not updated")
Example #6
0
    def test_c15395(self):
        log.info(
            "Select '{}' images and send it to the group chat as files".format(
                str(self.SELECT_NUMBER)))
        menu = Menu(self.driver)
        gallery = GalleryScreen(self.driver)
        chat = ChatScreen(self.driver)
        profile = OtherProfileScreen(self.driver)
        storage = StorageScreen(self.driver)
        group_list = GroupListScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        group_list.open_group_chat(self.GROUP_NAME)
        chat.tap_open_profile()
        profile.open_storage()
        exist_images_in_chat = storage.get_sent_files_count()
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        group_list.open_group_chat(self.GROUP_NAME)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.MEDIA], menu.wenums.CHATS,
                   menu.wenums.GO_TO_GALLERY)
        gallery.tap_filter_photo()
        gallery.multiselect(self.SELECT_NUMBER)
        gallery.open_curtain()
        gallery.tap_send_as_file()
        chat.tap_open_profile()
        profile.open_storage()

        log.info("Verify '{}' files sent to the chat".format(
            str(self.SELECT_NUMBER)))
        actual = storage.get_sent_files_count(exist_images_in_chat)
        Verify.equals(self.SELECT_NUMBER, actual,
                      "Not all files sent to the chat")
Example #7
0
    def test_c26409(self):
        log.info("Close avatar preview")
        home = HomeScreen(self.driver)
        home.tap_avatar()
        home.close_avatar()

        log.info("Verify Preview was closed")
        Verify.true(home.is_home_screen_displayed(), "Preview was not closed")
Example #8
0
    def test_c07(self):
        log.info("Login to Nynja APP, set phone number '{}'".format(self.PHONE_NUMBER))
        login = LoginScreen(self.driver)
        login.set_full_number(self.COUNTRY_CODE, self.PHONE_NUMBER)
        login.tap_confirm_btn()

        log.info("Verify user is unauthorized.")
        Verify.true(login.error_verify(error_enums.NOT_ALLOW_NUMBER),
                    "Alert doesn't displayed")
Example #9
0
    def test_c26309(self):
        log.info("Hint about empty search result on the group list screen")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        search.set_search(self.INVALID_GROUP_NAME)

        log.info("Verify Hint about empty search result is shown")
        Verify.true(search.is_no_result_displayed(), "Hint about empty search result is not shown")
Example #10
0
    def test_c26238(self):
        log.info("Hint about empty search result on the chat list screen")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        search.set_search(self.INVALID_FRIEND_NAME.swapcase())

        log.info("Verify Hint about empty search result is shown")
        Verify.true(search.error_verify(error_enums.NO_SEARCH_RESULT), "Hint about empty search result is not shown")
Example #11
0
    def test_c26237(self):
        log.info("Check that search is case insensitive on the Chats List screen")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        search.set_search(self.FRIEND_NAME.swapcase())

        log.info("Verify Particular P2P Chat is in the search result")
        Verify.true(search.is_result_displayed(self.FRIEND_NAME), "Particular P2P Chat is not in the search result")
Example #12
0
    def test_c532(self):
        log.info("Send message in myself")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        chat.set_chat_msg(self.TEXT_MESSAGE)
        chat.tap_send_btn()

        log.info("Verify text message sent.")
        Verify.contains(self.TEXT_MESSAGE, chat.get_text_msg(), "No sent message in list")
Example #13
0
    def test_c26307(self):
        log.info("Search on the group list screen")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        search.set_search(self.GROUP_NAME)

        log.info("Verify group chat is in the search result")
        Verify.true(search.is_result_displayed(self.GROUP_NAME),
                    "Group Chat is not in the search result")
Example #14
0
    def test_c26310(self):
        log.info("Search on the Chat list screen by part of Group name")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        search.set_search(self.PART_GROUP_NAME)

        log.info("Verify Group Chat is in the search result")
        Verify.true(search.is_result_displayed(self.GROUP_NAME),
                    "Group Chat is not in the search result")
Example #15
0
    def test_c26239(self):
        log.info("Search on the Chat list screen by part of user name")
        menu = Menu(self.driver)
        search = SearchScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        search.set_search(self.PART_NAME)

        log.info("Verify Particular P2P Chat is in the search result")
        Verify.true(search.is_result_displayed(self.FRIEND_NAME),
                    "Particular P2P Chat is not in the search result")
Example #16
0
    def test_c534(self):
        log.info("Send message in myself")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        chat.record_voice_msg()
        chat.tap_record_send()

        log.info("Verify voice message sent.")
        Verify.true(chat.is_voice_displayed(), "No sent voice message in list")
Example #17
0
    def test_c25768(self):
        log.info("Send sticker message in myself chat")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        chat.tap_sticker_btn()
        chat.send_first_sticker()

        log.info("Verify sticker message display")
        Verify.true(chat.is_sticker_displayed(), "No sent message in list")
Example #18
0
    def test_tc3(self):
        log.info("DELETE: Publish new message")
        response = Request.delete(config.base_url, base_fb.page_header,
                                  self.msg_id)
        log.debug(response)

        log.info(
            "Verify response consist parameter 'success' with status 'True'")
        Verify.true(response['success'],
                    "The parameter 'success' is not equals to 'True'")
Example #19
0
def parser(client, payload, main_number, mime, message_type=None):
    data = bert.decode(bytes(payload))
    global main_id
    global friend_id
    global chat
    global message_id

    if data[0] == Atom("Profile"):
        for field in data[3][0][6]:
            if field[-1] == Atom('friend'):
                if field[1].split(b'_')[0] == string_to_bytes(main_number):
                    log.debug('Main profile found')
                    main_id = field[1]
                    friend_id = field[1]
                    chat = p2p(from_user=main_id, to=main_id)

        client.publish(topic="events/1//api/anon//",
                       payload=bytearray(
                           message_model(mime,
                                         container=Atom('chain'),
                                         feed_id=chat,
                                         from_user=main_id,
                                         to=main_id)),
                       qos=2,
                       retain=False)

    if data[0] == Atom(
            'Message') and message_type == 'delete for me' and data[-1] == []:
        message_id = data[1]
        client.publish(topic="events/1//api/anon//",
                       payload=bytearray(
                           send_message(main_id, friend_id, chat, mime,
                                        message_id, message_type, main_id)),
                       qos=2,
                       retain=False)

    elif data[0] == Atom('Message') and data[-1] == Atom('delete'):
        log.debug('Verify group patched')
        Verify.true(data[1], "No message ID")
        client.disconnect()

    elif data[0] == Atom('Message'):
        log.debug('Verify group patched')
        Verify.true(data[1], "No message ID")
        client.disconnect()

    elif data == (Atom('io'), (Atom('error'), Atom('invalid_data')), b''):
        log.error("Something going wrong")
        client.disconnect()
        raise InvalidData("Invalid data response")

    if data == (Atom('io'), (Atom('error'), Atom('permission_denied')), b''):
        log.error("Something going wrong")
        client.disconnect()
        raise PermissionDenied("No permission")
Example #20
0
    def test_c1910(self):
        log.info("Open reply screen for replied msg in p2p chat")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FULL_NAME)
        chat.open_replay(self.REPLY_COUNT)

        log.info("Verify reply screen open")
        Verify.true(chat.is_replay_screen(), "Reply screen doesn't display")
Example #21
0
    def test_c1911(self):
        log.info("Open replied screen from first replied msg in group chat")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        group_list = GroupListScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        group_list.open_group_chat(self.GROUP_NAME)
        chat.open_replay(self.REPLY_COUNT)

        log.info("Verify replied screen open")
        Verify.true(chat.is_replay_screen(), "Replied screen doesn't display")
Example #22
0
    def test_c15469(self):
        log.info("Check context menu items on sticker message")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        chat.tap_sticker_btn()
        chat.send_first_sticker()
        chat.open_sticker_context_menu()

        log.info("Verify sticker message context menu items")
        Verify.equals(context_enums.STICKERS_CONTEXT_MENU_ITEMS, chat.get_context_options(), "Items not identical")
Example #23
0
    def test_c25390(self):
        log.info("Open custom gallery from myself")
        menu = Menu(self.driver)
        gallery = GalleryScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.MEDIA], menu.wenums.CHATS,
                   menu.wenums.GO_TO_GALLERY)

        log.info("Verify gallery screen displayed")
        Verify.true(gallery.is_gallery_screen(),
                    "Gallery screen doesn't display")
Example #24
0
    def test_c11239(self):
        log.info("Open stickers board")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND)
        chat.tap_sticker_btn()

        log.info("Verify sticker board open")
        Verify.true(chat.is_sticker_board_display(), "No sticker board")
Example #25
0
    def test_c19133(self):
        log.info("Open stickers board")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        group_list = GroupListScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.ALL])
        group_list.open_group_chat(self.GROUP_NAME)
        chat.tap_sticker_btn()

        log.info("Verify sticker board open")
        Verify.true(chat.is_sticker_board_display(), "No sticker board")
Example #26
0
    def test_c2909(self):
        log.info("Create group with default alias")
        menu = Menu(self.driver)
        group = GroupScreen(self.driver)
        menu.go_to(menu.wenums.GROUPS, [menu.wenums.NEW_GROUP])
        group.add_user(self.FRIEND)
        group.tap_done()

        log.info("Verify alias is match with First / Last name ")
        Verify.true(group.default_alias(self.MY_USERNAME),
                    "Alias doesn't match")
Example #27
0
    def test_c43777(self):
        log.info("Received sticker message from p2p chat")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        chat_list = ChatListScreen(self.driver)
        menu.go_to(menu.wenums.CHATS, [menu.wenums.ALL])
        chat_list.tap_user(self.FRIEND_NAME)
        incoming_message(self.CHAT_TYPE, self.MIME)

        log.info("Verify sticker message received.")
        Verify.true(chat.is_received_sticker_displayed(), "No received sticker message in list")
Example #28
0
    def test_c21568(self):
        log.info("Send sticker message in channel")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        channels = ChannelsListScreen(self.driver)
        menu.go_to(menu.wenums.CHANNELS, [menu.wenums.MY_CHANNELS])
        channels.open_channel(self.CHANNEL_NAME)
        chat.tap_sticker_btn()
        chat.send_first_sticker()

        log.info("Verify sticker message display")
        Verify.true(chat.is_sticker_displayed(), "No sent message in list")
Example #29
0
    def test_c536(self):
        log.info("Send location message")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        location = LocationScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        menu.go_to(menu.wenums.ACTIONS, [menu.wenums.LOCATION],
                   menu.wenums.CHATS)
        location.tap_send_location()

        log.info("Verify location message sent.")
        Verify.true(chat.is_location_displayed(), "No sent message in list")
Example #30
0
    def test_c15468(self):
        log.info("Check context menu items on voice message")
        menu = Menu(self.driver)
        chat = ChatScreen(self.driver)
        menu.go_to(menu.wenums.MYSELF)
        chat.record_voice_msg()
        chat.tap_record_send()
        chat.open_context_menu_last_bubble()

        log.info("Verify context menu items")
        Verify.equals(context_enums.VOICE_CONTEXT_MENU_ITEMS,
                      chat.get_context_options(), "Wrong context menu items")