コード例 #1
0
 def check_account(self, request, init_setup):
     """
     校验当前登陆账号是否正确,不正确则自动切换
     调用的函数需要传参:
     @pytest.mark.parametrize('switch_account', ['robotic'], indirect=True)
     :param init_setup:
     :param request:
     :return:
     """
     account = request.param
     if home_page.is_welcome() is False:
         start_page.into_login()
         if account is not None:
             start_page.select_country('login', data.get_country(account))
             start_page.login_email(data.get_account(account),
                                    data.get_account('pw'))
         else:
             raise Exception('登陆账号为空')
     else:
         if data.get_username(account) in home_page.read_username():
             return
         if account is not None:
             TestBulbs.change_account(account)
         else:
             raise Exception('登陆账号为空')
コード例 #2
0
 def test_login_error_email(self, email, pw, expect, not_login):
     """
     输入错误邮箱不能登陆:
     1. 进入注册页面,国家选择UK
     【checkpoint】区域=UK
     2. 输入账号:[email protected],错误密码:123456,点击登录
     【checkpoint】登陆失败,文本提密码错误:Please enter a valid email address (Example: [email protected]).
     输入错误密码不能登陆:
     1. 进入注册页面,国家选择UK
     【checkpoint】区域=UK
     2. 输入账号:[email protected],错误密码:123456,点击登录
     【checkpoint】登陆失败,文本提密码错误:Incorrect email login or password. Please try again.
     """
     start_page.into_login()
     start_page.select_country('login', data.get_country('email'))
     assert start_page.check_country(data.get_country('email'))
     start_page.login_email(email, pw)
     assert start_page.text_display(expect), '错误邮箱/密码登陆提示信息错误'
コード例 #3
0
 def test_login_email_success(self, not_login):
     """
     输入正确邮箱及正确的邮箱密码可正常登陆:
     1. 进入注册页面,国家选择UK
     【checkpoint】区域=UK
     2. 输入账号:YI@aaa. com,密码:12345678,点击登录
     【checkpoint】登陆成功进入app,显示welcome
     3.进入用户中心界面
     【checkpoint】用户中心账号为:YI@aaa. com
     """
     start_page.into_login()
     start_page.select_country('login', data.get_country('email'))
     assert start_page.check_country(data.get_country('email'))
     start_page.login_email(data.get_account('share'),
                            data.get_account('pw'))
     assert home_page.is_welcome(), '登陆失败,未进入app主页'
     home_page.into_system()
     system_page.view_account()
     assert user_page.is_user_id(data.get_account('share')), '邮箱登陆后账号显示错误'
コード例 #4
0
 def test_login_phone_success(self, not_login):
     """
     输入正确手机号及正确的手机密码可正常登陆:
     1. 进入登陆页面,国家选择中国
     【checkpoint】区域=中国
     2. 输入账号:13534173939,密码:12345678,点击登录
     【checkpoint】登陆成功进入app首页
     3.进入用户中心界面
     【checkpoint】用户中心账号为:13534173939
     """
     start_page.into_login()
     start_page.select_country('login', data.get_country('phone'))
     assert start_page.check_country(
         data.get_country('phone')), '账号登录国家选择错误'
     start_page.login_phone(
         data.get_account('phone'),
         data.get_account('pw'))  # data.get_account('pw')
     assert home_page.is_welcome(), '登陆失败,未进入app主页'
     home_page.into_system()
     system_page.view_account()
     assert user_page.is_user_id(data.get_account('phone')), '手机登陆后账号显示错误'
コード例 #5
0
 def change_account(account):
     """
     切换登陆账号
     :return:
     """
     home_page.into_system()
     system_page.view_account()
     user_page.logout()
     time.sleep(2)
     start_page.into_login()
     start_page.select_country('login', data.get_country(account))
     start_page.login_email(data.get_account(account),
                            data.get_account('pw'))
     start_page.loading(10)
コード例 #6
0
 def test_login_error_phone(self, phone, pw, expect, not_login):
     """
     输入错误手机号不能登陆:
     1. 进入登陆页面,国家选择中国
     【checkpoint】区域=中国
     2.输入错误账号:135341739,密码:12345678,点击登录
     【checkpoint】登陆失败,toast提示手机号错误:incorrect phone number format.
     输入错误密码不能登陆:
     1. 进入注册页面,国家选择中国
     【checkpoint】区域=中国
     2. 输入账号:13534173939,错误密码:123456,点击登录
     【checkpoint】登陆失败,toast提示密码错误:Incorrect email login or password
     """
     start_page.into_login()
     start_page.select_country('login', data.get_country('phone'))
     assert start_page.check_country(
         data.get_country('phone')), '账号登录国家选择错误'
     start_page.login_phone(phone, pw)
     if start_page.platform == 'ios':
         assert start_page.is_toast_exist(expect, True,
                                          True), '错误手机号/密码登陆的提示信息错误'
     else:
         assert start_page.text_display(expect), '错误手机号/密码登陆的提示信息错误'
コード例 #7
0
 def test_sign_error_param(self, username, password, expect, not_login):
     """
     使用已注册的邮箱不能注册:  init_setup
     1. 点击 Sign Up,进入注册页面
     2. 选择地区:UK,输入邮箱:[email protected],默认密码:12345678,点击Sign Up按钮提交注册
     【checkpoint】弹窗提示邮箱[email protected]已注册【This email adress is already registered . . . 】
     密码不符合规范不能注册:
     1. 点击 Sign Up,进入注册页面
     2. 输入邮箱:[email protected],密码:123456,点击Sign Up按钮提交注册
     【checkpoint】注册失败,文案提示:Your password must be 8-20 characters long.
     """
     country = data.get_country('email')
     if start_page.platform != 'ios':
         start_page.login_back()
     start_page.into_sign()
     start_page.select_country('sign', country)
     start_page.sign_email(country, username, password)
     assert start_page.text_display(expect), '错误提示信息不对'
コード例 #8
0
    def test_sign_success(self, username, password, not_login):
        """
        输入未注册的邮箱及正确的密码可注册成功:
        1. 点击 Sign Up,进入注册页面
        2. 输入密码Yi@a. com,密码:12345678,点击SignUp按住提交注册
        【checkpoint】注册成功进入app,显示 welcome
        【checkpoint】检查当前登陆账号是否为:[email protected]
        """
        country = data.get_country('email')
        if start_page.platform != 'ios':
            start_page.login_back()
        start_page.into_sign()
        start_page.select_country('sign', country)
        start_page.sign_email(country, username, password)

        assert home_page.is_welcome(), '注册后未进入APP首页'
        home_page.into_system()
        system_page.view_account()
        assert user_page.is_user_id(username), '登陆账号与注册账号不一致'