def step_find_innerdesigner(content): if '分享列表' in SeleniumApi.step_text_xpath( content, '//*[@id="subMenu-3$Menu"]/li[5]'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_back_to_loginpage(content): if 'We are the new sexy' in SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div/div[1]'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_back_to_sharing(content): if '分享链接已生成' in SeleniumApi.step_text_xpath( content, '/html/body/div[2]/div/div[2]/div/div[2]/div/div/div[1]'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_check_innderdesigner(content): if '个案例符合条件' in SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/' 'div[2]/div[3]/div[1]/div[2]/div[2]/div[2]/span'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_verify_search_result(content): if '1' == SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div[2]/' 'div[1]/p/span'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_portfolio_ok(content): SeleniumApi.step_switch_to_a_tab(content) time.sleep(1) if '案例详情' in SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/span[1]'): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_verify_search_result(content): if '特赞插画作品' in SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]' '/div[2]/div[3]/div[1]/div[2]/div[3]/div[1]/div[1]/div/div[1]/div/div[2]' ): assert True else: ExceptionCatch.catch_exception(content) assert False time.sleep(3)
def step_check_shareing(content): sharing_url = SeleniumApi.step_text_cssselector(content, '.link-detail') time.sleep(2) SeleniumApi.step_switch_to_new_tab(content, sharing_url) time.sleep(5) if '免费咨询' in SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[2]/div/div[1]/div[3]/button'): assert True else: ExceptionCatch.catch_exception(content) SeleniumApi.step_click( content, '//*[@id="rc-root"]/div/div[2]/div/div[3]/div[1]/div/div[1]/div[2]/div[1]' ) time.sleep(3) if '平台出品' in SeleniumApi.step_text_xpath( content, '/html/body/div[4]/div/div[2]/div/div[1]/div/div[1]/div[2]/' 'div[1]/div/span'): assert True else: ExceptionCatch.catch_exception(content) ExceptionCatch.catch_exception(content) SeleniumApi.step_switch_to_original_tab(content)
def step_check_portfolio(content): selected = SeleniumApi.step_text_xpath( content, '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/div/div/div/div/div[1]/div[1]' ) locator = ( By.XPATH, '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/div/div/div/div/div[1]/div[1]' ) SeleniumApi.step_wait_expected(content, locator) if '案例分享列表' in selected: assert True else: ExceptionCatch.catch_exception(content) assert False