def testFinanceLoanGetFinanceLoanSumDate(self, url, method=None, parameters=None, headers={}):
     conn = HttpInterface(url, method, parameters, self.cookie, headers)
     responseData= conn.requestWithCookies()
     print "测试银行对账列表统计页接口:"  
     responseDict = simplejson.loads(responseData)
     testCaseObject_baseCountBean=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\getFinanceLoanSumDateCase.xls",sheetNum=1)
     casedatabaseCountBean1 = testCaseObject_baseCountBean.getXlsData(1)
     casedatabaseCountBean2 = testCaseObject_baseCountBean.getXlsData(testCaseObject_baseCountBean.rowLinesNum)
     duibidata = caseDateHandle(responseDict["baseCountBean"])
     dict_case_baseCountBean = duibidata.testCaseData(casedatabaseCountBean1, casedatabaseCountBean2)
     print "测试数据:",dict_case_baseCountBean
     print "返回数据:",responseDict["baseCountBean"]
     if responseDict["baseCountBean"] == dict_case_baseCountBean:
         log.basicLog( u'baseCountBean数据正确')
     else:
         log.basicLog(u"baseCountBean数据不正确")   
 def testRepayCheckGethuizong(self, url, method=None, parameters=None, headers={}):
     conn = HttpInterface(url, method, parameters, self.cookie, headers)
     responseData= conn.requestWithCookies()
     print "测试用户还款对账列表统计接口:" 
     responseDict = simplejson.loads(responseData)
     testCaseObject_collect=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\RepayCheckgethuizongCase.xls",sheetNum=1)
     casedatacollect1 = testCaseObject_collect.getXlsData(1)
     casedatacollect2 = testCaseObject_collect.getXlsData(testCaseObject_collect.rowLinesNum)
     duibidata = caseDateHandle(responseDict["collect"])
     dict_case_baseCountBean = duibidata.testCaseData(casedatacollect1, casedatacollect2)
    
     print "测试数据:",dict_case_baseCountBean
     print "返回数据:",responseDict["collect"]
     if responseDict["collect"] == dict_case_baseCountBean:
         log.basicLog( u'collect数据正确')
     else:
         log.basicLog(u"collect数据不正确")
 def testRepayCheckList(self, url, method=None, parameters=None, headers={}):
     conn = HttpInterface(url, method, parameters, self.cookie, headers)
     responseData= conn.requestWithCookies()
     print "测试用户还款对账列表接口:" 
     responseDict = simplejson.loads(responseData)
     responsedata=dataTpyeHandleObject.dictAllToUnicode(responseDict["rows"][0])
     testCaseO_rows=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\RepayCheckListCase.xls",sheetNum=1)
     casedatarows1 = testCaseO_rows.getXlsData(1)
     casedatarows2 = testCaseO_rows.getXlsData(testCaseO_rows.rowLinesNum)
     duibidata = caseDateHandle(responsedata)
     dict_case_rows = duibidata.testCaseData(casedatarows1, casedatarows2)
     print "测试数据:",dict_case_rows
     print "返回数据:",responsedata
     if responsedata == dict_case_rows:
         log.basicLog( u'rows数据正确')
     else:
         log.basicLog(u"rows数据不正确")
 def testGetoutMallList(self, url, method=None, parameters=None, headers={}):
     conn = HttpInterface(url, method, parameters, self.cookie, headers)
     responseData= conn.requestWithCookies()
     #print(responseData)
     responseDict = dataTpyeHandleObject.dictAllToUnicode(simplejson.loads(responseData))
     #print(type(responseDict))
     #print responseDict
    # print "testData:",testData
     print "测试查询对外商家结算列表信息接口:"
    #验证接口返回list部分
     testCaseObject = LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\getoutMallListCase.xls", 0, sheetNum=1)
     caseList1 = testCaseObject.getXlsData(1)
     caseList2 = testCaseObject.getXlsData(testCaseObject.rowLinesNum)
     duibidata = caseDateHandle(responseDict["result"]["data"]["list"])
     dict_case = duibidata.testCaseData(caseList1, caseList2)
     print "测试数据:",dict_case
     print "返回数据:",responseDict["result"]["data"]["list"]
     if responseDict["result"]["data"]["list"] == dict_case:
         log.basicLog( u'list数据正确')
     else:
         log.basicLog(u"list数据不正确")
         
     #验证接口返回collect部分
     testCaseObject_collect = LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\getoutMallListCase.xls", 0, sheetNum=2)
     casedatacollect1 = testCaseObject_collect.getXlsData(1)
     casedatacollect2 = testCaseObject_collect.getXlsData(testCaseObject_collect.rowLinesNum)
     duibidata = caseDateHandle(responseDict["result"]["data"]["collect"])
     dict_case_collect = duibidata.testCaseData(casedatacollect1, casedatacollect2)
     print "测试数据:",dict_case_collect
     print "返回数据:",responseDict["result"]["data"]["collect"]
     #print responseDict["result"]["data"]["collect"].keys()
     #print responseDict["result"]["data"]["collect"].values()
     if responseDict["result"]["data"]["collect"] == dict_case_collect:
         log.basicLog( u'collect数据正确')
     else:
         log.basicLog(u"collect数据不正确")
         
     #验证接口返回malllist部分
     testCaseObject_malllist = LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\getoutMallListCase.xls", 0, sheetNum=2)
     casedatamalllist1 = testCaseObject_malllist.getXlsData(1)
     casedatamalllist2 = testCaseObject_malllist.getXlsData(testCaseObject_malllist.rowLinesNum)
     duibidata = caseDateHandle(responseDict["result"]["data"]["malllist"])
     dict_case_malllist = duibidata.testCaseData(casedatamalllist1, casedatamalllist2)
     print "测试数据:",dict_case_malllist
     print "返回数据:",responseDict["result"]["data"]["malllist"]
     if responseDict["result"]["data"]["malllist"] == dict_case_collect:
         log.basicLog( u'malllist数据正确')
     else:
         log.basicLog(u"malllist数据不正确")
  def testFirstPayInit(self, url, method=None, parameters=None, headers={}):
      conn = HttpInterface(url, method, parameters, self.cookie, headers)
      responseData= conn.requestWithCookies()
      print "测试微信首付对账列表接口:" 
      responseDict = simplejson.loads(responseData)
      #print(type(responseDict))
      #log.basicLog(responseDict["rows"][0])
 
      testCaseO_rows=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\FirstPayinitCase.xls",sheetNum=1)
      casedatarows1 = testCaseO_rows.getXlsData(1)
      casedatarows2 = testCaseO_rows.getXlsData(testCaseO_rows.rowLinesNum)
      duibidata = caseDateHandle(responseDict["rows"][0])
      dict_case_rows = duibidata.testCaseData(casedatarows1, casedatarows1)
      print "测试数据: ",dict_case_rows
      print "返回数据:",responseDict["rows"][0]
      if responseDict["rows"][0] == dict_case_rows:
          log.basicLog( u'rows数据正确')
      else:
          log.basicLog(u"rows数据不正确")
    def testMallSettleCheckGetdataBirt(self, url, method=None, parameters=None, headers={}):
        conn = HttpInterface(url, method, parameters, self.cookie, headers)
        responseData= conn.requestWithCookies()
        print "测试对内商家结算对账统计页接口:"
        responseDict = simplejson.loads(responseData)
        #print(type(responseDict))
        #print(responseDict["result"]["data"].keys())

        #log.basicLog(responseDict["baseCountBean"])
        testCaseObject_baseCountBean=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\mallSettleCheckgetdataBirtCase.xls",sheetNum=1)
        casedatabaseCountBean1 = testCaseObject_baseCountBean.getXlsData(1)
        casedatabaseCountBean2 = testCaseObject_baseCountBean.getXlsData(testCaseObject_baseCountBean.rowLinesNum)
        duibidata = caseDateHandle(responseDict["baseCountBean"])
        dict_case_baseCountBean = duibidata.testCaseData(casedatabaseCountBean1, casedatabaseCountBean2)
        print "测试数据:",dict_case_baseCountBean
        print "返回数据:",responseDict["baseCountBean"]
        if responseDict["baseCountBean"] == dict_case_baseCountBean:
            log.basicLog( u'baseCountBean数据正确')
        else:
            log.basicLog(u"baseCountBean数据不正确")
Пример #7
0
 def setRunOnAllRows(self, caseFile, sheetNum=0, readStyle=0):
     u'''
     caseFile->测试用例
     sheetNum->sheet游标,从0开始,存在的sheet页中必须有数据
     readStyle->0时以行读取测试用例,1时以列读取测试用例
     e.g.
         readExcel("c:\login.xls",1,1)
     '''
     xlsCase = LoadTestCase.ReadExcelCase(caseFile)
     for i in range(xlsCase.rowLinesNum):
         print(xlsCase.getXlsData(i))
if __name__ == "__main__":
    cookieUrl = "http://wbt.ishopcity.cn/reconciliation/admin"
    test = ReconciliationInterfaceTest(cookieUrl)
    url = "http://wbt.ishopcity.cn/reconciliation/mallSettleCheck/list.json"
    responseData = test.testGetoutMallList(url)
    print(responseData)
    responseDict = simplejson.loads(responseData)
    print(type(responseDict))
    #print(responseDict["rows"].keys())
#     print(responseDict["result"]["data"]["mallList"])
#     print(responseDict["result"]["data"]["collect"])
#     print(responseDict["result"]["data"]["list"])
    log.basicLog(responseDict["rows"][0])
    
    testCaseO_rows=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\mallSettleCheckListCase.xls",sheetNum=1)
    casedatarows1 = testCaseO_rows.getXlsData(1)
    casedatarows2 = testCaseO_rows.getXlsData(testCaseO_rows.rowLinesNum)
    #print "casedatacollect2:",casedatacollect2
    casedatarows3=[]
    for i in range(0, len(casedatarows2)):
        casedatarows3.append(casedatarows2[i:i + 1])
    print casedatarows3
    dict_case_rows = dict(zip(casedatarows1, casedatarows2))
    print "dict_case_rows:",dict_case_rows
    log.basicLog(responseDict["rows"][0])
    if responseDict["rows"][0] == dict_case_rows:
        log.basicLog( u'rows数据正确')
    else:
        log.basicLog(u"此方法行不通")
#     if testData==u"何飞贤测试":
    def testGetoutMallList(self, url, method=None, parameters=None, headers={}):
        conn = HttpInterface(url, method, parameters, self.cookie, headers)
        return conn.requestWithCookies()
        

if __name__ == "__main__":
    cookieUrl = "http://wbt.ishopcity.cn/reconciliation/admin"
    test = ReconciliationInterfaceTest(cookieUrl)
    url = "http://wbt.ishopcity.cn/reconciliation/firstPay/getdataBirt.json"
    responseData = test.testGetoutMallList(url)
    print(responseData)
    responseDict = simplejson.loads(responseData)
    print(type(responseDict))
    
    log.basicLog(responseDict)
    testCaseObject_baseCountBean=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\FirstPaygetdataBirt.xls",sheetNum=1)
    casedatabaseCountBean1 = testCaseObject_baseCountBean.getXlsData(1)
    casedatabaseCountBean2 = testCaseObject_baseCountBean.getXlsData(testCaseObject_baseCountBean.rowLinesNum)
    #print "casedatacollect2:",casedatacollect2
    casedatabaseCountBean3=[]
    for i in range(0, len(casedatabaseCountBean2)):
        casedatabaseCountBean3.append(casedatabaseCountBean2[i:i + 1])
    print casedatabaseCountBean3
    dict_case_baseCountBean = dict(zip(casedatabaseCountBean1, casedatabaseCountBean2))
    print "dict_case_baseCountBean:",dict_case_baseCountBean
    log.basicLog(responseDict)
    if responseDict == dict_case_baseCountBean:
        log.basicLog( u'baseCountBean数据正确')
    else:
        log.basicLog(u"此方法行不通")
    
    def testGetoutMallList(self, url, method=None, parameters=None, headers={}):
        conn = HttpInterface(url, method, parameters, self.cookie, headers)
        return conn.requestWithCookies()
        

if __name__ == "__main__":
    cookieUrl = "http://wbt.ishopcity.cn/reconciliation/admin"
    test = ReconciliationInterfaceTest(cookieUrl)
    url = "http://wbt.ishopcity.cn/reconciliation/repayCheck/gethuizong.json"
    responseData = test.testGetoutMallList(url)
    print(responseData)
    responseDict = simplejson.loads(responseData)
    print(type(responseDict))
    
    log.basicLog(responseDict["collect"])
    testCaseObject_collect=LoadTestCase().ReadExcelCase("D:\workspace-sts-3.6.4.RELEASE\AutomatedPythonTest\dataTable\RepayCheckgethuizongCase.xls",sheetNum=1)
    casedatacollect1 = testCaseObject_collect.getXlsData(1)
    casedatacollect2 = testCaseObject_collect.getXlsData(testCaseObject_collect.rowLinesNum)
    #print "casedatacollect2:",casedatacollect2
    casedatacollect3=[]
    for i in range(0, len(casedatacollect2)):
        casedatacollect3.append(casedatacollect2[i:i + 1])
    print casedatacollect3
    dict_case_baseCountBean = dict(zip(casedatacollect1, casedatacollect2))
    print "dict_case_baseCountBean:",dict_case_baseCountBean
    log.basicLog(responseDict["collect"])
    if responseDict["collect"] == dict_case_baseCountBean:
        log.basicLog( u'collect数据正确')
    else:
        log.basicLog(u"此方法行不通")