Ejemplo n.º 1
0
 def setUp(self):
     i = 0
     start_success = False
     while i < 3 and not start_success:
         try:
             if GlobalVarClass.get_case_platform() == "darwin":
                 self.udid = get_ios_udid_cy()
                 print(self.udid)
                 stop_ios_appium()
                 start_ios_appium(self.udid)
                 driver_setting = parse_cfg("setting", "ios")
                 self.desired_caps = {
                     'platformName': driver_setting["platformname"],
                     'deviceName': driver_setting["devicename"],
                     'device': driver_setting["device"],
                     'bundleId': driver_setting["bundleid"],
                     'version': driver_setting["version"],
                     'udid': self.udid
                 }
                 self.driver = webdriver.Remote(
                     'http://127.0.0.1:4723/wd/hub', self.desired_caps)
             else:
                 restart_adb()
                 stop_android_appium()
                 self.udid = get_android_udid()
                 print(u"设备devices:" + str(self.udid))
                 devices_setting = parse_cfg("setting", "devices")
                 if self.udid.lower() in devices_setting:
                     device_name = devices_setting[self.udid.lower()]
                 else:
                     device_name = "else"
                 GlobalVarClass.set_device_name(device_name)
                 start_android_appium(self.udid)
                 driver_setting = parse_cfg("setting", "android")
                 self.desired_caps = {
                     'platformName': driver_setting["platformname"],
                     'version': driver_setting["version"],
                     'deviceName': '%s' % self.udid,
                     'appPackage': driver_setting["apppackage"],
                     'appActivity': driver_setting["appactivity"],
                     'unicodeKeyboard':
                     eval(driver_setting["unicodekeyboard"]),
                     'resetKeyboard': eval(driver_setting["resetkeyboard"]),
                     'noReset': eval(driver_setting["noreset"])
                 }
                 self.driver = webdriver.Remote(
                     'http://127.0.0.1:4723/wd/hub', self.desired_caps)
             start_success = True
         except Exception as e:
             start_success = False
         i += 1
     if i == 3:
         raise Exception
Ejemplo n.º 2
0
    def setUp(self):
        stop_android_appium()
        self.udid = get_android_udid()
        print(self.udid)
        start_android_appium(self.udid)
        self.desired_caps = {
            'platformName': 'Android',
            'version': '4.4.2',
            'deviceName': '%s' % self.udid,
            'appPackage': 'com.iscs.mobilewcs',
            'appActivity':
            '.com.iscs.mobilewcs.activity.base.LauncherActivity',
            'unicodeKeyboard': 'True',
            'resetKeyboard': 'True'
        }
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
                                       desired_capabilities={})
        self.driver.wait_activity(
            'com.iscs.mobilewcs.activity.base.LauncherActivity', 10)

        #  第一步,点击微信登录
        # Login = LoginPage(self.driver)
        LoginPage(self.driver).WeiChat_login()
        sleep(1)
        self.driver.tap([(500, 990)], 500)
        sleep(1)
        #  跳转至前往微信登录界面
        LoginPage(self.driver).Go_WeiChat()
        sleep(1)
        # 点击第一个人
        self.driver.tap([(600, 315)], 500)
        sleep(1)
        # 点击邀请链接
        self.driver.tap([(450, 505)], 500)
        sleep(1)
        # 点击更多
        self.driver.tap([(1010, 135)], 500)
        sleep(1)
        # 在浏览器中打开
        self.driver.tap([(167, 1445)], 500)
        sleep(1)
        # 跳转至网仓App,并点击微信登录
        LoginPage(self.driver).WeiChat_login()
        sleep(1)
        self.driver.tap([(500, 990)], 500)
        sleep(1)
        pass
Ejemplo n.º 3
0
 def setUp(self):
     stop_android_appium()
     self.udid = get_android_udid()
     # resume_generate_bill()
     print(self.udid)
     self.desired_caps = {
         'platformName': 'Android',
         'version': '5.1.1',
         'deviceName': '%s' % self.udid,
         'appPackage': 'com.iscs.mobilewcs',
         'appActivity': 'com.iscs.mobilewcs.activity.base.LauncherActivity',
         'unicodeKeyboard': 'True',
         'resetKeyboard': 'True'
     }
     start_android_appium(self.udid)
     self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
                                    self.desired_caps)
     pass
Ejemplo n.º 4
0
 def setUp(self):
     self.user_id = 199289
     self.password = 1
     stop_android_appium()
     self.udid = get_android_udid()
     print(self.udid)
     self.desired_caps = {}
     self.desired_caps = dict(platformName='Android',
                              version='5.1.1',
                              deviceName='%s' % self.udid,
                              appPackage='com.iscs.mobilewcs',
                              appActivity='.activity.test.TextActivity',
                              unicodeKeyboard='True',
                              resetKeyboard='True')
     start_android_appium(self.udid)
     self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
                                    self.desired_caps)
     StartLogin(self.driver).get_start_login(self.user_id, self.password)
Ejemplo n.º 5
0
    def setUp(self):
        stop_android_appium()
        self.udid = get_android_udid()
        print(self.udid)
        self.desired_caps = {
            'platformName': 'Android',
            'version': '5.1.1',
            'deviceName': '%s' % self.udid,
            'appPackage': 'com.iscs.mobilewcs',
            'appActivity': 'com.iscs.mobilewcs.activity.base.LauncherActivity',
            'unicodeKeyboard': 'True',
            'resetKeyboard': 'True'
        }
        start_android_appium(self.udid)
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
                                       self.desired_caps)
        sleep(30)

        setFirstOne()  # 还原task库注册信息
        sleep(1)
        setSQlDelete_common()  # 还原BASIC库注册信息
        '''
                Team3组开始
                进行授权服务邀请:进入App后,点击伟大的三组button,进入界面后,输入10000243;点击登录
                进入界面,点击服务认证邀请,进入邀请好友界面,点击选择好友BUTTON,选择张三,点击邀请button,
                跳入微信,选择折耳喵,点击分享,点击返回网仓三号,点击退出。完成
            '''
        PageFollow = FollowPage(self.driver)
        PageFollow.click_team_three_btn_element()  # 点击伟大的三组button
        sleep(1)
        PageFollow.click_login_input_element()  # 进入界面后,输入10000243
        sleep(1)
        PageFollow.click_login_btn_element()  # 点击登录
        # 服务认证邀请
        LinearLayout = get_elements(
            self.driver, ("CLASS_NAME", "android.widget.LinearLayout"))
        LinearLayout[3].click()
        PageFollow.click_select_friend_btn_element()  # 选择好友
        sleep(1)
        # 选择测试账号
        Invite_Button = get_elements(self.driver,
                                     ("CLASS_NAME", "android.widget.Button"))
        Invite_Button[1].click()
        sleep(2)
        # 跳转至微信界并点击人物
        self.driver.tap([(240, 590)], 500)
        sleep(2)
        # 点击分享按钮
        self.driver.tap([(870, 1190)], 500)
        sleep(4)
        # 留在微信
        self.driver.tap([(820, 1155)], 500)
        sleep(2)
        # 点击测试账号
        self.driver.tap([(540, 260)], 500)
        sleep(3)
        # 点击邀请链接
        self.driver.tap([(561, 403)], 500)
        sleep(5)
        # 点击下载客户端右边按钮 105
        self.driver.tap([(1015, 120)], 100)
        sleep(2)
        # 点击在浏览器中打开 -->跳入网仓三号
        self.driver.tap([(900, 700)], 500)
        sleep(2)
        pass