Пример #1
0
class C081_DFQP_Mall(TestCase):
    '''
    大厅进入商城页面
    '''
    owner = "MindyZhang"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        # 每个用例都需要关闭活动,把这个放在初始化里面实现
        self.common.closeactivity(self.luadriver)
        self.hall_page = Hall_Page()
        self.mall_page = Mall_Page()

    def run_test(self):
        '''
        测试用例
        '''
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step("进入商城页面")
        self.hall_page.wait_element("商城").click()
        time.sleep(2)
        self.mall_page.get_element("银币页签").click()
        time.sleep(2)
        self.mall_page.screenshot('Mall1.png')
        self.mall_page.wait_element("金条页签").click()
        time.sleep(2)
        self.mall_page.screenshot('Mall2.png')
        self.mall_page.wait_element("道具页签").click()
        time.sleep(2)
        self.mall_page.screenshot('Mall3.png')
        self.mall_page.wait_element("VIP页签").click()
        time.sleep(2)
        self.mall_page.screenshot('Mall4.png')

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        self.common.closedriver()
Пример #2
0
class C31056_DFQP_Mall(TestCase):
    '''
    安装支付宝支付界面显示
    '''
    owner = "LucyLiu"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        # 初始化Luadriver
        self.luadriver = self.common.setupdriver()
        # 每个用例都需要关闭活动,把这个放在初始化里面实现
        self.common.closeactivity_switchserver(self.luadriver,"预发布")
        self.hall_page = Hall_Page()
        self.mall_page = Mall_Page()

    def run_test(self):
        '''
        测试用例
        '''
        self.start_step("等待页面加载完成")
        self.hall_page.wait_element("同步标志")
        self.start_step("进入商城页面")
        self.hall_page.wait_element("商城").click()
        time.sleep(5)
        self.mall_page.get_element("金条商品").click()
        time.sleep(2)
        self.mall_page.screenshot('zhifu.png')
        time.sleep(2)
        try:
            self.mall_page.get_element("支付宝").click()
            self.mall_page.screenshot('zhifubao.png')
        except:
            print "需升级为手机号码"

    def post_test(self):
        '''
        测试用例执行完成后,清理测试环境
        '''
        self.common.closedriver()
Пример #3
0
class PerTest_QIPAIHALL_Mall(TestCase):
    '''
    商城操作
    '''
    owner = "JessicZeng"
    status = EnumStatus.Design
    priority = EnumPriority.High
    timeout = 5

    def pre_test(self):
        self.common = Common()
        self.hall_page = Hall_Page()
        self.mall_Page = Mall_Page()

    def run_test(self):
        '''
        测试步骤
        1、大厅点击商城入口
        2、点击第一金条购买item,关闭购买框
        3、滑动金条购买列表
        4、切换到银币购买列表
        5、滑动银币购买列表
        6、切换到道具列表
        7、执行购买第一个道具操作,打开购买弹框后取消购买操作
        8、滑动道具列表
        9、切换到VIP页
        10、返回大厅
        不同类型的商品列表,共用listView和Item
        '''
        self.hall_page.wait_element("同步标志")

        self.start_step("点击大厅商城入口")
        self.common.sendTagBroadcast(EnumSceneName.Mall, EnumSceneType.Start)

        try:
            #点击商城
            self.hall_page.get_element("商城", 0).click()
            time.sleep(2)
            self.mall_Page.wait_element("同步标志")
            self.common.taskScreenShot("openMallPop.jpg")

            #购买金条(选择第一个item)并滑动金条列表
            self.start_step("购买金条")
            self.mall_Page.get_element("item0", 0).click()
            self.mall_Page.wait_element("金条购买框Flag")
            self.common.taskScreenShot("buyGoldPop.jpg")
            self.mall_Page.get_element("金条购买框关闭", 0).click()
            time.sleep(1)
            self.start_step("滑动金条列表")
            self.common.swipeList(self.mall_Page.get_element("物品列表"))

            #切换到银币页并滑动列表
            self.start_step("切换到银币Tab")
            self.mall_Page.get_element("银币Tab", 0).click()
            time.sleep(2)
            self.common.taskScreenShot("silverView.jpg")
            self.start_step("滑动银币列表")
            self.common.swipeList(self.mall_Page.get_element("物品列表"))

            #切换到道具页面,并查看购买道具框,最后滑动列表
            self.start_step("切换到道具Tab")
            self.mall_Page.get_element("道具Tab", 0).click()
            time.sleep(2)
            self.common.taskScreenShot("propView.jpg")
            self.start_step("购买道具")
            self.mall_Page.get_element("item0", 0).click()
            self.mall_Page.wait_element("道具购买框Flag")
            self.common.taskScreenShot("buyPropPop.jpg")
            self.mall_Page.get_element("道具购买框关闭", 0).click()
            time.sleep(1)
            self.start_step("滑动道具列表")
            self.common.swipeList(self.mall_Page.get_element("物品列表"))

            #切换到VIP
            self.start_step("切换到VIPTab")
            self.mall_Page.get_element("VIPTab", 0).click()
            time.sleep(2)
            self.common.taskScreenShot("vipView.jpg")

            #关闭商城弹框
            self.mall_Page.get_element("商城关闭", 0).click()

        except:
            self.common.platformLog("操作商城失败")

        finally:
            self.common.checkPopVisible(self.mall_Page)
            self.hall_page.wait_element("同步标志")

        time.sleep(5)
        self.common.sendTagBroadcast(EnumSceneName.Mall, EnumSceneType.Stop)