uasier
V2EX  ›  问与答

安卓定制功能测试。涉及 UI,有办法做到在 app 里面集成,然后安装程序以后,可以直接在手机上自动化运行么。 安卓新手,求各位大哥解惑。

  •  1
     
  •   uasier · Sep 14, 2021 · 566 views
    This topic created in 1727 days ago, the information mentioned may be changed or developed.

    目前能找到的方式,

    • 不涉及 UI,可以通过有限的 adb 命令进行执行,再通过读取设备内部信息来确定结果( Runtime.getRuntime().exec(cmd);)

    • 涉及 UI,采用 airtest 类自动化框架,完成 UI 自动化测试,当然可以在运行时结合 adb 获取状态作为补充,并且有一些图形库可以作为辅助手段定位

    • 涉及 UI,采用 Junit4 等单元测试框架,借助 android studio 等工具,直接在电脑上运行测试用例,能够通过 google 的 Instrumentation 来达到 UI 相关的断言,当然也完全覆盖不涉及 UI 的那部分自动化

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   884 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:05 · PVG 06:05 · LAX 15:05 · JFK 18:05
    ♥ Do have faith in what you're doing.