def test_c16(self): log.info("Add contact by contact book: '{}'".format( config.UKRAINE_FIRSTNAME + ' ' + config.UKRAINE_LASTNAME)) contacts = ByContactsScreen(self.driver) menu = Menu(self.driver) menu.go_to(menu.wenums.CONTACTS, [menu.wenums.NEW_CONTACT, menu.wenums.BY_CONTACTS], menu.wenums.CONTACTS) contacts.tap_add_contact(self.FRIEND) log.info("Verify friend request sent") Verify.true(contacts.requested_check(), "No request sent") menu.long_press_wheel() manage = Manager(self.driver) manage.log_out() nynja_login_screen = LoginScreen(self.driver) nynja_home_screen = HomeScreen(self.driver) nynja_login_screen.set_full_number(self.COUNTRY_CODE, self.PHONE_NUMBER) nynja_login_screen.tap_confirm_btn() nynja_login_screen.set_sms() log.info("Authorised by friend: '{}'".format(self.PHONE_NUMBER)) Verify.true(nynja_home_screen.is_home_screen_displayed(), "Home Screen is not displayed") # TODO: Update contact = self.driver.find_elements_by_xpath( '//XCUIElementTypeCell' '[@name="contact_request_profile_contact_cell"]') log.info('Contacts cell collected') if not contact: raise NoSuchElementException for elem in contact: log.info('We are in elements') if elem.find_element_by_xpath('//XCUIElementTypeStaticText').get_attribute('name') == \ config.CHINA_FIRSTNAME + ' ' + config.CHINA_LASTNAME: log.info('China user find') accept_friend = elem.find_element_by_id('Accept') el = Element(self.driver) el.tap_element(accept_friend) manage.log_out() nynja_login_screen.set_full_number(config.CHINA_COUNTRY_CODE, config.CHINA_NUMBER) nynja_login_screen.tap_confirm_btn() nynja_login_screen.set_sms() log.info("Authorised by main account: '{}'".format( config.CHINA_NUMBER)) Verify.true(nynja_home_screen.is_home_screen_displayed(), "Home Screen is not displayed")
def test_c13(self): log.info("Login to Nynja APP, set phone number '{}'".format( self.PHONE_NUMBER)) login = LoginScreen(self.driver) home = HomeScreen(self.driver) login.set_full_number(self.COUNTRY_CODE, self.PHONE_NUMBER) login.tap_confirm_btn() login.set_sms() log.info("Verify user is authorized successfully.") Verify.true(home.is_home_screen_displayed(), "Home Screen is not displayed")
def test_c26(self): log.info("Set avatar photo") home = HomeScreen(self.driver) profile = ProfileScreen(self.driver) gallery = GalleryScreen(self.driver) menu = Menu(self.driver) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.EDIT_PROFILE, menu.wenums.MY_PHOTO], menu.wenums.CHATS) profile.tap_photo_form_gallery() gallery.select_avatar() profile.tap_accept_photo() log.info("Verify avatar photo is updated successfully.") Verify.true(home.is_avatar_updated(), "The avatar photo is not updated")
def test_c25388(self): log.info("Send schedule text message in p2p chat") menu = Menu(self.driver) home = HomeScreen(self.driver) chat = ChatScreen(self.driver) menu.go_to(menu.wenums.MYSELF) chat.set_chat_msg(self.SCHEDULE_MESSAGE) chat.create_scheduled_message() chat.tap_save() menu.long_press_wheel() log.info("Verify schedule text message created") Verify.true(home.is_schedule_display(self.SCHEDULE_MESSAGE), "Schedule message doesn't create")
def test_c4098(self): log.info("Send schedule text message in p2p chat") menu = Menu(self.driver) home = HomeScreen(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) chat.set_chat_msg(self.SCHEDULE_MESSAGE) chat.create_scheduled_message() chat.tap_save() menu.long_press_wheel() log.info("Verify schedule text message created") Verify.true(home.is_schedule_display(self.SCHEDULE_MESSAGE), "Schedule message doesn't create")
def test_c19(self): log.info("Keep old Username after update") home = HomeScreen(self.driver) profile = MyUsernameScreen(self.driver) menu = Menu(self.driver) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.EDIT_PROFILE, menu.wenums.MY_USERNAME], menu.wenums.CHATS) profile.set_username(self.NEW_USERNAME) profile.tap_keep_btn() home.is_home_screen_displayed() log.info("Verify username is not updated") Verify.true(home.is_profile_updated(self.ACTUAL_USERNAME), "The username updated")
def test_c18(self): log.info("Add Username") home = HomeScreen(self.driver) profile = MyUsernameScreen(self.driver) menu = Menu(self.driver) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.EDIT_PROFILE, menu.wenums.MY_USERNAME], menu.wenums.CHATS) profile.set_username(self.NEW_USERNAME) profile.tap_done_btn() home.is_home_screen_displayed() log.info("Verify username is added successfully.") Verify.true(home.is_profile_updated(self.NEW_USERNAME), "The names are not updated")
def test_c4099(self): log.info("Send schedule text message in group chat") menu = Menu(self.driver) home = HomeScreen(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.set_chat_msg(self.SCHEDULE_MESSAGE) chat.create_scheduled_message() chat.tap_save() menu.long_press_wheel() log.info("Verify schedule text message created") Verify.true(home.is_schedule_display(self.SCHEDULE_MESSAGE), "Schedule message doesn't create")
def test_c26444(self): log.info("Unstar message: '{}'".format(self.STARED_MESSAGE)) main = HomeScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(self.driver) menu.go_to(menu.wenums.MYSELF) chat.set_chat_msg(self.STARED_MESSAGE) chat.tap_send_btn() chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_option(context_enums.STAR) chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_option(context_enums.UNSTAR) menu.long_press_wheel() log.info("Verify stared message doesn't display on home screen") Verify.false(main.is_starred_displayed(self.STARED_MESSAGE), "Starred message still displayed")
def test_c26943(self): log.info("Star message: '{}'".format(self.CHAT_NAME)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) 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() chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared voice message displayed on star screen") Verify.true(star.is_message_star_displayed(self.CHAT_NAME, self.VOICE), "No starred voice message on screen")
def test_c23(self): log.info("Edit First and Last names") menu = Menu(self.driver) home = HomeScreen(self.driver) profile = MyNameScreen(self.driver) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.EDIT_PROFILE, menu.wenums.MY_NAME], menu.wenums.CHATS) profile.set_first_name(self.NEW_FIRST_NAME) profile.set_last_name(self.NEW_LAST_NAME) profile.tap_done_btn() home.is_home_screen_displayed() log.info("Verify first and last names are updated successfully.") Verify.true(home.is_profile_updated(self.NEW_FIRST_NAME), "The names are not updated")
def test_c20(self): log.info("Edit Username") home = HomeScreen(self.driver) profile = MyUsernameScreen(self.driver) menu = Menu(self.driver) self.driver.find_element(*(By.ID, self.OLD_USERNAME)) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.EDIT_PROFILE, menu.wenums.MY_USERNAME], menu.wenums.CHATS) profile.set_username(self.EDIT_USERNAME) profile.tap_done_btn() home.is_home_screen_displayed() log.info("Verify username is updated successfully.") Verify.true(home.is_profile_updated(self.EDIT_USERNAME), "The names are not updated")
def test_c26418(self): log.info("Star message: '{}'".format(config.STARED_MESSAGE)) main = HomeScreen(self.driver) 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.set_chat_msg(self.STARED_MESSAGE) chat.tap_send_btn() chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_star() menu.long_press_wheel() main.tap_stared_msg(self.STARED_MESSAGE) log.info("Verify that message stared") Verify.true(chat.stared_present(), "No starred messages on screen")
def test_c12(self): login = LoginScreen(self.driver) home = HomeScreen(self.driver) log.info("Registration with valid data: '{}'".format(self.PHONE_NUMBER)) if not self.driver.find_elements(*RegistrationPageLocators.CHECK_PAGE): login.set_full_number(self.COUNTRY_CODE_NUMBER, self.PHONE_NUMBER) login.tap_confirm_btn() login.set_sms() login.set_first_name(self.FIRST_NAME) login.set_last_name(self.LAST_NAME) login.tap_done_btn() log.info("Verify user is registered successfully.") Verify.true(home.is_home_screen_displayed(), "Home Screen is not displayed") manage = Manager(self.driver) manage.log_out()
def test_c26443(self): log.info("Star message: '{}'".format(self.STARED_MESSAGE)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(self.driver) menu.go_to(menu.wenums.MYSELF) chat.set_chat_msg(self.STARED_MESSAGE) chat.tap_send_btn() chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared message displayed on star screen") Verify.true(star.is_starred_message_displayed(self.STARED_MESSAGE), "No starred messages on screen")
def test_c17(self): log.info("Accept friend request from : '{}'".format( config.CHINA_NUMBER)) manage = Manager(self.driver) manage.log_out() nynja_login_screen = LoginScreen(self.driver) nynja_home_screen = HomeScreen(self.driver) nynja_login_screen.set_full_number(self.COUNTRY_CODE, self.PHONE_NUMBER) nynja_login_screen.tap_confirm_btn() nynja_login_screen.set_sms() log.info("Authorised by friend: '{}'".format(self.PHONE_NUMBER)) Verify.true(nynja_home_screen.is_home_screen_displayed(), "Home Screen is not displayed") contact = self.driver.find_elements_by_xpath( '//XCUIElementTypeCell' '[@name="contact_request_profile_contact_cell"]') log.info('Contacts cell collected') if not contact: raise NoSuchElementException for elem in contact: log.info('We are in elements') if elem.find_element_by_xpath('//XCUIElementTypeStaticText').get_attribute('name') == \ config.CHINA_FIRSTNAME + ' ' + config.CHINA_LASTNAME: log.info('China user find') accept_friend = elem.find_element_by_id('Accept') el = Element(self.driver) el.tap_element(accept_friend) manage.log_out() nynja_login_screen.set_full_number(config.CHINA_COUNTRY_CODE, config.CHINA_NUMBER) nynja_login_screen.tap_confirm_btn() nynja_login_screen.set_sms() log.info("Authorised by main account: '{}'".format( config.CHINA_NUMBER)) Verify.true(nynja_home_screen.is_home_screen_displayed(), "Home Screen is not displayed")
def test_c26945(self): log.info("Star location message: '{}'".format(self.CHAT_NAME)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) 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() chat.open_context_menu_last_bubble() chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared location message displayed on star screen") Verify.true(star.is_message_star_displayed(self.CHAT_NAME, self.LOCATION), "No starred location message on screen")
def test_c26447(self): log.info("Unstar message: '{}'".format(self.STARED_MESSAGE)) main = HomeScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(self.driver) star = StarredScreen(self.driver) menu.go_to(menu.wenums.MYSELF) chat.set_chat_msg(self.STARED_MESSAGE) chat.tap_send_btn() chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_option(context_enums.STAR) menu.long_press_wheel() main.open_starred_section() star.open_context(self.STARED_MESSAGE) log.info("Verify Unstar context menu displayed") Verify.true(star.is_context_option_unstar_displayed(), "Unstar context menu doesn't display")
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")
def test_c26930(self): log.info("Star media message: '{}'".format(self.CHAT_NAME)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) 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) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.MEDIA], menu.wenums.CHATS) menu.tap_first_media() chat.open_context_menu_last_bubble() chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared media message displayed on star screen") Verify.true(star.is_message_star_displayed(self.CHAT_NAME, self.MEDIA), "No starred media message on screen")
def test_c26948(self): log.info("Star contact message: '{}'".format(self.CHAT_NAME)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(self.driver) contact = ContactScreen(self.driver) menu.go_to(menu.wenums.MYSELF) menu.go_to(menu.wenums.ACTIONS, [menu.wenums.CONTACT], menu.wenums.CHATS) contact.tap_contact(self.FRIEND_NAME) chat.open_context_menu_last_bubble() chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared contact message displayed on star screen") Verify.true( star.is_message_star_displayed(self.CHAT_NAME, self.CONTACT), "No starred contact message on screen")
def test_c26422(self): log.info("Unstar message: '{}'".format(self.STARED_MESSAGE)) main = HomeScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(self.driver) star = StarredScreen(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.set_chat_msg(self.STARED_MESSAGE) chat.tap_send_btn() chat.open_context_menu(self.STARED_MESSAGE) chat.tap_context_option(context_enums.STAR) menu.long_press_wheel() main.open_starred_section() star.unstar_message(self.STARED_MESSAGE) log.info("Verify stared message doesn't display on starred screen") Verify.false(star.is_starred_message_displayed(self.STARED_MESSAGE), "Starred message still displayed")
def test_c26947(self): log.info("Star file message: '{}'".format(self.CHAT_NAME)) main = HomeScreen(self.driver) star = StarredScreen(self.driver) menu = Menu(self.driver) chat = ChatScreen(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) gallery.open_preview_image() gallery.open_curtain() gallery.tap_send_as_file() chat.open_context_menu_last_bubble() chat.tap_context_star() menu.long_press_wheel() main.open_starred_section() log.info("Verify stared file message displayed on star screen") Verify.true(star.is_message_star_displayed(self.CHAT_NAME, self.FILE), "No starred file message on screen")