from appium import webdriver
from selenium.webdriver.support.wait import WebDriverWait


class Base:
    # 初始化获取driver
    def __init__(self):
        # 定义空字典
        desired_caps = {}
        # 指定平台名称 必须写对
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        # 不能为空，可以随便写
        desired_caps['deviceName'] = 'emulator-5554'
        # 包名/
        desired_caps['appPackage'] = 'com.yunmall.lc'
        # 启动名
        desired_caps['appActivity'] = 'com.yunmall.ymctoc.ui.activity.MainActivity'

        # 声明机驱动对象
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
        # 隐式等待
        self.driver.implicitly_wait(10)

    # 查找元素
    def base_find(self,loc,timeout=30,poll=0.5,n=0):
       return WebDriverWait(self.driver,timeout=timeout,
                      poll_frequency=poll).until(lambda x:x.find_elements(*loc)[n])

    # 点击
    def base_click(self,loc):
        # 调用元素
        self.base_find(loc).click()
    # 输入
    def base_input(self,loc,value):
        el=self.base_find(loc)
        el.clear()
        el.send_keys(value)

985b53e0cde909af57b8d7096f537521e38fb6b2
<mask token>


class Base:
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class Base:

    def __init__(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        desired_caps['deviceName'] = 'emulator-5554'
        desired_caps['appPackage'] = 'com.yunmall.lc'
        desired_caps['appActivity'
            ] = 'com.yunmall.ymctoc.ui.activity.MainActivity'
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
            desired_caps)
        self.driver.implicitly_wait(10)
    <mask token>

    def base_click(self, loc):
        self.base_find(loc).click()

    def base_input(self, loc, value):
        el = self.base_find(loc)
        el.clear()
        el.send_keys(value)

<mask token>


class Base:

    def __init__(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        desired_caps['deviceName'] = 'emulator-5554'
        desired_caps['appPackage'] = 'com.yunmall.lc'
        desired_caps['appActivity'
            ] = 'com.yunmall.ymctoc.ui.activity.MainActivity'
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
            desired_caps)
        self.driver.implicitly_wait(10)

    def base_find(self, loc, timeout=30, poll=0.5, n=0):
        return WebDriverWait(self.driver, timeout=timeout, poll_frequency=poll
            ).until(lambda x: x.find_elements(*loc)[n])

    def base_click(self, loc):
        self.base_find(loc).click()

    def base_input(self, loc, value):
        el = self.base_find(loc)
        el.clear()
        el.send_keys(value)

from appium import webdriver
from selenium.webdriver.support.wait import WebDriverWait


class Base:

    def __init__(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        desired_caps['deviceName'] = 'emulator-5554'
        desired_caps['appPackage'] = 'com.yunmall.lc'
        desired_caps['appActivity'
            ] = 'com.yunmall.ymctoc.ui.activity.MainActivity'
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',
            desired_caps)
        self.driver.implicitly_wait(10)

    def base_find(self, loc, timeout=30, poll=0.5, n=0):
        return WebDriverWait(self.driver, timeout=timeout, poll_frequency=poll
            ).until(lambda x: x.find_elements(*loc)[n])

    def base_click(self, loc):
        self.base_find(loc).click()

    def base_input(self, loc, value):
        el = self.base_find(loc)
        el.clear()
        el.send_keys(value)

from appium import webdriver
from selenium.webdriver.support.wait import WebDriverWait


class Base:
    # 初始化获取driver
    def __init__(self):
        # 定义空字典
        desired_caps = {}
        # 指定平台名称 必须写对
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.1'
        # 不能为空，可以随便写
        desired_caps['deviceName'] = 'emulator-5554'
        # 包名/
        desired_caps['appPackage'] = 'com.yunmall.lc'
        # 启动名
        desired_caps['appActivity'] = 'com.yunmall.ymctoc.ui.activity.MainActivity'

        # 声明机驱动对象
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
        # 隐式等待
        self.driver.implicitly_wait(10)

    # 查找元素
    def base_find(self,loc,timeout=30,poll=0.5,n=0):
       return WebDriverWait(self.driver,timeout=timeout,
                      poll_frequency=poll).until(lambda x:x.find_elements(*loc)[n])

    # 点击
    def base_click(self,loc):
        # 调用元素
        self.base_find(loc).click()
    # 输入
    def base_input(self,loc,value):
        el=self.base_find(loc)
        el.clear()
        el.send_keys(value)
