def setUp(self):
        clear_ssdb(self.number)
        my_btn = get_element(self.driver, 'my_btn')
        my_btn.click()
        # self.driver.find_element_by_ios_predicate('type="XCUIElementTypeButton" and name=" 登录去赚钱"').click()
        my_login_btn = get_element(self.driver, 'my_login_btn')
        my_login_btn.click()
        # inpu = self.driver.find_element_by_ios_predicate("type='XCUIElementTypeTextField'")
        inpu = get_element(self.driver, 'login_input')
        inpu.clear()
        inpu.send_keys(self.number)

        # psw = self.driver.find_element_by_ios_predicate('type="XCUIElementTypeSecureTextField"')
        psw = get_element(self.driver, 'login_psw')
        psw.send_keys(self.psw)

        # login = self.driver.find_element_by_ios_predicate('type="XCUIElementTypeButton" and name="登录"')
        login = get_element(self.driver, 'login_btn')
        login.click()

        # jump = self.driver.find_element_by_ios_predicate('type="XCUIElementTypeButton" and name="跳过"')
        jump = get_element(self.driver, 'jump_btn')
        jump.click()

        l = get_massage.get_size(self.driver)
        x1 = int(l[0] * 0.1)
        y1 = int(l[1] * 0.95)
        self.driver.tap([(x1, y1)], 200)
        sleep(3)
Example #2
0
 def tearDown(self):
     #print('w')
     my_btn = get_element(self.driver, 'my_btn')
     my_btn.click()
     setting = get_element(self.driver, 'setting')
     setting.click()
     logout_btn = get_element(self.driver, 'logout_btn')
     logout_btn.click()
     clear_ssdb(self.number)
 def setUpClass(cls):
     clear_ssdb()
     cls.log = myLog.MyLog.get_log()
     cls.logger = cls.log.get_logger()
     # set up appium
     app = os.path.abspath(
         '/Users/yangyue/Library/Developer/Xcode/DerivedData/ios-bcfdjtsoncuvfdepygsrhjarjcya/Build/Products/Debug-iphonesimulator/ios.app'
     )
     cls.driver = webdriver.Remote(
         command_executor='http://127.0.0.1:4723/wd/hub',
         desired_capabilities={
             'app': app,
             'platformName': 'iOS',
             'platformVersion': '12.1',
             "noReset": True,
             'deviceName': 'iPhone XR'
         })
Example #4
0
 def setUp(self):
     clear_ssdb(self.number)