def step_login(self, username, password): time.sleep(1) SeleniumApi.step_send_keys(self, "//*[@placeholder='邮箱']", username) time.sleep(1) SeleniumApi.step_send_keys(self, "//*[@placeholder='密码']", password) SeleniumApi.step_click(self, "//*[@type='button']") time.sleep(3)
def step_keywords_search(content): SeleniumApi.step_send_keys(content, "//*[@placeholder='请输入标题']", 'KV测试组案例') SeleniumApi.step_click( content, '//*[@id="rc-root"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div[1]/div/div/div[4]/' 'div/button[1]') time.sleep(2)
def before_feature(content, feature): content.driver = webdriver.Chrome() content.driver.get( "https://*****:*****@top.tezign.com") content.driver.implicitly_wait(10) content.driver.maximize_window() time.sleep(1) SeleniumApi.step_send_keys(content, "//*[@placeholder='邮箱']", '*****@*****.**') time.sleep(1) SeleniumApi.step_send_keys(content, "//*[@placeholder='密码']", '111111') SeleniumApi.step_click(content, "//*[@type='button']") if '特赞基地' == SeleniumApi.step_text_cssselector(content, ".side-header"): assert True else: ExceptionCatch.catch_exception(content) assert False
def step_keywords_search(content): SeleniumApi.step_send_keys( content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/div[2]/div[3]/div[1]/' 'div[2]/div[1]/div[2]/div[1]/div[2]/div/div/div/div/div/ul/li/div/input', '插画') SeleniumApi.step_click( content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/div[2]/div[3]/div[1]/' 'div[2]/div[1]/div[2]/div[1]/div[2]/div/div/div/div/div/ul/li/div/input' ) time.sleep(1) SeleniumApi.step_click(content, '/html/body/div[2]/div/div/div/ul/li[1]/ul/li[1]') time.sleep(1) SeleniumApi.step_click( content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/div[2]/div[3]/div[1]/div[2]' '/div[1]/div[2]/div[7]/div/button[1]')
def step_login(self, username, passward): time.sleep(1) SeleniumApi.step_send_keys(self, _mobile_field, passward) SeleniumApi.step_send_keys(self)