def edit_profile_info(driver): test = hc_command() config = configparser.ConfigParser() config.read('config.ini') temp = config['USER INFO']['email'] password = "******" driver.get(test.site()) driver.execute_script("$nuxt.$loading = { };") driver.implicitly_wait(10) #Изменение основной информации test.signin_parametr(driver, temp, password) test.setting(driver) test.add_profile_info(driver) #Проверка информации о пользователе browser = browsers() browser.quit_browser(driver) #browser = browsers() #driver = browser.chrome() #edit_profile_info(driver)
def knowledge(driver): test = hc_command() config = configparser.ConfigParser() config.read('config.ini') temp = config['USER INFO']['email'] password = "******" driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.signin_parametr(driver, temp, password) test.knowledge_search_field(driver) test.tag_filter(driver) test.popular_article(driver) test.change_rating(driver) test.chips_and_link_test(driver) test.copy_link_to_article(driver) browser = browsers() browser.quit_browser(driver) #browser = browsers() #driver = browser.chrome() #knowledge(driver)
def juridical_information_part2_chrome(self, driver): test = hc_command() driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.open_signin_form(driver) window_before = driver.window_handles[0] print ("Click: Юридические документы") time.sleep(1) driver.find_element_by_xpath("//a[contains(text(),'Юридические документы')]").click() window_after = driver.window_handles[1] driver.switch_to.window(window_after) print("Click: Политика конфиденциальности") elem = driver.find_elements_by_xpath("//a[contains(text(),'Политика конфиденциальности')]") elem_click = elem[0] elem_click.click() test.check_privacy_policy(driver) driver.switch_to.window(window_before) print ("Click: Юридические документы") driver.find_element_by_xpath("//a[contains(text(),'Юридические документы')]").click() window_after = driver.window_handles[2] driver.switch_to.window(window_after) print("Click: Пользовательское соглашение") elem = driver.find_elements_by_xpath("//a[contains(text(),'Пользовательское соглашение')]") elem_click = elem[0] elem_click.click() test.check_user_agreement(driver) driver.switch_to.window(window_before) print ("Click: Юридические документы") driver.find_element_by_xpath("//a[contains(text(),'Юридические документы')]").click() window_after = driver.window_handles[3] driver.switch_to.window(window_after) print("Click: Правила проведения акции") elem = driver.find_elements_by_xpath("//a[contains(text(),'Правила проведения акции')]") elem_click = elem[0] elem_click.click() driver.find_element_by_xpath("//li[contains(text(),'Организатор Акции ООО «Е09»')]") print ("Info: Правила проведения акции проверены") driver.switch_to.window(window_before) browser = browsers() browser.quit_browser(driver) #browser = browsers() #test = juridical_information() ## ##driver = browser.chrome() ###test.juridical_information(driver) ##test.juridical_information_part2_chrome(driver) # #driver = browser.mozilla() ##test.juridical_information(driver) #test.juridical_information_part2_mozilla(driver)
def juridical_information(self, driver): test = hc_command() driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.open_user_agreement(driver) test.open_privacy_policy(driver) browser = browsers() browser.quit_browser(driver)
def add_user_with_send_support(driverTemp): test = hc_command() chrome_options = Options() chrome_options.add_argument("--start-maximized") driver = webdriver.Chrome(chrome_options=chrome_options) driver.get("https://temp-mail.org/ru/") driverTemp.get(test.site()) driverTemp.execute_script("$nuxt.$loading = {};") driverTemp.implicitly_wait(10) driver.implicitly_wait(10) test.getmail(driver) test.registration(driverTemp) test.confirm_mail(driver) config = configparser.ConfigParser() config ['USER INFO']= {'email': pyperclip.paste()} with open('config.ini', 'w+') as configfile: config.write(configfile) test.signin(driverTemp) test.tariff_add(driverTemp) current_time = datetime.datetime.now().time() # Берем смотрим время, если вренмя меньше 12 падаем и больше 19:50 пропускам момент отправки сообщения в саппорт off_hour_before = current_time.replace(hour=12, minute=1, second=0, microsecond=0) off_hour_after = current_time.replace(hour=19, minute=50, second=0, microsecond=0) # Еще необходимо проверять время на то что оно меньше if current_time > off_hour_before and current_time < off_hour_after: print ("WORK WORK WORK!!!") test.setting(driverTemp) test.setting_devices(driverTemp) test.add_devices(driverTemp) test.support_message(driverTemp) else: print ("Сейчас мы не работает") print (current_time) driver.close() browser = browsers() browser.close_browser(driverTemp) #browser = browsers() #driver = browser.chrome() #add_user_with_send_support(driver)
def main_page_check_unatorize(driver): test = hc_command() driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.main_page_check(driver) test.footer_unauthorized(driver) test.main_sevices(driver) test.main_how_its_work(driver) test.main_tarifs(driver) browser = browsers() browser.quit_browser(driver)
def feedback_form(driver): test = hc_command() driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.feedback_form(driver) browser = browsers() browser.quit_browser(driver) #browser = browsers() #driver = browser.chrome() #feedback_form(driver)
def create_user_and_devices(driver): test = hc_command() config = configparser.ConfigParser() config.read('config.ini') email = config['USER INFO']['email'] password = "******" driver.get(test.site()) driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.signin_parametr(driver, email, password) test.setting(driver) test.setting_devices(driver) test.add_user(driver) test.add_devices(driver) browser = browsers() browser.close_browser(driver)
def change_password(driver): test = hc_command() config = configparser.ConfigParser() config.read('config.ini') email = config['USER INFO']['email'] password = "******" if "http://" in test.site( ): # Если сайти будет использовать шифрование https мы будем валить тест. #Необходимо из-за того что мы не сможем отправить запрос на восстановление проля driver.get(test.site()) else: print("Info: сайти использует https - падаем") assert False driver.implicitly_wait(10) driver.execute_script("$nuxt.$loading = { };") test.signin_parametr(driver, email, password) test.setting(driver) test.change_password(driver) driver.quit()