def test_tmall_9(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("wadasdwadsg4sfdfesf") tmall_main_page.find_search_button().click() elements = tmall_main_page.find_items_of_search() assert len(elements) > 0
def test_tmall_8(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Ботинки") tmall_main_page.find_search_button().click() elements = tmall_main_page.find_items_of_search() assert len(elements) > 0
def test_tmall_55(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() mainpage_nav_group = tmall_main_page.find_mainpage_nav_group() browser.execute_script( "arguments[0].scrollIntoView();", mainpage_nav_group) time.sleep(5) assert mainpage_nav_group != None
def test_tmall_33(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.find_nav_categories()[2].click() slider_photo = tmall_main_page.find_house_garden_category_slider_photo() if slider_photo != None: assert True else: assert False
def test_tmall_37(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.find_nav_categories()[6].click() slider_photo = tmall_main_page.find_car_goods_category_slider_photo() if slider_photo != None: assert True else: assert False
def test_tmall_11(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("wadasdwadsg4sfdfesf") tmall_main_page.find_search_button().click() symbols = tmall_main_page.find_counter_value() if symbols.text != None: assert True else: assert False
def test_tmall_12(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Робот пылесос") tmall_main_page.find_search_button().click() sort_bar = tmall_main_page.find_sort_bar() if sort_bar.text != None: assert True else: assert False
def test_tmall_28(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() fashion_category = tmall_main_page.find_nav_categories()[4] checking = False try: fashion_category.click() checking = True except: pass assert checking
def test_tmall_45(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Кулер для процессора") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() elements = tmall_main_page.find_item_brand_choice()[1].text assert "Теплопроводящая штукатурка" and "Водяное охлаждение" in elements
def test_tmall_47(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Кулер для процессора") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() elements = tmall_main_page.find_item_brand_choice()[3].text assert "92x92x25 мм" and "120x120x25 мм" in elements
def test_tmall_30(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() car_goods_category = tmall_main_page.find_nav_categories()[6] checking = False try: car_goods_category.click() checking = True except: pass assert checking
def test_tmall_48(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Процессоры Intel") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() items = tmall_main_page.find_item_quantity() assert len(items) > 7
def test_tmall_26(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() huose_and_garden_category = tmall_main_page.find_nav_categories()[2] checking = False try: huose_and_garden_category.click() checking = True except: pass assert checking
def test_tmall_27(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() children_and_mothers_category = tmall_main_page.find_nav_categories()[3] checking = False try: children_and_mothers_category.click() checking = True except: pass assert checking
def test_tmall_25(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() appliances_category = tmall_main_page.find_nav_categories()[1] checking = False try: appliances_category.click() checking = True except: pass assert checking
def test_tmall_24(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() electronic_category = tmall_main_page.find_nav_categories()[0] checking = False try: electronic_category.click() checking = True except: pass assert checking
def test_tmall_46(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Кулер для процессора") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() elements = tmall_main_page.find_item_brand_choice()[2].text assert "Другое" and "Пластик" and "Медь" in elements
def test_tmall_29(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() supermarket_category = tmall_main_page.find_nav_categories()[5] checking = False try: supermarket_category.click() checking = True except: pass assert checking
def test_tmall_13(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Робот пылесос") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() assert True else: assert False
def test_tmall_50(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() support_button = tmall_main_page.find_support_button() action = webdriver.ActionChains(browser) action.move_to_element(support_button).perform() support_button_link = tmall_main_page.find_support_button_link() action.move_to_element(support_button_link).perform() time.sleep(1) support_button_link.click() time.sleep(11) questions = tmall_main_page.find_support_page_questions() assert 'Когда продавец отправит заказ?' and ' Как отследить мою посылку?' and 'Когда я получу свой заказ?' in questions
def test_tmall_44(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Видеокарта gtx 1650") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() brand_choice = tmall_main_page.find_item_brand_choice()[0] if brand_choice != None: assert True else: assert False
def test_tmall_5(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() shipping_button = tmall_main_page.find_shipping_button() checking = False try: # Если кнопка нажимается то значение переменной checking меняется на True. shipping_button.click() checking = True except: # Если такой кнопки нет либо же он не нажимается то значение переменной checking остается False. pass # Исходя из значении переменной checking результат будет True либо False. assert checking
def test_tmall_21(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Перчатки") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() item_image = tmall_main_page.find_item_image() if item_image != None: assert True else: assert False
def test_tmall_23(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Куртки") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() item_company = tmall_main_page.find_item_company() if item_company.text != None: assert True else: assert False
def test_tmall_19(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Аккумулятор") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() item_price = tmall_main_page.find_item_price() if item_price.text != None: assert True else: assert False
def test_tmall_43(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Видеокарта gtx 1650") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() item_price = tmall_main_page.find_item_price() index = item_price.text.find(',') if int(item_price.text[:index].replace(' ', '')) > 10000: assert True else: assert False
def test_tmall_14(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Мультиварка") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() check_first_button = False try: tmall_main_page.find_by_orders_button().click() check_first_button = True except: pass assert check_first_button
def test_tmall_49(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() support_button = tmall_main_page.find_support_button() action = webdriver.ActionChains(browser) action.move_to_element(support_button).perform() support_button_link = tmall_main_page.find_support_button_link() action.move_to_element(support_button_link).perform() time.sleep(1) checking = False try: support_button_link.click() checking = True except: pass assert checking
def test_tmall_16(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Аккумулятор") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() if add != None: add.click() check_first_button = False try: tmall_main_page.find_price_button().click() check_first_button = True except: pass assert check_first_button
def test_tmall_17(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() tmall_main_page.enter_word("Сковородка") tmall_main_page.find_search_button().click() time.sleep(5) add = tmall_main_page.find_advertisement() checking = False if add != None: add.click() item_link = tmall_main_page.find_item_link() try: item_link.click() checking = True except: pass assert checking