def test_insert_user(self): driver = Cloud(self.driver) driver.open("http://mgt.test.sunmi.com/") #登陆MGT driver.mgt_login() #打开一级菜单 driver.mgt_click_invoice() #打开二级菜单 driver.mgt_click_SHJJGL() time.sleep(1) #删除数据库的user sql = "delete from invoice_user where taxpayer_num = '91310117350739745P1'" base_page.execute_sql(host, user, password, db, port, charset, sql) #新增商户 driver.mgt_insert_user( '91310117350739745P1', '界面自动化测试', '13975059149', ) #断言 #1、搜索刚新增的商户 driver.mgt_click_search('13975059149', '界面自动化', 0, 0) #2、获取搜索结果的企业名称 name = driver.Get_text("link_text", "界面自动化测试") assert name == "界面自动化测试" print("Test Pass")
def test_search(self): #进入电子发票 driver = Cloud(self.driver) driver.open("http://mgt.test.sunmi.com/") #登陆MGT driver.mgt_login() #打开一级菜单 driver.mgt_click_invoice() #打开二级菜单 driver.mgt_click_SHJJGL() time.sleep(1) #搜索订单 driver.mgt_click_search("13975059149", "公司", 0, 0) #断言 a = driver.Get_text( "xpath", "//*[@id='root']/div/main/div/div[2]/div/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[1]/td[6]/span" ) assert a == "编辑" print("Test Pass")