def invite_booster(self): gb_tool = GBtool(self.driver) time.sleep(1) hire_btn = self.driver.find_element_by_css_selector( Locators.INVITE_BTN[1]) booster = self.driver.find_elements_by_css_selector( Locators.BOOSTER[1])[0] booster_name = booster.find_element_by_css_selector( '.booster__playername') booster_name = booster_name.text hire_btn.click() invited_booster = self.driver.find_element_by_css_selector( Locators.INVITED_BOOSTER[1]) invited_booster_name = invited_booster.find_element_by_css_selector( '.invited-menu--dark') invited_booster_name = invited_booster_name.text hire_btn.click() gb_tool.check_exists_by_css('.booster-row', 'Приглашенный бустер', reverse=True) # assert_equal(x, 1, 'Окно не заполнено бустером') assert_equal(booster_name, invited_booster_name, 'Имена не сходятся')
def dezinvite_boost(self): gb_tool = GBtool(self.driver) delete = self.driver.find_element_by_css_selector( Locators.DEZINVITE[1]) time.sleep(1) delete.click() gb_tool.check_exists_by_css('.booster-row', 'Приглашенный бустер')
def delete(self): gb_tools = GBtool(self.driver) order = self.driver.find_elements(*Locators.ORDER)[0] delete = order.find_elements(*Locators.ORDER_BTNS)[1] delete.click() dialog = Locators.DIALOG gb_tools.check_exists_by_css(css=dialog[1], name='Окно удаления')
def open(self): gb_tool = GBtool(self.driver) new_btn = self.driver.find_element(*Locators.NEW_ORDER) new_btn.click() constructor = self.driver.find_element(*Locators.CONSTRUCTOR) gb_tool.check_exists_by_css(css=constructor, name="Конструктор")
def test_03_place_bid(self): """Работа кнопки кинуть ставку""" ordrs = OrderSearch(self.driver) gb_tools = GBtool(self.driver) gb_tools.go_to_tab_booster(search_orders=True) time.sleep(5) order = self.driver.find_elements(*Locators.ORDER)[0] show_more = order.find_element(*Locators.SHOW_MORE) place_bid = order.find_element(*Locators.PLACE_BID) show_more.click() gb_tools.check_exists_by_css(css='.btn--primary', name='сделать ставку') place_bid.click() bid = self.driver.find_element(*Locators.STAVOCHKA) gb_tools.check_exists_by_css(css='.bid', name='форма ставки')
def is_constructor_download(self): gb_tool = GBtool(self.driver) download = gb_tool.check_exists_by_css(css=Constructor[1], name='Конструктор') assert download == True ('Констурктор не загрузился') print('Конструктор загружен')
def check_components_bosoter_no_oders(self): """Проверка компонентнов нового бустера""" welcome = self.driver.find_element(*Locators.WELCOME) GBtool.check_exists_by_css(self, css=welcome, name='Начать знакомство ') oders = self.driver.find_element(*Locators.ORDERS) GBtool.check_exists_by_css(self, css=oders, name='Блок топ бустеров') balance = self.driver.find_element(*Locators.BALANCE) GBtool.check_exists_by_css(self, css=balance, name='Блок баланс') faq = self.driver.find_element(*Locators.FAQ) GBtool.check_exists_by_css(self, css=faq, name='F.A.Q.')
def check_components_no_orders(self): """Проверка компонентов нового байера""" welcome = Locators.WELCOME GBtool.check_exists_by_css(self, css=welcome[1], name='Блок создания заказа') top_bst = Locators.TOP_BOOSTRS GBtool.check_exists_by_css(self, css=top_bst[1], name='Блок топ бустеров') balance = Locators.BALANCE GBtool.check_exists_by_css(self, css=balance[1], name='Блок баланс') faq = Locators.FAQ GBtool.check_exists_by_css(self, css=faq[1], name='F.A.Q.')
def login(self, mail, password): """Авторизация""" time.sleep(1) login_btn = self.driver.find_element(*Locators.LOG_IN_BUTTON) time.sleep(1) login_btn.click() logging.info('Открытие окна авторизации...') # pop_up = self.driver.find_element(*Locators.POP_UP) pop_up = Locators.POP_UP GBtool.check_exists_by_css(self, css=pop_up[1], name='Окно авторизации') mail_lgn = self.driver.find_element(*Locators.MAIL_LOG_IN) time.sleep(1) mail_lgn.click() logging.debug('Ввод почты...') mail_lgn.send_keys(mail) psswrd = self.driver.find_element(*Locators.PASSWORD) psswrd.click() psswrd.send_keys(password) logging.info("Ввод пароля...") auth_btn = self.driver.find_element(*Locators.AUTH_BTN) auth_btn.click() logging.info('Авторизация...') time.sleep(1) # header = self.driver.find_element(*Locators.HEADER) header = Locators.HEADER time.sleep(1) GBtool.check_exists_by_css(self, css=header[1], name='Шапка после регистрации') logging.info('Авторизация прошла успрешно.')
def check_components(self): """Проверка компонентов топ бустеров""" gb_tool = GBtool(self.driver) time.sleep(1) password = self.driver.find_element(*Locators.PASSWORD) gb_tool.check_exists_by_css(css=password, name='Блок смены пароля') faq = self.driver.find_element(*Locators.FAQ) gb_tool.check_exists_by_css(css=faq, name='Блок справки ') usrpic = self.driver.find_element(*Locators.USERPIC) gb_tool.check_exists_by_css(css=usrpic, name='Аватар') card = self.driver.find_element(*Locators.CARD) gb_tool.check_exists_by_css(css=card, name="Карточка пользователя")
def check_components_with_order(self): """Проверка компонентнов байера делавшего заказы""" time.sleep(3) notification = self.driver.find_element(*Locators.NOTIFICATIONS_LIST) GBtool.check_exists_by_css(self, css=notification, name='Блок уведомлений') balance = self.driver.find_element(*Locators.BALANCE) GBtool.check_exists_by_css(self, css=balance, name='Блок баланс') faq = self.driver.find_element(*Locators.FAQ) GBtool.check_exists_by_css(self, css=faq, name='F.A.Q.')
def check_components_with_orders(self): """Проверка компонентов баера с заказами""" gb_tool = GBtool(self.driver) orders = Locators.ORDERS gb_tool.check_exists_by_css(orders) orders_cat = Locators.ORDERS_CAT gb_tool.check_exists_by_css(orders_cat) orders_count = Locators.ORDERS_COUNT gb_tool.check_exists_by_css(orders_count)
def check_components_no_orders(self): """Проверка компонентов нового байера""" gb_tool = GBtool(self.driver) no_orders_block = Locators.NOORDERS_BLOCK gb_tool.check_exists_by_css(css=no_orders_block[1], name='Плашка первого заказа') orders_cat = Locators.ORDERS_CAT gb_tool.check_exists_by_css(css=orders_cat[1], name='Блок категорий заказа') orders_count = Locators.ORDERS_COUNT gb_tool.check_exists_by_css(css=orders_count[1], name='Счетчик заказов')
def check_components(self): """Проверка компонентов топ бустеров""" gb_tool = GBtool(self.driver) time.sleep(1) filter = Locators.FILTER gb_tool.check_exists_by_css(css=filter[1], name='выбор игры') menu = Locators.MENU gb_tool.check_exists_by_css(css=menu[1], name='Меню') orders_list = Locators.LIST gb_tool.check_exists_by_css(css=orders_list[1], name='Список заказов')
def check_components(self): """Проверка компонентов""" gb_tool = GBtool(self.driver) deposit_funds = self.driver.find_element(Locators.DEPOSIT_FUNDS) gb_tool.check_exists_by_css(css=deposit_funds, name='Блок внести средства') history = self.driver.find_element(Locators.HISTORY) gb_tool.check_exists_by_css(css=history, name='Блок история') balance = self.driver.find_element(Locators.BALANCE) gb_tool.check_exists_by_css(css=balance, name='Блок баланс')
def check_components(self): """Проверка компонентов топ бустеров""" gb_tool = GBtool(self.driver) time.sleep(1) # lc = self.driver.find_element(*Locators.LANGUAGE_CHOOSER) language = Locators.LANGUAGE_CHOOSER gb_tool.check_exists_by_css(css=language[1], name='выбор языка') game = Locators.GAME_CHOOSER gb_tool.check_exists_by_css(css=game[1], name='Выбор игры') service = Locators.SERVICE_CHOOSER gb_tool.check_exists_by_css(css=service[1], name='Услуга') fav = Locators.FAV gb_tool.check_exists_by_css(css=fav[1], name='Избранное') filter = Locators.FILTER gb_tool.check_exists_by_css(css=filter[1], name='Фильтр') orders = Locators.ORDERS gb_tool.check_exists_by_css(css=orders[1], name='Заказы')
def check_components(self): """Проверка компонентов топ бустеров""" gb_tool = GBtool(self.driver) filter_block = Locators.FILTER_BLOCK gb_tool.check_exists_by_css(css=filter_block[1], name='Панель фильтрации') counter = Locators.COUNTER gb_tool.check_exists_by_css(css=counter[1], name='Счетчик') checkbox = Locators.ONLINE_NOW gb_tool.check_exists_by_css(css=checkbox[1], name='Чек бокс пользователей онлайн') inv_menu = Locators.INVITED_MENU gb_tool.check_exists_by_css(css=inv_menu[1], name='Менб приглашенных бустеров') boost_list = Locators.BOOSTERS_BODY gb_tool.check_exists_by_css(css=boost_list[1], name='Список топ-бустеров') paging = Locators.PAGINATOR gb_tool.check_exists_by_css(css=paging[1], name='Список страниц')