def run(self,browser,logger): auth = AuthForm(self.browser, self.logger) window = BrowserWindow(self.browser,self.logger) navigation = Navigation(self.browser,self.logger) questionary = Questionary(self.browser,self.logger) self.do_method(auth.login_with_fb_full_scale,profiling_events.login_event,auth.User1) navigation.goto_top_menu_item(u"Профиль") questionary.expand() questionary.hide() questionary.expand() questionary.cancel() questionary.expand() questionary.uncheck_all_countries() questionary.save() questionary.validate_error_msg_wrong_data() questionary.fill_first_14_elements() questionary.save() questionary.validate_error_msg_answers_not_enough() questionary.check_dropdowns_to_input_transformation() questionary.fill_all() questionary.save() questionary.validate_saved_correctly() navigation.goto_top_menu_item(u"Профиль") questionary.expand() questionary.validate_filled_all() questionary.unfill_all() questionary.save() window.close()
def run(self, browser, logger): self.browser = browser self.logger = logger window = BrowserWindow(browser, logger) auth = AuthForm(browser,logger) navigation = Navigation(browser,logger) profile = Profile(browser,logger) filter = Filters(browser,logger) marks = Marks(browser,logger) window.open(settings.target_url) # implement URL check self.do_method(auth.login_with_vk_full_scale,profiling_events.login_event,auth.FilterUserNonVipVK) profile.set_age(self.age_min) navigation.goto_main_top_menu_item(u"Знакомства") filter.init_age_filter() filter.drag_left_age_search_slider_to_max() sleep(5) for age in reversed(range(self.age_max_max-self.age_max_min)): filter.init_age_filter() filter.drag_right_age_search_slider_backward() sleep(5) filter.validate_search_users_in_search_age(filter.get_age_search_interval_list()) profile.set_age(auth.FilterUserNonVipVK.age) window.close()
def run(self,browser,logger): self.browser = browser self.logger = logger window = BrowserWindow(browser, logger) auth = AuthForm(browser,logger) navigation = Navigation(browser,logger) profile = Profile(browser,logger) filter = Filters(browser,logger) marks = Marks(browser,logger) window.open(settings.target_url) # implement URL check self.do_method(auth.login_with_vk_full_scale,profiling_events.login_event,auth.FilterUserNonVipVK) for age in self.ages_list: self.logger.log("For age = " + str(age) + " search age interval = " + str(self.ages_list[age])) profile.set_age(age) navigation.goto_main_top_menu_item(u"Знакомства") navigation.validate_in_search() filter.init_age_filter() filter.drag_right_age_search_slider_to_max() filter.drag_right_age_search_slider_to_min() filter.validate_search_users_in_search_age(filter.get_age_search_interval_list()) if self.ages_list[age] != filter.get_age_search_interval_value(): raise TestFailedException("Wrong mininal age search interval") profile.set_age(auth.FilterUserNonVipVK.age) window.close()
def run(self,browser,logger): auth = AuthForm(browser,logger) filter = Filters(browser,logger) navigation = Navigation(browser,logger) window = BrowserWindow(browser, logger) window.open(settings.target_url) self.do_method(auth.login_with_vk_full_scale,profiling_events.login_event,auth.FilterUserNonVipVK) navigation.goto_main_top_menu_item(u"Знакомства") filter.init_age_filter() if filter.get_age_search_interval_value() < self.minimal_age_interval: filter.drag_left_age_search_slider_to_min() sleep(5) filter.drag_right_age_search_slider_to_max() filter.close_age() filter.select_online() for sex in range(self.sexes_amount): filter.change_sex() for goal in filter.get_goals(): filter.select_goal(goal) # checking for validate_user_amount filter is working self.logger.log("Validating users in search box") filter.validate_in_search_goal(goal=goal,online=True) filter.change_sex() window.close()
def set_age(self,age): navigation = Navigation(self.browser,self.logger) navigation.goto_top_menu_item(u"Профиль") navigation.goto_tab_menu_item(u"Настройки") self.enter_text( self.get_element_by_id(self._form_age_settings_id), age) self.click( self.get_element_by_id(self._save_setting_button_id))
def run(self,browser,logger): auth = AuthForm(browser,logger) filter = Filters(browser,logger) navigation = Navigation(browser,logger) window = BrowserWindow(browser, logger) window.open(settings.target_url) self.do_method(auth.login_with_vk_full_scale,profiling_events.login_event,auth.FilterUserNonVipVK) navigation.goto_main_top_menu_item(u"Знакомства") filter.init_age_filter() if filter.get_age_search_interval_value() < self.minimal_age_interval: filter.drag_left_age_search_slider_to_min() sleep(5) filter.drag_right_age_search_slider_to_max() filter.close_age()
def get_answered_messages(self,auhors): navigation = Navigation(self.browser,self.logger) navigation.goto_side_menu_item(u"Сообщения") answered_users = [] has_more = True while has_more: try: click4more = self.wait4xpath(settings.wait_for_element_time,self._feed_click4more_xpath) click4more.click() except Exception as e: print "Couldn't find more on feed: " + e.message has_more = False if not has_more: all_authors = self.wait4xpath_s(settings.wait_for_element_time,self._feed_profile_links_xpath) print "All messages amount = " + str(len(all_authors)) self.logger.log("All messages amount = " + str(len(all_authors))) for user in auhors: if user in all_authors: answered_users.append(user) return answered_users else: return None
def get_mutual_profiles(self): """ get user profiles list from feed 'Взаимно' """ navigation = Navigation(self.browser,self.logger) navigation.goto_side_menu_item(u"Взаимно") has_more = True while has_more: try: click4more = self.wait4xpath(settings.wait_for_element_time,self._feed_click4more_xpath) click4more.click() except Exception as e: print "Couldn't find more on feed: " + e.message has_more = False if not has_more: mutual_users_links = self.wait4xpath_s(settings.wait_for_element_time,self._feed_profile_links_xpath) print "Mutual users links amount = " + str(len(mutual_users_links)) output_profiles = [] for user_link in mutual_users_links: output_profiles.append(user_link.get_attribute("href")) return output_profiles else: return None
def run(self, browser, logger): auth = AuthForm(self.browser, self.logger) window = BrowserWindow(self.browser, self.logger) navigation = Navigation(self.browser, self.logger) messenger = Messenger(self.browser, self.logger) output_message = u"Привет!" self.do_method(auth.login_with_fb_full_scale, profiling_events.login_event, auth.User1) window.open(auth.User2.profile_url) navigation.goto_messenger_from_profile() # No UI validation self._root_window = self.browser.current_window_handle messenger.send_and_validate_message(output_message) window.switch_to_popup() navigation.goto_side_menu_item(u"Сообщения") navigation.goto_tab_menu_item(u"Отправленные") messenger.delete_last_message_from_output_feed_fb(output_message) window.close()
def run(self, browser, logger): auth = AuthForm(self.browser, self.logger) window = BrowserWindow(self.browser, self.logger) navigation = Navigation(self.browser, self.logger) messenger = Messenger(self.browser, self.logger) print "User 1 message validation finished successfully" output_message = u"Привет!" self.do_method( auth.login_with_fb_full_scale, profiling_events.events[profiling_events.login_event], auth.User2 ) sleep(2) navigation.goto_side_menu_item(u"Сообщения") sleep(2) navigation.validate_in_tab(u"Новые") messenger.validate_last_message_in_feed_fb(output_message) navigation.goto_tab_menu_item(u"Входящие") messenger.validate_last_message_in_feed_fb(output_message) window.close()
def run(self, browser, logger): auth = AuthForm(self.browser, self.logger) window = BrowserWindow(self.browser,self.logger) navigation = Navigation(self.browser,self.logger) profile = Profile(self.browser,self.logger) vip_popup = VIPPopups(self.browser,self.logger) self.do_method(auth.login_with_fb_full_scale,profiling_events.login_event,auth.User1) navigation.goto_top_menu_item(u"Профиль") profile.validate_profile_view() self.logger.log("Profile view is validated") navigation.goto_tab_menu_item(u"Настройки") profile.validate_settings_view() self.logger.log("Settings view is validated") navigation.goto_tab_menu_item(u"Уведомления") profile.validate_notifications_view() self.logger.log("Notifications view is validated") navigation.goto_tab_menu_item(u"Фото") profile.validate_photo_view() self.logger.log("Photo view is validated") navigation.goto_tab_menu_item(u"Поклонники") vip_popup.validate_forbidden_nonvip() self.browser.back() navigation.goto_tab_menu_item(u"Гости") vip_popup.validate_forbidden_nonvip() self.browser.back() navigation.goto_tab_menu_item(u"Гороскоп") profile.validate_horo_view() # logout and login with another user to mark that user again to fix the profile marks reset self.logger.log("End profile navigation") window.close()