Beispiel #1
0
class C31140_DFQP_Broadcast_ReceiveSystemMessages(TestCase):
    '''
    接收系统消息,查看广播消息界面显示
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        global user_info
        user_info = self.common.get_user()
        print user_info
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.start_step("初始化Luadriver")
        self.luadriver = self.common.setupdriver()
        self.start_step("关闭活动页面")
        self.common.closeactivity(self.luadriver)
        self.start_step("判断是否登陆")
        self.hall_page.wait_element("头像").click()
        time.sleep(5)
        self.common.loginuser(user_info['user'], user_info['password'])
        self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.personinfo_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        try:
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            self.log_info("close driver fail")
        finally:
            self.common.release_user(user_info['user'])
Beispiel #2
0
class C31138_DFQP_Broadcast_NoBroadcast(TestCase):
    '''
    无广播消息时,广播界面消息列表显示空白
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 10

    def pre_test(self):
        self.common = Common()
        # global user_info
        # user_info = self.common.get_user()
        # print user_info
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.start_step("初始化Luadriver")
        self.luadriver = self.common.setupdriver()
        self.start_step("关闭活动页面")
        self.common.closeactivity_switchserver(self.luadriver)
        # self.start_step("判断是否登陆")
        # self.hall_page.wait_element("头像").click()
        # time.sleep(5)
        # self.common.loginuser(user_info['user'], user_info['password'])
        # self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.personinfo_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        try:
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            self.log_info("close driver fail")
class C228_DFQP_Broadcast(TestCase):
    '''
    接收系统消息,查看广播消息界面显示
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.common.closeactivitytest(self.luadriver)

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入头像界面')
        self.hall_page.wait_element('头像').click()
        self.common.loginuser(self.casedata['user'], self.casedata['password'])
        self.start_step('关闭弹框')
        time.sleep(4)
        i = 0
        while (i < 3):
            try:
                self.sign_page.wait_element('关闭1').click()
                i += 1
            except:
                i = 3
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.personinfo_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        self.common.closedriver()
Beispiel #4
0
class C31136_DFQP_Broadcast_NotEnoughMoney(TestCase):
    '''
    注册15级玩家银币不足23000,点击广播输入文字点击发送,查看
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 10

    def pre_test(self):
        self.common = Common()
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        global user_info, UserID
        user_info = self.common.get_user()
        print user_info
        UserID = user_info['mid']
        print 'UserID:%s' % UserID
        PHPInterface.set_level(UserID, 15)
        user_info1 = PHPInterface.get_user_info(UserID)  #获取玩家信息
        coin = json.loads(user_info1).get('result', {
            'coin': None
        }).get('coin')  #获取当前银币值
        AddMoney = 10000 - coin
        PHPInterface.add_money(UserID, AddMoney)  #将银币值设为10000
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.start_step("初始化Luadriver")
        self.luadriver = self.common.setupdriver()
        self.start_step("关闭活动页面")
        self.common.closeactivity(self.luadriver)
        self.start_step("判断是否登陆")
        self.hall_page.wait_element("头像").click()
        time.sleep(5)
        self.common.loginuser(user_info['user'], user_info['password'])
        self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        self.start_step('点击发送')
        self.broadcast_page.wait_element('发送').click()
        self.personinfo_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        try:
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            self.log_info("close driver fail")
        finally:
            self.common.release_user(user_info['user'])
class C225_DFQP_Broadcast(TestCase):
    '''
    注册15级玩家银币足够,点击广播输入文字点击发送,查看
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        UserID = self.casedata.get('mid')
        print 'UserID:%s' % UserID
        PHPInterface.set_level(UserID, 16)
        dict = PHPInterface.get_user_info(UserID)  #获取玩家信息
        coin = eval(dict).get('result', {'coin': None}).get('coin')  #获取当前银币值
        AddMoney = 40000 - coin
        PHPInterface.add_money(UserID, AddMoney)  #将银币值设为40000
        self.common = Common()
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.common.closeactivitytest(self.luadriver)

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入头像界面')
        self.hall_page.wait_element('头像').click()
        self.common.loginuser(self.casedata['user'], self.casedata['password'])
        self.start_step('关闭弹框')
        time.sleep(4)
        i = 0
        while (i < 3):
            try:
                self.sign_page.wait_element('关闭1').click()
                i += 1
            except:
                i = 3
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        self.start_step('点击发送')
        self.broadcast_page.wait_element('发送').click()
        time.sleep(1)
        self.personinfo_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        self.common.closedriver()
Beispiel #6
0
class C70601_DFQP_BroadcastNotEnoughMoney(TestCase):
    '''
    银币不足,查看广播邀请显示
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 10

    def pre_test(self):
        self.common = Common()
        global user_info, UserID
        user_info = self.common.get_user()
        UserID = user_info.get('mid')
        print 'UserID:%s' % UserID
        self.start_step("初始化环境")
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        self.broadcast_page = Broadcast_Page()
        self.hall_page = Hall_Page()
        self.personinfo_page = Personinfo_Page()
        self.common.closeactivity_switchserver(self.luadriver)
        self.hall_page.wait_element("头像").click()
        time.sleep(5)
        self.common.loginuser(user_info['user'], user_info['password'])
        time.sleep(5)
        self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        self.broadcast_page.wait_element('发送').click()
        self.broadcast_page.screenshot('.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        try:
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            print 'Closedriver failed'
        finally:
            self.common.release_user(UserID)
class C222_DFQP_Broadcast(TestCase):
    '''
    游客账号点击广播输入文字发送,查看
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        self.start_step('删除登录文件')
        self.common.deletefile(self.luadriver)
        self.common.closedriver()
        self.luadriver = self.common.setupdriver()
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.common.closeactivitytest(self.luadriver)

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.personinfo_page.screenshot('.png')
        self.start_step('点击立即绑定')
        self.broadcast_page.wait_element('发送').click()
        try:
            self.broadcast_page.wait_element('确定')
            print '点击立即绑定可以成功绑定手机'
        except:
            print '点击立即绑定没有出现绑定手机操作'

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        self.common.closedriver()
Beispiel #8
0
class C31139_DFQP_Broadcast_SeveralMessages(TestCase):
    '''
    接收多条广播消息
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 15

    def pre_test(self):
        self.common = Common()
        global user_info, UserID
        user_info = self.common.get_user()
        print user_info
        UserID = user_info['mid']
        print 'UserID:%s' % UserID
        PHPInterface.set_level(UserID, 16)
        user_info1 = PHPInterface.get_user_info(UserID)  #获取玩家信息
        coin = json.loads(user_info1).get('result', {
            'coin': None
        }).get('coin')  #获取当前银币值
        AddMoney = 300000 - coin
        PHPInterface.add_money(UserID, AddMoney)  #将银币值设为300000
        self.hall_page = Hall_Page()
        self.sign_page = Sign_Page()
        self.game_page = Game_Page()
        self.setting_page = Setting_Page()
        self.personinfo_page = Personinfo_Page()
        self.broadcast_page = Broadcast_Page()
        self.start_step("初始化Luadriver")
        self.luadriver = self.common.setupdriver()
        self.start_step("关闭活动页面")
        self.common.closeactivity_switchserver(self.luadriver)
        self.start_step("判断是否登陆")
        self.hall_page.wait_element("头像").click()
        time.sleep(5)
        self.common.loginuser(user_info['user'], user_info['password'])
        self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        time.sleep(3)
        # PHPInterface.broadcast(UserID, content='第一条')后台发送不会显示‘广播正在冷却中,请稍后再发’的提示
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        self.start_step('点击发送')
        self.broadcast_page.wait_element('发送').click()
        time.sleep(1)
        self.broadcast_page.wait_element('广播').click()
        time.sleep(3)
        self.personinfo_page.screenshot('1.png')
        self.broadcast_page.wait_element('输入文字').send_keys('22')
        self.start_step('点击发送')
        self.broadcast_page.wait_element('发送').click()
        time.sleep(1)
        self.personinfo_page.screenshot('2.png')
        self.broadcast_page.wait_element('广播').click()
        # time.sleep(305)#5分多钟后再发广播
        # self.broadcast_page.wait_element('输入文字').send_keys('22')
        # self.broadcast_page.wait_element('广播').click()
        # self.personinfo_page.screenshot('3.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        try:
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            self.log_info("close driver fail")
        finally:
            self.common.release_user(UserID)
Beispiel #9
0
class C70600_DFQP_BroadcastEnoughMoney(TestCase):
    '''
    银币充足,查看广播邀请显示
    '''
    owner = "YoungLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 15

    def pre_test(self):
        self.common = Common()
        global user_info, UserID
        userinfo_and_mid = self.common.get_idle_userinfo_and_mid()
        user_info = userinfo_and_mid.get('userinfo')
        print user_info
        UserID = userinfo_and_mid.get('mid')
        print 'UserID:%s' % UserID
        user_info1 = PHPInterface.get_user_info(UserID)  # 获取玩家信息
        coin = json.loads(user_info1).get('result', {
            'coin': None
        }).get('coin')  # 获取当前银币值
        print coin
        AddMoney = 60000 - coin
        PHPInterface.add_money(UserID, AddMoney)  # 将银币值设为60000
        PHPInterface.set_level(UserID, 16)
        self.start_step("初始化环境")
        # 初始化Luadriver
        args = {}
        args['newCommandTimeout'] = 305
        self.luadriver = self.common.setupdriver(args)
        self.broadcast_page = Broadcast_Page()
        self.hall_page = Hall_Page()
        self.personinfo_page = Personinfo_Page()
        self.common.closeactivity_switchserver(self.luadriver)
        self.hall_page.wait_element("头像").click()
        time.sleep(5)
        self.common.loginuser(user_info['user'], user_info['password'])
        time.sleep(5)
        self.common.closeActivityBtn()

    def run_test(self):
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step('进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        time.sleep(300)
        self.broadcast_page.wait_element('发送').click()
        time.sleep(4)
        self.broadcast_page.screenshot('1.png')
        self.start_step('重新进入广播界面')
        self.broadcast_page.wait_element('广播').click()
        self.broadcast_page.wait_element('输入文字').send_keys('11')
        self.broadcast_page.wait_element('发送').click()
        self.broadcast_page.screenshot('2.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        user_info1 = PHPInterface.get_user_info(UserID)  # 获取玩家信息
        coin = json.loads(user_info1).get('result', {
            'coin': None
        }).get('coin')  # 获取当前银币值
        print coin
        try:
            PHPInterface.set_level(UserID, 0)
            PHPInterface.add_money(UserID, 10000 - coin)
            self.common.deletefile(self.luadriver)
            self.common.closedriver()
        except:
            print 'Closedriver failed'
        finally:
            self.common.release_user(UserID)