Ejemplo n.º 1
0
    def test_Select02(self):
        self.Log.info("test_Select02 start-->")

        #使用SelectText数据文件执行测试
        datapath = "data\\SelectText.data"
        testdataseq = 1 #1-取第一行数据

        TestData = test_UIbase.GetTestData(self.site,datapath,testdataseq)
        Data = TestData.GetData().split(',')
        select=Data[0]

        #测试数据json格式转换
        self.test_data = json.dumps({"select":select})

        """
        #调用公共方法拼装测试数据
        datapath = "SelectText"
        testdataseq = 2
        datas=[(datapath,testdataseq)]
        test_data=public_operation.getTestData(self.site,datas)
        """


        self.Log.debug("test data:"+format(self.test_data))

        #调用测试用例
        self.PageOperation.excutecase(baidu_operation.selectTest,
                                      test_Configuration_information.ScreenShot.ScreenShotPath,
                                      self.driver,
                                      self.test_data)
        self.Log.info("test_Select02 finish##")
Ejemplo n.º 2
0
def getTestData(site,datas):
    paramName=[]
    paramValu=[]
    for i in datas:
        dataName=i[0]
        dataSeq=i[1]
        if dataName=="phone_no":
            paramName.append("no_type")
            paramName.append("cust_phone_no")
        elif dataName=="cust_info":
            paramName.append("id_card_type")
            paramName.append("id_card_no")
            paramName.append("cust_name")
            paramName.append("id_card_addr")
            paramName.append("contact_phone_no")
            paramName.append("cust_nation")
            paramName.append("issuing_authority")

        datapath = "data\\"+dataName+".data"
        TestData = test_UIbase.GetTestData(site,datapath,dataSeq)
        Data = TestData.GetData().split(',')
        for j in Data:
            paramValu.append(j)
    testData={}

    for i in range(0,len(paramName),1):
        testData[paramName[i]]=paramValu[i]

    test_data = json.dumps(testData)

    return test_data
Ejemplo n.º 3
0
def getTestData(site, datas):
    paramName = []
    paramValu = []
    for i in datas:
        dataName = i[0]
        dataSeq = i[1]
        if dataName == "SelectText":
            paramName.append("select")
        elif dataName == "xxx":
            paramName.append("A1")
            paramName.append("A2")

        datapath = "data\\" + dataName + ".data"
        TestData = test_UIbase.GetTestData(site, datapath, dataSeq)
        Data = TestData.GetData().split(',')
        for j in Data:
            paramValu.append(j)
    testData = {}

    for i in range(0, len(paramName), 1):
        testData[paramName[i]] = paramValu[i]

    test_data = json.dumps(testData)

    return test_data
Ejemplo n.º 4
0
    def test_Select01(self):
        self.Log.info("test_Select01 start-->")

        #使用SelectText数据文件执行测试
        datapath = "data\\SelectText.data"
        testdataseq = 0 #0-随机

        TestData = test_UIbase.GetTestData(self.site,datapath,testdataseq)
        Data = TestData.GetData().split(',')
        select=Data[0]

        #测试数据json格式转换
        self.test_data = json.dumps({"select":select})
        self.Log.debug("test data:"+format(self.test_data))

        #调用测试用例
        self.PageOperation.excutecase(baidu_operation.selectTest,
                                      test_Configuration_information.ScreenShot.ScreenShotPath,
                                      self.driver,
                                      self.test_data)
        self.Log.info("test_Select01 finish##")