def test_Auth_VK_TRB(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_css_selector( "button.navbar-toggle.collapsed").click() wd.find_element_by_link_text("Главная").click() wd.find_element_by_link_text("войти").click() wd.find_element_by_xpath("//a[contains(@onclick,'VKontakte')]").click() wd.find_element_by_css_selector( "a.bx-ss-button.vkontakte-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("login") wd.find_element_by_name("pass").clear() wd.find_element_by_name("pass").send_keys("password") wd.find_element_by_id("install_allow").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_link_text("Кампании").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Reg_PR_by_FB(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("Присоединиться к сообществу").click() wd.find_element_by_xpath("//label[@for='i-prPOPUP']").click() if not wd.find_element_by_id("i-prPOPUP").is_selected(): wd.find_element_by_id("i-prPOPUP").click() wd.find_element_by_xpath("//a[contains(@onclick,'Facebook')]").click() wd.find_element_by_css_selector( "a.bx-ss-button.facebook-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_id("email").click() wd.find_element_by_id("email").clear() wd.find_element_by_id("email").send_keys( "*****@*****.**") wd.find_element_by_id("pass").click() wd.find_element_by_id("pass").clear() wd.find_element_by_id("pass").send_keys("Lastchance") wd.find_element_by_id("u_0_0").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_link_text("Кампании").click() wd.find_element_by_link_text("Дополнительные параметры").click() wd.find_element_by_link_text("Блогеры").click() wd.find_element_by_link_text("Дополнительные параметры").click() wd.find_element_by_link_text("Kalitina Irina").click() wd.find_element_by_link_text("Личная страница").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Auth_twitter_TRB(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_css_selector( "button.navbar-toggle.collapsed").click() wd.find_element_by_link_text("Главная").click() wd.find_element_by_link_text("войти").click() wd.find_element_by_xpath("//a[contains(@onclick,'Twitter')]").click() wd.find_element_by_css_selector( "a.bx-ss-button.twitter-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_id("username_or_email").clear() wd.find_element_by_id("username_or_email").send_keys( "*****@*****.**") wd.find_element_by_id("password").clear() wd.find_element_by_id("password").send_keys("11043212") wd.find_element_by_id("allow").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_link_text("Кампании").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Reg_bloger_by_VK(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("Присоединиться к сообществу").click() wd.find_element_by_css_selector( "label.radio-inline.form-register__user-type__label ").click() if not wd.find_element_by_id("i-blogerPOPUP").is_selected(): wd.find_element_by_id("i-blogerPOPUP").click() wd.find_element_by_xpath("//a[contains(@onclick,'VKontakte')]").click() wd.find_element_by_css_selector( "a.bx-ss-button.vkontakte-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("login") wd.find_element_by_name("pass").clear() wd.find_element_by_name("pass").send_keys("password") wd.find_element_by_id("install_allow").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Campaign_response(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("войти").click() wd.find_element_by_xpath("//a[contains(@onclick,'Facebook')]").click() wd.find_element_by_css_selector( "a.bx-ss-button.facebook-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_id("email").click() wd.find_element_by_id("email").clear() wd.find_element_by_id("email").send_keys( "*****@*****.**") wd.find_element_by_id("pass").click() wd.find_element_by_id("pass").clear() wd.find_element_by_id("pass").send_keys("Lastchance") wd.find_element_by_id("u_0_0").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_link_text("Павлова Анна").click() wd.find_element_by_link_text("Мои PR-кампании").click() wd.find_element_by_link_text("Хочу принять участие").click() wd.find_element_by_link_text("Вы откликнулись (1)").click() wd.find_element_by_link_text("Отменить заявку").click() wd.find_element_by_link_text("Вы откликнулись (1)").click() wd.find_element_by_xpath( "//div[@id='tab3']//a[.='Отменить заявку']").click() wd.find_element_by_link_text("Кампании").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Reg_PR_by_VK(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("Присоединиться к сообществу").click() wd.find_element_by_xpath("//label[@for='i-prPOPUP']").click() if not wd.find_element_by_id("i-prPOPUP").is_selected(): wd.find_element_by_id("i-prPOPUP").click() wd.find_element_by_xpath("//a[contains(@onclick,'VKontakte')]").click() wd.find_element_by_css_selector("a.bx-ss-button.vkontakte-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("login") wd.find_element_by_name("pass").clear() wd.find_element_by_name("pass").send_keys("password") wd.find_element_by_id("install_allow").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_xpath("//div[@class='live-sourse']/label[2]").click() if not wd.find_element_by_xpath("//div[@class='live-sourse']/label[2]/input").is_selected(): wd.find_element_by_xpath("//div[@class='live-sourse']/label[2]/input").click() wd.find_element_by_xpath("//div[@class='live-sourse']/label[3]").click() if not wd.find_element_by_xpath("//div[@class='live-sourse']/label[3]/input").is_selected(): wd.find_element_by_xpath("//div[@class='live-sourse']/label[3]/input").click() wd.find_element_by_link_text("Вся лента новостей").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)
def test_Advertisers(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") self.assertIn("TOP RUSSIAN BLOGGERS", wd.title) wd.find_element_by_css_selector( "button.navbar-toggle.collapsed").click() wd.find_element_by_link_text("Рекламодателям").click() wd.find_element_by_link_text("Тарифы на услуги").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.get("https://toprussianbloggers.ru/upload/docs/prices.pdf") wd.find_element_by_id("download").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.get("https://toprussianbloggers.ru/adv/") wd.find_element_by_link_text("Технические требования").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_id("download").click() myWait() for handle in wd.window_handles: wd.switch_to.window(handle) wd.get("https://toprussianbloggers.ru/adv/") wd.find_element_by_link_text("заполните форму").click() wd.find_element_by_id("form-1-NAME").click() wd.find_element_by_id("form-1-NAME").clear() wd.find_element_by_id("form-1-NAME").send_keys("Мария") wd.find_element_by_id("form-1-PHONE").click() wd.find_element_by_id("form-1-PHONE").clear() wd.find_element_by_id("form-1-PHONE").send_keys("+79154563282") wd.find_element_by_id("form-1-EMAIL").click() wd.find_element_by_id("form-1-EMAIL").clear() wd.find_element_by_id("form-1-EMAIL").send_keys("*****@*****.**") wd.find_element_by_id("form-1-MESSAGE").click() wd.find_element_by_id("form-1-MESSAGE").clear() wd.find_element_by_id("form-1-MESSAGE").send_keys("Добрый день") wd.find_element_by_id("form-1-NAME").click() wd.find_element_by_id("form-1-NAME").clear() wd.find_element_by_id("form-1-NAME").send_keys("Мария (тест)") wd.find_element_by_id("form-1-MESSAGE").click() wd.find_element_by_xpath( "//div[@class='form-body']//button[normalize-space(.)='Отправить']" ).click() wd.find_element_by_css_selector("button.close").click() wd.find_element_by_css_selector( "button.navbar-toggle.collapsed").click() wd.find_element_by_link_text("Главная").click() self.assertTrue(success)
def test_Reg_bloger_by_Twitter(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("Присоединиться к сообществу").click() wd.find_element_by_css_selector("label.radio-inline.form-register__user-type__label ").click() if not wd.find_element_by_id("i-blogerPOPUP").is_selected(): wd.find_element_by_id("i-blogerPOPUP").click() wd.find_element_by_xpath("//a[contains(@onclick,'Twitter')]").click() wd.find_element_by_css_selector("a.bx-ss-button.twitter-button").click() for handle in wd.window_handles: wd.switch_to.window(handle) wd.find_element_by_id("username_or_email").clear() wd.find_element_by_id("username_or_email").send_keys("*****@*****.**") wd.find_element_by_id("password").clear() wd.find_element_by_id("password").send_keys("11043212") wd.find_element_by_id("allow").click() self.assertTrue(success) myWait() for handle in wd.window_handles: wd.switch_to.window(handle)
def test_Personal_profile_2(self): success = True wd = self.wd wd.get("https://toprussianbloggers.ru/") wd.find_element_by_link_text("войти").click() wd.find_element_by_id("system-auth-form-login").click() wd.find_element_by_id("system-auth-form-login").clear() wd.find_element_by_id("system-auth-form-login").send_keys( "*****@*****.**") wd.find_element_by_id("system-auth-form-password").click() wd.find_element_by_id("system-auth-form-password").clear() wd.find_element_by_id("system-auth-form-password").send_keys("123456") wd.find_element_by_xpath( "//div[@class='modal-body']/form/div[4]/input").click() myWait() wd.find_element_by_link_text("Maria").click() wd.find_element_by_link_text("Личная страница").click() wd.find_element_by_id("WORK_WWW").click() wd.find_element_by_id("WORK_WWW").clear() wd.find_element_by_id("WORK_WWW").send_keys() wd.find_element_by_id("WORK_WWW").click() wd.find_element_by_id("WORK_WWW").clear() wd.find_element_by_id("WORK_WWW").send_keys("toprussianbloggers.ru") wd.find_element_by_xpath( "//form[@id='lk_form']//button[.='Сохранить изменения']").click() wd.find_element_by_link_text("Maria").click() wd.find_element_by_link_text("Друзья").click() wd.find_element_by_link_text("Вы подписаны (0)").click() wd.find_element_by_link_text("Вы отправили заявку (0)").click() wd.find_element_by_name("EMAIL").click() wd.find_element_by_name("EMAIL").clear() wd.find_element_by_name("EMAIL").send_keys( "*****@*****.**") wd.find_element_by_xpath( "//div[@class='js-container-child']//button[.='Отправить']").click( ) wd.find_element_by_link_text("Maria").click() wd.find_element_by_link_text("Сообщения").click() wd.find_element_by_css_selector( "span.bx-messenger-input-search-create").click() wd.find_element_by_css_selector( "a.popup-window-close-icon.popup-window-titlebar-close-icon" ).click() wd.find_element_by_link_text("Мои PR-кампании").click() self.assertIn("Мои кампании", wd.title) wd.find_element_by_link_text("Добавить новую кампанию").click() wd.find_element_by_link_text("Maria").click() wd.find_element_by_link_text("Подписка").click() self.assertIn("Настройка уведомлений", wd.title) wd.find_element_by_css_selector("label.js-notify-messages").click() if wd.find_element_by_id("personal").is_selected(): wd.find_element_by_id("personal").click() wd.find_element_by_css_selector("button.btn").click() wd.find_element_by_link_text("Maria").click() wd.find_element_by_link_text("Платные услуги").click() wd.find_element_by_link_text("История платежей").click() wd.find_element_by_link_text("Maria").click() wd.find_element_by_xpath( "//div[@class='auth-user__personal-overflow']/div[1]/a").click() wd.find_element_by_link_text("Выйти").click() self.assertTrue(success)