Exemple #1
0
class back(unittest.TestCase):
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_channelMove()
        self.dd = Move(a)

    def test_movemachine(self):
        '''移机'''
        tt = self.dd.channel_no()
        self.dd.Resources()
        self.dd.new_channel_no()
        self.dd.reason()
        self.dd.appendix()
        self.dd.Submission()

    def test_movemachine1(self):
        '''移机输入后取消'''
        tt = self.dd.channel_no()
        self.dd.Resources()
        self.dd.new_channel_no()
        self.dd.reason()
        self.dd.appendix()
        self.dd.cancel()

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
class add(unittest.TestCase):
    def setUp(self):
        a=Login_B()
        self.aa=Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc=business_process(a)
        self.cc.jump_channelAddmachine()
        self.dd=Add(a)


    def test_addmachine(self):
        '''新增机器'''
        tt=self.dd.channel_no()
        self.dd.title(tt)
        self.dd.Resources()
        self.dd.reason()
        self.dd.appendix()
        self.dd.Submission()

    def test_addmachine1(self):
        '''新增机器输入完后点取消'''
        tt=self.dd.channel_no()
        self.dd.title(tt)
        self.dd.Resources()
        self.dd.reason()
        self.dd.appendix()
        self.dd.cancel()

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
Exemple #3
0
class change(unittest.TestCase):
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_channelchange()
        self.dd = Change(a)

    def test_change(self):
        '''渠道变更'''
        zz = self.dd.channel_no()
        self.dd.switch(1)  #基本信息开启编辑
        palce = self.dd.place1()
        area = self.dd.areainput()
        zhanshi = self.dd.zhanshi()
        kailimit = self.dd.kailimit()
        shiwanlimit = self.dd.shiwanlimit()
        Recharge = self.dd.Recharge()
        peoplelimit = self.dd.people_limit()
        # latitude=self.dd.latitude()
        # longitude=self.dd.longitude()
        self.dd.switch(2)  # 个人信息开启编辑
        name = self.dd.name()
        sex = self.dd.sex()
        phone = self.dd.phone()
        cardid = self.dd.cardid()
        self.dd.Photo()
        self.dd.switch(3)  # 开启编辑
        cardnum = self.dd.cardnum()
        self.dd.cardnaccount()
        self.dd.deposit()
        self.dd.Submission()
        time.sleep(1)
        tt = self.dd.querydetail(zz)
        tt1 = tt[0]
        bb = len(tt1)
        a = list(tt1)
        for i in range(bb):  #数据库查询出来的 各种类型都有  统一转成str对比
            a[i] = str(a[i])
        self.assertEqual(palce, a[0])
        self.assertEqual(area, a[1])
        self.assertEqual(zhanshi, a[2])
        self.assertEqual(kailimit, a[3])
        self.assertEqual(shiwanlimit, a[4])
        self.assertEqual(Recharge, a[5])
        self.assertEqual(peoplelimit, a[6])
        # self.assertEqual(latitude, a[7])
        # self.assertEqual(longitude, a[8])
        self.assertEqual(name, a[9])
        self.assertEqual(sex, a[10])
        self.assertEqual(phone, a[11])
        self.assertEqual(cardid, a[12])

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
Exemple #4
0
 def setUp(self):
     # 进入类型管理
     b = Login_B()
     obj = Home_Page(b)
     obj.jumpBusinessmanagement()
     self.obb = model_page(b)
     self.oba = addmodel_page(b)
     self.obc = modifymodel_page(b)
     self.obb.skip()
     self.status = {"开": 1, "关": 2}  # 状态
Exemple #5
0
class relocate(unittest.TestCase):
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_channelrelocate()
        self.dd = Relocate(a)

    def test_relocate(self):
        '''迁址,根据选取到的渠道编号来 判断第四位是否为0 0则为省渠道,不为0责任市渠道'''
        tt = self.dd.channel_no()
        kk = tt[3:4]
        if kk == 0:
            self.dd.channeladdress()
        else:
            self.dd.channeladdress(2)
        # self.dd.title()
        # self.dd.channeladdress()
        self.dd.reason()
        self.dd.appendix()  #附件
        self.dd.Submission()

    def test_relocate1(self):
        '''迁址到市'''
        self.dd.channel_no()
        # self.dd.title()
        self.dd.channeladdress(2)
        self.dd.reason()
        self.dd.appendix()  #附件
        self.dd.Submission()

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
Exemple #6
0
class provide_machine(unittest.TestCase):
    '''资源发放'''
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_ResourceProvide()
        self.dd = Provide(a)

    def test_provide_machine(self):
        '''资源发放,提交终端机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.Submission()
        time.sleep(2)
        # data=self.dd.data()
        # cc=data['warehouseGoodsInfoList'][0]
        # print 'cc=%s'%cc
        # '''型号只有id 通过sql单独查'''
        # sql1='''SELECT device_model FROM T_GOODS_MODEL WHERE goods_id = %d AND id = %d'''%(cc['goodId'],cc['modelId'])
        # hh=(self.dd.sql_result(sql1))[0]
        # self.assertEqual(title,data['resourceApplyTitle'])
        # self.assertEqual(name,data['purchaseUserName'])
        # self.assertEqual(time1, data['preReceivDate'])
        # self.assertEqual(shebei, cc['goodsName'])
        # self.assertEqual(modle, hh)
        # self.assertEqual(serial,cc['goodsSerialNumber'])
        # self.assertEqual(reason, data['remark'])
        # self.assertEqual(remake,cc['remark'])
        # self.assertEqual(money, data['totalMoney'])

    def test_provide_machine1(self):
        '''资源发放,暂存终端机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.zancun()
        time.sleep(2)

    def test_provide_machine2(self):
        '''资源发放,取消提交终端机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.cancel()
        time.sleep(2)

    def test_provide_machine3(self):
        '''资源发放,提交柜员机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.Submission()
        time.sleep(2)

    def test_provide_machine4(self):
        '''资源发放,暂存柜员机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.zancun()
        time.sleep(2)

    def test_provide_machine5(self):
        '''资源发放,取消柜员机'''
        title = self.dd.title()
        warehouse = self.dd.warehouse()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money = self.dd.Money()
        self.dd.appendix()
        self.dd.cancel()
        time.sleep(2)

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
class ProcessControl(Test, GamePublicPlanPage, CardGenerationPage,
                     WarehouseManagePage, New):
    '''流程控制'''
    def channel_add_approval_process(self, title):
        '''渠道建站-申请审批'''
        approval_list = [u'业务管理', u'我的待办', u'展开']
        self.user_login()
        self.click_more_button_for_one(approval_list)
        self.search_information({u'请输入业务标题': title}, {}, {})
        self.click_table_cell_operation_button(1, 7, 3, 3)
        self.input_text_message_for_inside_text(u'请输入审批意见', u'同意')
        self.click_button_for_one(u'确 定')
        print(u'审批完成')

    def open_channel_add(self):
        '''打开渠道新建'''
        open_list = [u'业务管理', u'渠道业务管理', u'业务办理', u'渠道新建']
        self.user_login(u'gavin-aa', u'123456')
        self.click_button_for_one(open_list[0])
        sleep(3)
        self.click_more_button_for_one(open_list[1:])
        sleep(3)

    def login_and_add(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_channelnewbuilt()
        self.dd = New(a)

    def channel_new_shi(self):
        '''新建市级渠道'''
        # 判断是否走流程 1代表走  需要从流程表中取数据对比 0代表不走流程 对比数据从channel info
        jj = self.dd.isprocess()
        self.dd.choose_group(2)
        channel_no = self.dd.channelno()
        print channel_no
        type = self.dd.channeltype()
        level = self.dd.channellevel()
        changsuo = self.dd.place1()
        mianji = self.dd.areainput()
        limit = self.dd.kailimit()
        limit1 = self.dd.shiwanlimit()
        chongzhi = self.dd.Recharge()
        limit2 = self.dd.people_limit()
        # latitude=self.dd.latitude()
        # longitude=self.dd.longitude()
        zhanshinum = self.dd.zhanshi()
        address = self.dd.channeladdress()
        name = self.dd.name()
        sex = self.dd.sex()
        phone = self.dd.phone()
        cardid = self.dd.cardid()
        tt = datetime.datetime.now()
        kk = tt.year
        age = str(int(kk) - int(cardid[6:10]))
        address1 = self.dd.Contact_address()
        self.dd.Photo()
        cardnum = self.dd.cardnum()
        cardnaccount = self.dd.cardnaccount()
        self.dd.deposit()
        self.dd.gameJurisdiction()
        self.dd.gametime()
        self.dd.Resources()
        self.dd.appendix()
        '''通过判断jj的值 看是否存在流程,启用流程需要输入标题'''
        if jj == 1:
            time.sleep(2)
            title = self.dd.title(channel_no)
            time.sleep(2)
            self.dd.Submission()
        else:
            time.sleep(2)
            self.dd.Submission()
            '''调用渠道列表  对比数据 暂时不用'''

    def test_game_package_public(self):
        '''游戏包发布'''
        self.login_and_add()
        self.channel_new_shi()
Exemple #8
0
class new(unittest.TestCase):
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_channelnewbuilt()
        self.dd = New(a)

    def test_new(self):
        '''新建省级渠道'''
        jj = self.dd.isprocess()
        self.dd.group()
        channel_no = self.dd.channelno()
        print channel_no
        type = self.dd.channeltype()
        level = self.dd.channellevel()
        changsuo = self.dd.place1()
        mianji = self.dd.areainput()
        limit = self.dd.kailimit()
        limit1 = self.dd.shiwanlimit()
        chongzhi = self.dd.Recharge()
        limit2 = self.dd.people_limit()
        # latitude=self.dd.latitude()
        # longitude=self.dd.longitude()
        zhanshinum = self.dd.zhanshi()
        address = self.dd.channeladdress()
        name = self.dd.name()
        sex = self.dd.sex()
        phone = self.dd.phone()
        cardid = self.dd.cardid()
        tt = datetime.datetime.now()
        kk = tt.year
        age = str(int(kk) - int(cardid[6:10]))
        address1 = self.dd.Contact_address()
        self.dd.Photo()
        cardnum = self.dd.cardnum()
        cardnaccount = self.dd.cardnaccount()
        self.dd.deposit()
        self.dd.gameJurisdiction()
        self.dd.gametime()
        self.dd.Resources()
        self.dd.appendix()
        '''通过判断jj的值 看是否存在流程,启用流程需要输入标题'''
        if jj == 1:
            time.sleep(2)
            title = self.dd.title(channel_no)
            time.sleep(2)
            self.dd.Submission()
            time.sleep(2)

            tt = self.dd.data()
            bb = len(tt)
            self.assertEqual(channel_no, tt["channelData"]["channelNo"])
            self.assertEqual(title, tt["channelData"]["title"])
            self.assertEqual(type, tt["channelData"]["channelType"])
            self.assertEqual(level, tt["channelData"]["channelLevelId"])
            # self.assertEqual(changsuo,tt["channelData"]["channelNo"])

            self.assertEqual(mianji, tt["financeData"]["pointArea"])
            self.assertEqual(limit, tt["channelData"]["buyCardLimit"])
            self.assertEqual(limit1, tt["channelData"]["tryCardLimit"])
            self.assertEqual(chongzhi, tt["channelData"]["rechargeCount"])
            self.assertEqual(limit2, tt["channelData"]["channelLimit"])
            # self.assertEqual(latitude, str(tt["channelData"]["latitude"]))
            # self.assertEqual(longitude, str(tt["channelData"]["longitude"]))
            self.assertEqual(address, tt["channelData"]["channelAddress"])
            self.assertEqual(name, tt["channelFundData"]["accountName"])
            self.assertEqual(sex, tt["channelFundData"]["sex"])
            self.assertIn(phone, str(tt["channelFundData"]["phone"]))
            # self.assertEqual(phone, tt["channelFundData"]["phone"])
            self.assertEqual(cardid, tt["channelFundData"]["channelIdentity"])
            self.assertEqual(age, str(tt["channelFundData"]["age"]))
            self.assertEqual(address1, tt["channelFundData"]["address"])
            self.assertEqual(zhanshinum,
                             str(tt["channelData"]["showMachineCount"]))
            self.assertEqual(cardnum, str(tt["cardRuleData"]["costMoreThan"]))
            self.assertEqual(cardnaccount, str(tt["cardRuleData"]["charge"]))
            print '%%%%%%%%%%%%%%%%%%'
        else:
            time.sleep(2)
            self.dd.Submission()
            '''调用渠道列表  对比数据 暂时不用'''
            # channnel_list=jump_channel_list_page()
            # kk=channnel_list.querydetail()
            # tt1 = channnel_list.querydetail()  # 二进制
            # tt = channnel_list.view_channel()  # Unicode
            # aa = tt1[0]
            # for i in range(13):
            #     '''数据库拿出来的有float型,页面都是Unicode型,需要转化成str比较'''
            #     c = aa[i]
            #     c = str(c)
            #     self.assertEqual(c, tt[i])
            '''插入数据和数据库对比'''
            tt = self.dd.querydetail(channel_no)
            tt1 = tt[0]
            bb = len(tt1)
            a = list(tt1)
            for i in range(bb):
                a[i] = str(a[i])
            self.assertEqual(channel_no, a[0])
            self.assertEqual(type, a[1])
            self.assertEqual(level, a[2])
            self.assertEqual(changsuo, a[3])
            self.assertEqual(mianji, a[4])
            self.assertEqual(limit, a[5])
            self.assertEqual(limit1, a[6])
            self.assertEqual(chongzhi, a[7])
            self.assertEqual(limit2, a[8])
            # self.assertEqual(latitude, a[9])
            # self.assertEqual(longitude, a[10])
            self.assertEqual(address, a[11])
            self.assertEqual(name, a[12])
            self.assertEqual(sex, a[13])
            self.assertEqual(phone, a[14])
            self.assertEqual(cardid, a[15])
            self.assertEqual(age, a[16])
            self.assertEqual(address1, a[17])
            self.assertEqual(channel_no, tt1[18])
            self.assertEqual(channel_no, tt1[19])
            self.assertEqual(channel_no, tt1[20])
            self.assertEqual(channel_no, tt1[0])
            print '*******************'

    def test_new_shi(self):
        '''新建市级渠道'''
        # 判断是否走流程 1代表走  需要从流程表中取数据对比 0代表不走流程 对比数据从channel info
        jj = self.dd.isprocess()
        self.dd.group(2)
        channel_no = self.dd.channelno()
        print channel_no
        type = self.dd.channeltype()
        level = self.dd.channellevel()
        changsuo = self.dd.place1()
        mianji = self.dd.areainput()
        limit = self.dd.kailimit()
        limit1 = self.dd.shiwanlimit()
        chongzhi = self.dd.Recharge()
        limit2 = self.dd.people_limit()
        # latitude=self.dd.latitude()
        # longitude=self.dd.longitude()
        zhanshinum = self.dd.zhanshi()
        address = self.dd.channeladdress()
        name = self.dd.name()
        sex = self.dd.sex()
        phone = self.dd.phone()
        cardid = self.dd.cardid()
        tt = datetime.datetime.now()
        kk = tt.year
        age = str(int(kk) - int(cardid[6:10]))
        address1 = self.dd.Contact_address()
        self.dd.Photo()
        cardnum = self.dd.cardnum()
        cardnaccount = self.dd.cardnaccount()
        self.dd.deposit()
        self.dd.gameJurisdiction()
        self.dd.gametime()
        self.dd.Resources()
        self.dd.appendix()
        '''通过判断jj的值 看是否存在流程,启用流程需要输入标题'''
        if jj == 1:
            time.sleep(2)
            title = self.dd.title(channel_no)
            time.sleep(2)
            self.dd.Submission()
            time.sleep(2)

            tt = self.dd.data()
            bb = len(tt)
            self.assertEqual(channel_no, tt["channelData"]["channelNo"])
            self.assertEqual(title, tt["channelData"]["title"])
            self.assertEqual(type, tt["channelData"]["channelType"])
            self.assertEqual(level, tt["channelData"]["channelLevelId"])
            # self.assertEqual(changsuo,tt["channelData"]["channelNo"])

            self.assertEqual(mianji, tt["financeData"]["pointArea"])
            self.assertEqual(limit, tt["channelData"]["buyCardLimit"])
            self.assertEqual(limit1, tt["channelData"]["tryCardLimit"])
            self.assertEqual(chongzhi, tt["channelData"]["rechargeCount"])
            self.assertEqual(limit2, tt["channelData"]["channelLimit"])
            # self.assertEqual(latitude, str(tt["channelData"]["latitude"]))
            # self.assertEqual(longitude, str(tt["channelData"]["longitude"]))
            self.assertEqual(address, tt["channelData"]["channelAddress"])
            self.assertEqual(name, tt["channelFundData"]["accountName"])
            self.assertEqual(sex, tt["channelFundData"]["sex"])
            self.assertIn(phone, str(tt["channelFundData"]["phone"]))
            # self.assertEqual(phone, tt["channelFundData"]["phone"])
            self.assertEqual(cardid, tt["channelFundData"]["channelIdentity"])
            self.assertEqual(age, str(tt["channelFundData"]["age"]))
            self.assertEqual(address1, tt["channelFundData"]["address"])
            self.assertEqual(zhanshinum,
                             str(tt["channelData"]["showMachineCount"]))
            self.assertEqual(cardnum, str(tt["cardRuleData"]["costMoreThan"]))
            self.assertEqual(cardnaccount, str(tt["cardRuleData"]["charge"]))
            print '%%%%%%%%%%%%%%%%%%'
        else:
            time.sleep(2)
            self.dd.Submission()
            '''调用渠道列表  对比数据 暂时不用'''
            # channnel_list=jump_channel_list_page()
            # kk=channnel_list.querydetail()
            # tt1 = channnel_list.querydetail()  # 二进制
            # tt = channnel_list.view_channel()  # Unicode
            # aa = tt1[0]
            # for i in range(13):
            #     '''数据库拿出来的有float型,页面都是Unicode型,需要转化成str比较'''
            #     c = aa[i]
            #     c = str(c)
            #     self.assertEqual(c, tt[i])
            '''插入数据和数据库对比'''
            tt = self.dd.querydetail(channel_no)
            tt1 = tt[0]
            bb = len(tt1)
            a = list(tt1)
            for i in range(bb):
                a[i] = str(a[i])
            self.assertEqual(channel_no, a[0])
            self.assertEqual(type, a[1])
            self.assertEqual(level, a[2])
            self.assertEqual(changsuo, a[3])
            self.assertEqual(mianji, a[4])
            self.assertEqual(limit, a[5])
            self.assertEqual(limit1, a[6])
            self.assertEqual(chongzhi, a[7])
            self.assertEqual(limit2, a[8])
            # self.assertEqual(latitude, a[9])
            # self.assertEqual(longitude, a[10])
            self.assertEqual(address, a[11])
            self.assertEqual(name, a[12])
            self.assertEqual(sex, a[13])
            self.assertEqual(phone, a[14])
            self.assertEqual(cardid, a[15])
            self.assertEqual(age, a[16])
            self.assertEqual(address1, a[17])
            self.assertEqual(channel_no, tt1[18])
            self.assertEqual(channel_no, tt1[19])
            self.assertEqual(channel_no, tt1[20])
            self.assertEqual(channel_no, tt1[0])
            print '*******************'

    # def test_dd(self):
    #     kk=self.dd.data1()
    #     print kk

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()
Exemple #9
0
class channel_list_test(unittest.TestCase):
    def setUp(self):
        '''初始化登陆'''
        a = Login_B()  #登陆
        self.obh = Home_Page(a)  #将登陆用的drvier赋给self.obh
        self.obh.jumpBusinessmanagement()  #跳转到业务管理
        self.cc = jump_channel_list_page(a)  #
        self.cc.jump()

    def test_query1(self):
        '''测试渠道列表全部查询,只校验总数是不是一样'''

        aa = self.cc.queryresult()
        aa1 = str(aa[0])
        tt1 = self.cc.page_num()
        print aa1
        print tt1
        self.assertEqual(aa1, tt1)

    def test_query2(self):
        '''测试渠道列表第一行数据,并且校验,'''
        tt = self.cc.pageresult1()
        yy = self.cc.sql_page_result()
        tt1 = tt[0].split('\n')
        print tt1
        print yy
        for i in range(5):
            self.assertEqual(tt1[i], yy[i])

    def test_resetting(self):
        '''测试重置按钮,输入框中前后对比'''
        channer_no = '123'
        channel_type = u'自营厅'
        channel_level = u'一级'
        person = u'张三'
        phone = '13570816554'
        startdate = '2019-12-17'
        enddate = '2019-12-17'
        self.cc.resetting(channer_no='123',
                          channel_type=u'自营厅',
                          channel_level=u'一级',
                          person=u'张三',
                          phone='13570816554',
                          startdate='2019-12-17',
                          enddate='2019-12-17')
        page_channel_no = self.cc.channel_no_isnull()
        page_channel_type = self.cc.channel_type_isnull()
        page_channel_level = self.cc.channel_level_isnull()
        page_person = self.cc.person_isnull()
        page_phone = self.cc.phone_isnull()
        page_startdate = self.cc.start_date_isnull()
        page_enddate = self.cc.end_date_isnull()
        self.assertNotIn(channer_no, page_channel_no)

    def test_export_now(self):
        '''测试导出当前'''
        t = self.cc.export_check()
        self.cc.export()
        time.sleep(5)
        t = self.cc.export_check()
        print type(t)
        self.assertEqual(t, 'True')

    def test_export_all(self):
        '''测试导出所有'''
        t = self.cc.export_check()
        self.cc.export_all()
        time.sleep(5)
        t = self.cc.export_check()
        print type(t)
        self.assertEqual(t, 'True')

    def test_view(self):
        '''查看,并对比数据'''
        tt1 = self.cc.querydetail()  #二进制
        tt = self.cc.view_channel()  #Unicode
        aa = tt1[0]
        for i in range(13):
            '''数据库拿出来的有float型,页面都是Unicode型,需要转化成str比较'''
            c = aa[i]
            c = str(c)
            self.assertEqual(c, tt[i])

    def tearDown(self):
        self.cc.close_browser()
Exemple #10
0
class aa(unittest.TestCase):
    def test_aa(self):
        list = [{
            "user": "******",
            "password": "******"
        }, {
            "user": "******",
            "password": "******"
        }, {
            "user": "******",
            "password": "******"
        }, {
            "user": "******",
            "password": "******"
        }]
        rr1 = len(list)

        for i in range(rr1):

            try:
                a = Login_B(list[i]["user"], list[i]["password"])
                self.aa = Home_Page(a)
                self.aa.jumpBusinessmanagement()
                self.cc = business_process(a)
                self.cc.jump_channelnewbuilt()
                self.dd = New(a)
                time.sleep(2)
                self.dd.group()
                channel_no = self.dd.channelno()
                print channel_no
                # title=self.dd.title(channel_no)
                type = self.dd.channeltype()
                level = self.dd.channellevel()
                changsuo = self.dd.place1()
                mianji = self.dd.areainput()
                limit = self.dd.kailimit()
                limit1 = self.dd.shiwanlimit()
                chongzhi = self.dd.Recharge()
                limit2 = self.dd.people_limit()
                latitude = self.dd.latitude()
                longitude = self.dd.longitude()
                zhanshinum = self.dd.zhanshi()
                address = self.dd.channeladdress()
                name = self.dd.name()
                sex = self.dd.sex()
                phone = self.dd.phone()
                cardid = self.dd.cardid()
                tt = datetime.datetime.now()
                kk = tt.year
                age = str(int(kk) - int(cardid[6:10]))
                address1 = self.dd.Contact_address()
                self.dd.Photo()
                cardnum = self.dd.cardnum()
                cardnaccount = self.dd.cardnaccount()
                self.dd.deposit()
                self.dd.gameJurisdiction()
                self.dd.gametime()
                self.dd.Resources()
                self.dd.appendix()
                self.dd.Submission()
                time.sleep(2)
            except Exception as e:
                print e
Exemple #11
0
class purcure(unittest.TestCase):
    def setUp(self):
        a = Login_B()
        self.aa = Home_Page(a)
        self.aa.jumpBusinessmanagement()
        self.cc = business_process(a)
        self.cc.jump_ResourceProcurement()
        self.dd = Procure(a)

    def test_purcure_machine(self):
        '''资源采购,采购终端机,需要有终端机类型 没有的话就随机加一个类型'''
        title = self.dd.title()
        name = self.dd.name()
        time1 = self.dd.deliverdate()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        serial = self.dd.Serial()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money1 = self.dd.Money()
        money = money1 * 100
        self.dd.appendix()
        self.dd.Submission()
        time.sleep(2)
        data = self.dd.data()
        cc = data['warehouseGoodsInfoList'][0]
        print 'cc=%s' % cc
        '''型号只有id 通过sql单独查'''
        sql1 = '''SELECT device_model FROM T_GOODS_MODEL WHERE goods_id = %d AND id = %d''' % (
            cc['goodId'], cc['modelId'])
        hh = (self.dd.sql_result(sql1))[0]
        self.assertEqual(title, data['resourceApplyTitle'])
        self.assertEqual(name, data['purchaseUserName'])
        self.assertEqual(time1, data['preReceivDate'])
        self.assertEqual(shebei, cc['goodsName'])
        self.assertEqual(modle, hh)
        self.assertEqual(serial, cc['goodsSerialNumber'])
        self.assertEqual(reason, data['remark'])
        self.assertEqual(remake, cc['remark'])
        print "money=%s" % money
        self.assertEqual(money, data['totalMoney'])

    def test_purcure_machine1(self):
        '''资源采购,采购终端机,需要有终端机类型 没有的话就随机加一个类型'''
        title = self.dd.title()
        name = self.dd.name()
        time1 = self.dd.deliverdate()
        shebei = self.dd.goodsname_zhongduanji()
        modle = self.dd.modle()
        serial = self.dd.Serial()
        remake = self.dd.Remarks()
        reason = self.dd.reason()
        money1 = self.dd.Money()
        money = money1 * 100
        self.dd.appendix()
        self.dd.cancel()

    def test_purcure_machine2(self):
        '''资源采购,采购柜员机,需要有柜员机类型 没有的话就随机加一个类型'''
        tt = self.dd.title()
        self.dd.name()
        self.dd.deliverdate()
        self.dd.goodsname_guiyuanji()
        self.dd.modle()
        self.dd.reason()
        self.dd.appendix()
        self.dd.Submission()
        time.sleep(3)

    def test_purcure_machine3(self):
        '''资源采购,取消采购柜员机'''
        tt = self.dd.title()
        self.dd.name()
        self.dd.deliverdate()
        self.dd.goodsname_guiyuanji()
        self.dd.modle()
        self.dd.reason()
        self.dd.appendix()
        self.dd.cancel()
        time.sleep(3)

    def runTest(self):
        pass

    def tearDown(self):
        self.cc.close_browser()