def test_02editbug(self): self.driver.find_element_by_xpath('//*[@id="bugList"]/tbody/tr[1]/td[11]/a[3]/i').click() sleep(2) self.driver.find_element_by_xpath('//*[@id="module_chosen"]/a/span').click() self.driver.find_element_by_xpath('//*[@id="module_chosen"]/div/ul/li[2]').click() sleep(1) self.driver.execute_script("scroll(0,600)") sleep(2) self.driver.find_element_by_xpath('//*[@id="submit"]').click() sleep(2) duan_in(self.driver, '创建工作日历报错', self.driver.page_source, '修改bug用例')
def test_00login(self): # print('111') self.driver.find_element_by_xpath('//input[@id="account"]').send_keys('admin') self.driver.find_element_by_xpath('//input[@name="password"]').send_keys('jianghu@123') self.driver.find_element_by_xpath('//button[@id="submit"]').click() sleep(1) # 调用断言方法判断是否登录成功 duan_in(self.driver,'我的地盘12',self.driver.page_source,'登录用例') # print(self.driver.page_source) # self.driver.get_screenshot_as_file('./'+'登录用例'+'.png') sleep(1)
def test_00login(self): # print('111') self.driver.find_element_by_xpath('//input[@id="account"]').send_keys( 'admin') self.driver.find_element_by_xpath( '//input[@name="password"]').send_keys('jianghu@123') self.driver.find_element_by_xpath('//button[@id="submit"]').click() sleep(1) # 调用自定义的断言方法,注释自带的 # self.assertIn('我的地盘',self.driver.page_source,'登录失败') sleep(3) duan_in(self.driver, '我的地盘', self.driver.page_source, '登录用例')
def test_02editcase(self): self.driver.find_element_by_xpath( '//*[@id="caseList"]/tbody/tr/td[13]/a[3]/i').click() sleep(1) self.driver.find_element_by_xpath( '//*[@id="pri_chosen"]/a/span').click() self.driver.find_element_by_xpath( '//*[@id="pri_chosen"]/div/ul/li[3]').click() self.driver.execute_script("scroll(0,1000)") sleep(1) self.driver.find_element_by_xpath('//button[@id="submit"]').click() sleep(2) duan_in(self.driver, '创建工作日历', self.driver.page_source, '修改工作日历用例')
def test_01addcase(self): self.driver.find_element_by_xpath( '//*[@id="navbar"]/ul/li[4]/a').click() sleep(1) self.driver.find_element_by_xpath( '//*[@id="subNavbar"]/ul/li[2]/a').click() sleep(1) self.driver.find_element_by_xpath( '//*[@id="mainMenu"]/div[3]/a[2]').click() self.driver.find_element_by_xpath('//*[@id="title"]').send_keys( '创建工作日历') sleep(1) self.driver.find_element_by_xpath('//button[@id="submit"]').click() sleep(3) duan_in(self.driver, '创建工作日历', self.driver.page_source, '创建工作日历用例')
def test_01addbug(self): self.driver.find_element_by_xpath('//*[@id="navbar"]/ul/li[4]/a').click() sleep(1) self.driver.find_element_by_xpath('//*[@id="subNavbar"]/ul/li[1]/a').click() sleep(1) self.driver.find_element_by_xpath('//*[@id="mainMenu"]/div[3]/a[3]').click() sleep(1) self.driver.find_element_by_xpath('//*[@id="openedBuild_chosen"]/ul').click() self.driver.find_element_by_xpath('//*[@id="openedBuild_chosen"]/div/ul/li[2]').click() sleep(2) self.driver.find_element_by_xpath('//*[@id="title"]').send_keys('创建工作日历报错') self.driver.execute_script("scroll(0,600)") sleep(2) self.driver.find_element_by_xpath('//*[@id="submit"]').click() sleep(2) duan_in(self.driver, '创建工作日历报错', self.driver.page_source, '创建bug用例')