Ejemplo n.º 1
0
from browser import I_browser
from time import sleep
from actions import Actions
import configparser

config = configparser.ConfigParser()
config.read('config_local.ini', 'utf-8')
OT_callback = config['OTcallback']
for initial in config['Obasic']['browser_initial'].split(' '):
    predriver = I_browser(initial, config['Obrowser']['height'],
                          config['Obrowser']['width'])
    predriver.browserstart()
    driver = predriver.driver
    Actions.get(driver, OT_callback['main_link'], OT_callback['main_title'])
    elem = Actions.find(driver, OT_callback['F_EP_callback'].split(' '))
    elem.click()
    form = Actions.find(driver, OT_callback['F_F_callback'].split(' '))
    Actions.find_and_input(form, OT_callback['FI_callback_name'].split(' '))
    Actions.find_and_input(form, OT_callback['FI_calback_tel'].split(' '))
    elem = Actions.find(form, OT_callback['FI_calback_tel'].split(' ')[:2])
    Actions.input(elem, "RETURN", flag_Keys=True)
    sleep(4)
    xpath = """//*[@id="comp_5b946bbcf949afa8a21bda31e7bfe743"]/div/div[2]"""
    test_text = Actions.find(driver, ("xpath", xpath))
    text = "Ошибка подтверждения отправки сообщения"
    assert OT_callback['text_success'] == test_text[0].text, text
    driver.close()
Ejemplo n.º 2
0
    def __init__(self, user="******", client=Actions.HOME):
        self.client = client
        self.user = user

        self.actions = Actions.get(client)