def test_dstaff_management(self):
     u'''测试员工管理'''
     excel = excelHandle()
     logger.info("开始回放脚本员工管理")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\3.应用设置\员工管理-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本员工管理")
     logger.info("结束回放脚本员工管理")
     logger.info("结束回放脚本员工管理")
     logger.info("结束回放脚本员工管理")
 def test_fkhda_management(self):
     u'''测试客户档案'''
     excel = excelHandle()
     logger.info("开始回放脚本客户档案")
     # filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\3.应用设置\客户档案-正.xlsx'
     filename = r'C:\Users\Administrator\Desktop\Demo.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本客户档案")
     logger.info("结束回放脚本客户档案")
     logger.info("结束回放脚本客户档案")
     logger.info("结束回放脚本客户档案")
 def test_dhistorical_records(self):
     u'''查验历史记录'''
     excel = excelHandle()
     logger.info("开始回放脚本查验历史记录")
     logger.info("开始回放脚本查验历史记录")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\5.企业受票\查验历史记录-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本查验历史记录")
     logger.info("结束回放脚本查验历史记录")
Exemple #4
0
 def util(self, driver, tables):
     self.driver = driver
     for i in range(len(tables)):
         row_list = tables[i]
         strTips = '行号:' + str(i + 1) + ',内容:['
         logger.info(strTips + ','.join("'" + str(element).decode('utf-8') + "'" for element in row_list) + ']')
         norun = row_list[4].decode('utf-8')
         # 如果表格中的第5列是 *,表示此行不运行,跳过。row_list[0]:要执行的动作值(如click)
         # row_list[1]:定位方式(如 xpath)
         # row_list[2]:定位值(如 //a[text()="保存"])
         # row_list[3]:输入值或需要校验的值(如 请输入编码)
         # row_list[4]:此行是否运行 * 不运行,否则运行
         # row_list[5]:备注信息
         if norun == "*":
             continue
         elif row_list[0] == "click":
             # if row_list[3] is not None:
             self.click(row_list[1], row_list[2], row_list[3], row_list[5])
             # self.sleep(2000)
         elif row_list[0] == "input":
             strTel = str(row_list[3])
             self.input(row_list[1], row_list[2], strTel, row_list[5])
         elif row_list[0] == "mousemove":
             self.mouse_move(row_list[1], row_list[2], row_list[5])
         elif row_list[0] == "select":
             self.select(row_list[1], row_list[2], str(row_list[3]), row_list[5])
         elif row_list[0] == "wait":
             self.sleep(row_list[3])
         elif row_list[0] == "checkpoint":
             self.checkpoint(row_list[1], row_list[2], row_list[3], row_list[5])
         elif row_list[0] == "contentclick":
             self.context_click(row_list[1], row_list[2], row_list[5])
         elif row_list[0] == "key":
             key_list = tables[i - 1]
             self.key(key_list[1], key_list[2], row_list[3],row_list[5])
         elif row_list[0] == "back":
             self.back()
             self.sleep(2000)
Exemple #5
0
 def test_dnot_open(self):
     u'''未开票'''
     excel = excelHandle()
     logger.info("开始回放脚本未开票")
     logger.info("开始回放脚本未开票")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\4.企业开票\未开票-正.xlsx'
     # filename = r'C:\Users\Administrator\Desktop\Demo.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本未开票")
     logger.info("结束回放脚本未开票")
     logger.info("结束回放脚本未开票")
     logger.info("结束回放脚本未开票")
Exemple #6
0
 def test_code_open(self):
     u'''码上开票'''
     excel = excelHandle()
     logger.info("开始回放脚本码上开票")
     logger.info("开始回放脚本码上开票")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\4.企业开票\码上开票-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本码上开票")
     logger.info("结束回放脚本码上开票")
     logger.info("结束回放脚本码上开票")
     logger.info("结束回放脚本码上开票")
Exemple #7
0
 def test_reimbursement_statistics(self):
     u'''测试报销统计表'''
     excel = excelHandle()
     logger.info("开始回放脚本报销统计表")
     logger.info("开始回放脚本报销统计表")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\7.进项统计\报销统计表-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本报销统计表")
     logger.info("结束回放脚本报销统计表")
     logger.info("结束回放脚本报销统计表")
     logger.info("结束回放脚本报销统计表")
 def test_dpersonal_center(self):
     u'''测试个人中心'''
     excel = excelHandle()
     logger.info("开始回放脚本个人中心")
     logger.info("开始回放脚本个人中心")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\11.个人用户操作\个人中心-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本个人中心")
     logger.info("结束回放脚本个人中心")
     logger.info("结束回放脚本个人中心")
     logger.info("结束回放脚本个人中心")
Exemple #9
0
 def test_other_operation(self):
     u'''测试修改企业密码,在线客服,帮助文档'''
     excel = excelHandle()
     logger.info("开始回放脚本首页")
     logger.info("开始回放脚本首页")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\2.首页\其他操作.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本首页")
     logger.info("结束回放脚本首页")
     logger.info("结束回放脚本首页")
     logger.info("结束回放脚本首页")
 def test_caigou_account(self):
     u'''采购台账'''
     excel = excelHandle()
     logger.info("开始回放脚本采购台账")
     logger.info("开始回放脚本采购台账")
     filename = r'D:\PycharmProjects\AutoTestEinvoice\script\税务云-正式环境fapiao\5.企业受票\采购台账-正.xlsx'
     sheetname = 'Sheet1'
     tables = excel.read_excel(unicode(filename, "utf-8"), sheetname)
     # 公共部分,读取表格
     util = Utils(BasePage)
     util.util(self.driver, tables)
     logger.info("结束回放脚本采购台账")
     logger.info("结束回放脚本采购台账")
     logger.info("结束回放脚本采购台账")
     logger.info("结束回放脚本采购台账")