コード例 #1
0
 def test_slowShot(self,action:ElementActions):
     action.click(HomePage.拍摄按钮)
     action.click(ShotPage.拍摄速度)
     action.click(ShotPage.慢速)
     action.click(ShotPage.拍摄按钮)
     action.sleep(12)
     assert action.is_element_displayed(ShotPage.编辑完成,is_retry=False)
コード例 #2
0
    def test_add_poster(self, action: ElementActions):

        action.click(HomePage.关注按钮)
        action.sleep(1)
        action.capture_screen(
            u'关注截图',
            '/Users/zhangweishun/Desktop/appium-lich-master/screenshot/')
コード例 #3
0
    def test_download(self, action: ElementActions):
        action.click(HomePage.下载按钮)
        action.sleep(2)

        # 断言再想想,很难想
        action.capture_screen(
            u'下载截图',
            '/Users/zhangweishun/Desktop/appium-lich-master/screenshot/')
コード例 #4
0
 def test_Upload(self,action:ElementActions):
     action.click(HomePage.拍摄按钮)
     action.click(ShotPage.上传视频)
     action.sleep(2)
     action.click(ShotPage.选择视频)
     action.click(ShotPage.剪切完成)
     action.click(ShotPage.编辑完成)
     assert action.is_text_displayed('Post')
コード例 #5
0
ファイル: test_home.py プロジェクト: Joylee1943/LiancheMofang
def login(account, password, action: ElementActions):
    time.sleep(5)
    # action.driver.find_element_by_id('com.shautolinked.car:id/btnLeft').click()

    action.text(LoginPage.用户名, account, clear_first=True)
    action.text(LoginPage.密码, password, clear_first=True)
    action.sleep(1)
    action.click(LoginPage.登录)
コード例 #6
0
 def pageinto(self, action: ElementActions):
     action.sleep(0.5).start_activity(self.activity)
     usercenterpage = UserCenterPage()
     # usercenterpage.pageinto(action)
     if action.find_ele(usercenterpage.注册登陆) != None:
         action.click(usercenterpage.注册登陆)
     else:
         log.info('app已是登陆状态,无法进入登陆页')
コード例 #7
0
    def test_musicShot(self,action:ElementActions):
        action.click(HomePage.音乐集合页按钮)

        action.click(MusicCgPage.拍摄按钮)
        action.sleep(3)

        assert action.is_text_displayed('Tap to shoot')
        """
コード例 #8
0
    def test_share(self, action: ElementActions):

        action.click(HomePage.分享按钮)
        action.sleep(1)
        """
        判断是否有文本"share to"
        """
        action.is_text_displayed('Share to')
コード例 #9
0
 def test_login(self, action: ElementActions):
     L.d('test_login')
     account = Steps.get_account()
     action.click(HomePage.登录入口)
     action.text(LoginPage.账户, account[0])
     action.text(LoginPage.密码, account[1])
     action.sleep(1)
     action.click(LoginPage.登录)
     assert action.is_toast_show('欢迎回来')
コード例 #10
0
 def test_switchShot(self,action:ElementActions):
     """
     翻转摄像头
     :return:
     """
     action.click(HomePage.拍摄按钮)
     action.sleep(1)
     action.capture_screen(u'摄像头', '/Users/zhangweishun/Desktop/appium-lich-master/screenshot/')
     action.click(ShotPage.切换摄像头)
     action.sleep(1)
     action.capture_screen(u'切换摄像头', '/Users/zhangweishun/Desktop/appium-lich-master/screenshot/')
コード例 #11
0
ファイル: test_home.py プロジェクト: Joylee1943/LiancheMofang
 def test_login_empty_password(self, action: ElementActions):
     account = Steps.get_account()
     time.sleep(20)
     action.swip_left(3)
     time.sleep(5)
     L.d('test_login_empty_password')
     L.i('账户{0},密码为空'.format(account[0]))
     action.click(HomePage.登录)
     login(account[0], "", action)
     action.sleep(5)
     try:
         assert action.is_text_displayed('密码能为空1')
     except Exception as e:
         action.save_failure_pic(sys._getframe().f_code.co_name)
コード例 #12
0
    def test_Normalshot(self, action: ElementActions):
        action.click(HomePage.拍摄按钮)
        if action.is_text_displayed('Allow Access', is_retry=False):
            action.click(ShotPage.申请权限)
            action.click(ShotPage.获取权限)
            action.click(ShotPage.获取权限)
            action.click(ShotPage.拍摄提示)
        else:pass

        action.click(ShotPage.拍摄按钮)
        action.sleep(15)
        action.click(ShotPage.编辑完成)
       #action.click(ShotPage.上传按钮)

        assert action.is_text_displayed('Post')
コード例 #13
0
    def test_home(self, action: ElementActions):

        # up.登录页.login(action,'13550234762','tmhrush2233')

        action.click(p.特卖首页.搜索输入框)

        #因为调用action的大部分公用方法是返回self,所以可以一条语句执行多次不同方法
        action.text(p.分类列表搜索页.搜索输入框,"口红")\
            .click(p.分类列表搜索页.搜索按钮)

        action.click(p.搜索后列表页.第一个商品项)

        #循环下拉,检查是否有对应关键字,找到后终止
        for count in range(20):
            if action.swip_down().is_text_displayed("商品参数"):
                break
        #没有对应关键字抛出错误
        if action.is_text_displayed("口红") == False:
            raise NotFoundTextError

        action.sleep(1)
コード例 #14
0
def browseproduct(action: ElementActions, key='专场', position=0):
    p.搜索后列表页.pageinto(action, key)
    # 点击对应position的商品
    action.sleep(1).click_ele(
        action.find_ele(p.搜索后列表页.商品项标题s, is_Multiple=True)[position]).sleep(2)

    productname_ele = None
    for index in range(10):
        action.swip_down()
        tmpele = action.find_ele(p.商品详情页.商品参数列表)
        goods_value_eles = action.find_ele_child(tmpele,
                                                 p.商品详情页.商品参数列表_商品参数值s,
                                                 is_Multiple=True,
                                                 wait=3)
        if len(goods_value_eles) > 0:
            productname_ele = goods_value_eles[0]
            break
    if productname_ele == None:
        raise NotFoundElementError

    action.get_img('商品详情页')
    productname = action.get_text_ele(productname_ele)

    return productname
コード例 #15
0
    def test_5partshot(self,action:ElementActions):
        action.click(HomePage.拍摄按钮)
        action.click(ShotPage.拍摄按钮)
        action.sleep(3)
        action.click(ShotPage.拍摄按钮)
        action.click(ShotPage.拍摄按钮)
        action.sleep(3)
        action.click(ShotPage.拍摄按钮)
        action.click(ShotPage.拍摄按钮)
        action.sleep(3)
        action.click(ShotPage.拍摄按钮)
        action.click(ShotPage.拍摄按钮)
        action.sleep(3)

        action.click(ShotPage.编辑完成)

        assert action.is_text_displayed('Post')
コード例 #16
0
    def test_comment(self, action: ElementActions):

        action.sleep(1)
        action.click(HomePage.评论按钮)
        action.sleep(1)
        action.click(CommentPage.评论框打开)
        action.text(CommentPage.评论框输入, 'nice')
        action.click(CommentPage.评论发送)
        action.sleep(1)
        assert action.is_text_displayed('nice')
コード例 #17
0
ファイル: test_home.py プロジェクト: wxpsudichina/appium_test
 def test_login(self, action: ElementActions):
     L.d('test_login')
     allure.attach('描述', '这是一个登陆的case')
     account = Steps.get_account()
     action.sleep(3)
     # action.test_SwipeGuideImages()
     action.click(HomePage.登录入口)
     action.text(LoginPage.账户, account[0])
     action.text(LoginPage.密码, account[1])
     action.sleep(1)
     action.click(LoginPage.登录)
     action.sleep(3)
     assert action._find_text_in_page("我的")
コード例 #18
0
    def test_login(self, action: ElementActions):
        L.d('test_login')
        """
        检查是否在登录状态,在登陆的话就退出登录再登录
        """
        action.click(HomePage.我的)
        if action.is_text_displayed('like'):
            action.click(MyPage.设置)
            action.click(SettingPage.登出)
            action.click(SettingPage.确定)
            action.click(HomePage.我的)

        else: pass
        action.click(HomePage.登陆按钮)
        action.sleep(1)
        action.text(LoginPage.手机号, '96522075359')
        action.click(LoginPage.获取验证码)
        action.sleep(1)
        action.text(LoginPage.密码, '2333')
        action.sleep(0.5)
        action.click(LoginPage.登陆)
        assert action.get_text(MyPage.名字) == 'kirua'
コード例 #19
0
 def login(self, action: ElementActions, account, password):
     self.switch_密码登录tag(action)
     action.text(self.账号输入框, account).text(self.密码输入框,
                                           password).click(self.登录按钮)
     action.sleep(5)
コード例 #20
0
 def test_epicShot(self,action:ElementActions):
     action.click(ShotPage.拍摄速度)
     action.click(ShotPage.极慢)
     action.click(ShotPage.拍摄按钮)
     action.sleep(8)
     assert action.is_element_displayed(ShotPage.编辑完成,is_retry=False)