Ejemplo n.º 1
0
    def test_find_element_Mine(self):
        WebDriverWait(self,
                      60).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='我的']"))

        # 打开我的tab页面
        util.find_textview_by_xpath_and_click(self.driver, '我的')

        WebDriverWait(self,
                      60).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='门店']"))

        # 会员页的页面元素
        text_list1 = ['门店', '收银人员', '商品', '签约管理', '广告']

        for each in text_list1:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        util.swipe_to_up(self.driver)

        text_list2 = ['客服热线', '帮助中心']

        for each in text_list2:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        util.swipe_to_down(self.driver)
Ejemplo n.º 2
0
    def test_find_element_index(self):
        # 店长登录成功之后,首页的页面元素
        text_list = [
            '收款', '会员列表', '商品收银', '交易分析', '我的二维码', '收款金额', '新注册会员', '采宝', '账本',
            '活动', '我的'
        ]

        for each in text_list:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))
Ejemplo n.º 3
0
    def test_find_element_today(self):

        # 商户登录成功之后,首页的页面元素
        text_list = [
            '今日交易额(账本)', '去收款', '收款笔数', '充值金额', '新增会员', '(未开通会员)', '查看盈亏',
            '会员招募', '群体发券', '充值送礼', '累充送礼', '今日', '会员', '消息', '我的'
        ]

        for each in text_list:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        util.find_textview_by_xpath_and_click(self.driver, '群体发券')

        self.assertTrue(util.is_textview_exist_by_xpath(self.driver, '立即开始'))

        util.find_textview_by_xpath_and_click(self.driver, '立即开始')

        self.assertTrue(util.is_textview_exist_by_xpath(self.driver, '申请试用'))

        self.driver.back()
Ejemplo n.º 4
0
    def test_find_element_receive_money(self):
        # 店长登录成功之后,收款页面元素
        util.find_textview_by_xpath_and_click(self.driver, '收款')

        text_list = ['快捷收银', '商品收银', '去收款', '添加不参与优惠金额', '删除', '清空']

        for each in text_list:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        els1 = self.driver.find_element_by_xpath(
            "//android.widget.EditText[@text='输入金额']")
        self.assertIsNotNone(els1)
        self.driver.back()
Ejemplo n.º 5
0
    def test_find_element_today_report(self):

        WebDriverWait(self,
                      40).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='查看盈亏']"))

        util.find_textview_by_xpath_and_click(self.driver, '查看盈亏')

        # 商户登录成功之后,首页的页面元素
        text_list1 = [
            '交易金额', '订单笔数(笔)', '新增会员(人)', '充值金额(元)', '消费金额渠道占比', '退款情况'
        ]

        for each in text_list1:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        util.swipe_to_up(self.driver)

        text_list2 = ['新老会员消费金额占比', '24h交易金额走势图']

        for each in text_list2:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))

        self.driver.back()
Ejemplo n.º 6
0
    def test_find_element_Message(self):

        WebDriverWait(self,
                      60).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='消息']"))

        # 打开消息tab页面
        util.find_textview_by_xpath_and_click(self.driver, '消息')

        WebDriverWait(self,
                      60).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='消息中心']"))

        if util.is_textview_exist_by_xpath(self.driver, '平台活动'):
            self.assertIsNotNone(
                self.driver.find_element_by_xpath(
                    "//android.widget.TextView[@text='最新平台活动资讯']"))

        elif util.is_textview_exist_by_xpath(self.driver, '公告'):
            self.assertIsNotNone(
                self.driver.find_element_by_xpath(
                    "//android.widget.TextView[@text='官方公告']"))

        elif util.is_textview_exist_by_xpath(self.driver, '系统通知'):
            self.assertIsNotNone(
                self.driver.find_element_by_xpath(
                    "//android.widget.TextView[@text='系统反馈信息']"))

        elif util.is_textview_exist_by_xpath(self.driver, '数据报表'):
            self.assertIsNotNone(
                self.driver.find_element_by_xpath(
                    "//android.widget.TextView[@text='定期的运营数据推送']"))
        else:
            self.assertIsNotNone(
                self.driver.find_element_by_xpath(
                    "//android.widget.TextView[@text='您还没有新的消息']"))
Ejemplo n.º 7
0
    def test_find_element_vip(self):
        WebDriverWait(self,
                      40).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='会员']"))

        # 打开会员tab页面
        util.find_textview_by_xpath_and_click(self.driver, '会员')

        WebDriverWait(self,
                      40).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='开通会员管理功能']"))

        # 会员页的页面元素
        text_list = ['支付会员', '昨日新增(人)', '忠实用户', '七日回头率', '七日消费均单']

        for each in text_list:
            self.assertTrue(util.is_textview_exist_by_xpath(self.driver, each))
Ejemplo n.º 8
0
    def test_vip_list_search(self):

        WebDriverWait(self,
                      20).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='会员列表']"))

        util.find_textview_by_xpath_and_click(self.driver, '会员列表')

        WebDriverWait(self,
                      5).until(lambda x: self.driver.find_element_by_xpath(
                          "//android.widget.TextView[@text='搜索会员']"))

        util.find_edittext_by_xpath_and_sendkeys(self.driver, '输入会员手机号搜索',
                                                 '18621902561')

        self.driver.press_keycode(util.KEYCODE_ENTER)

        self.assertTrue(
            util.is_textview_exist_by_xpath(self.driver, '为您找到1个结果'),
            'Not find a vip')

        self.driver.back()
Ejemplo n.º 9
0
    def tearDown(self):
        user_logout3(self.driver)

        self.assertTrue(util.is_textview_exist_by_xpath(self.driver, '重新激活'),
                        'Not log out')