• 一个明显区别: Airtest支持图像识别, appium没有直接支持图像识别

  • 作业二:

    #- "com.xueqiu.qa.appcrawler.plugin.ProxyPlugin"
    logLevel: "TRACE"
    #是否截图
    saveScreen: true
    showCancel: true
    reportTitle: Android Settings Traverse testing
    screenshotTimeout: 20
    tagLimitMax: 2
    currentDriver: "android"
    maxTime: 108000
    resultDir: ""
    capability:
    newCommandTimeout: 120
    launchTimeout: 120000
    platformVersion: ""
    platformName: "Android"
    autoWebview: "false"
    autoLaunch: "true"
    androidInstallTimeout: 180000
    noReset: "false"

    androidCapability:
    deviceName: "0369225877001755"
    appPackage: "com.android.settings"
    appActivity: ".Settings"
    app: ""
    appium: "http://127.0.0.1:4723/wd/hub"
    noReset: "true"
    automationName: uiautomator2

    monkeyEvents: 1000
    monkeyRunTimeSeconds: 100000
    dontStopAppOnReset: true
    headFirst: true
    autoCrawl: true

    #是否遍历WebView控件
    enterWebView: true
    unicodeKeyboard: true

    #用来确定url的元素定位xpath 他的text会被取出当作url因素
    defineUrl:
    - "//*[@selected='true']/@text"
    - "//*[contains(name(), 'NavigationBar')]/@label"

    #设置一个起始urlmaxDepth, 用来在遍历时候指定初始状态和遍历深度
    baseUrl:
    - ".*MainActivity"

    # 最大遍历深度
    maxDepth: 3
    headFirst: true
    enterWebView: true

    triggerActions:
    - action: ts123456
    xpath: //*[contains(@resource-id,'password') and @class='android.widget.EditText']
    times: 1
    - action: click
    xpath: //*[contains(@class,'CheckBox') and @text='Show password']
    times: 1
    - action: click
    xpath: //*[@content-desc='Drop down list Advanced Options. Double-tap to expand.']
    times: 1
    - action: driver.swipe(0.5, 0.8, 0.5, 0.2)
    xpath: //*[contains(@class, 'ScrollView')]
    times: 1
    - action: click
    xpath: //*[contains(name(),'Button') and [@text='CONNECT']
    times: 1

    firstList:
    - xpath: "//*[contains(name(),'Switch') and @clickable='true']//*"
    selectlist:
    - xpath: "//*[@clickable="true"]//android.widget.TextView[string-length(@text)>0 and string-length(@text)<20]"
    - xpath: "//*[contains(name(), 'Text') and string-length(@value)>0 and string-length(@value)<20 ]"
    - xpath: "//*[contains(name(),'Button']"
    - xpath: "//*[contains(name(),'Image']"
    lastList:
    - xpath: "//*[contains(@resource-id, "shutter_text")]"
    - xpath: "//*[contains(@content-desc, 'Navigate up') and @class='android.widget.ImageButton']"
    - xpath: "//*[contains(@content-desc, 'More options') and @class='android.widget.ImageButton']"
    - xpath: "//*[@resource-id="com.mediatek.camera:id/top_bar"]"

    backButton:
    - xpath: "//*[contains(@resource-id, "toolbar_back")]"
    - xpath: "//*[contains(@content-desc, 'Navigate up') and @class='android.widget.ImageButton']"