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_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_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_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_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_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_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_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_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_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_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_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_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_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
def test_tmall_4(browser): tmall_main_page = SearchHelper(browser) tmall_main_page.go_to_site() search_button = tmall_main_page.find_search_button() checking = False try: # Если кнопка нажимается то значение переменной checking меняется на True. search_button.click() checking = True except: # Если такой кнопки нет либо же он не нажимается то значение переменной checking остается False. pass # Исходя из значении переменной checking результат будет True либо False. assert checking