def test_input_for_search(browser_driver, get_url): search_page = SearchPage(browser_driver) with allure.step('Open Search Page'): search_page.open_search_page() with allure.step('Searching results'): search_page.search_result(word='Test') assert browser_driver.title == 'Search - Test'
def test_product_description_checkbox(browser_driver, get_url): search_page = SearchPage(browser_driver) search_page.open_search_page() search_page.checkbox_description()
def test_select_categories(browser_driver, get_url): search_page = SearchPage(browser_driver) search_page.open_search_page() search_page.select_categories(option='Desktops')
def test_subcategories_checkbox_enable(browser_driver, get_url): search_page = SearchPage(browser_driver) search_page.open_search_page() search_page.select_categories(option='Desktops') search_page.checkbox_subcategories_enable()
def test_subcategories_checkbox_disabled(browser_driver, get_url): search_page = SearchPage(browser_driver) search_page.open_search_page() search_page.checkbox_subcategories_disabled()
def setUpClass(cls): cls.sp = SearchPage() broswer_type = sys.argv[1] log.info("broswer_type=%s" % broswer_type) cls.sp.open_search_page(broswer_type) cls.driver = cls.sp.driver
def test_search(self): baidu_page = SearchPage(self.driver, self.url) #实例化SearchPage baidu_page.open() #SearchPage类的实例改写了open方法 baidu_page.search_content(self.content) baidu_page.btn_click() #层层callback sleep(2)