npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

axe-appium-ios

v0.2.0-alpha.6

Published

autotest by appium

Readme

axe-appium-ios

Axe系统中,使用 appium做自动化测试。appium为黑盒UI测试, 我们的自动化测试,基于Appium, 添加性能测试功能, 并制作测试报告。

当前情况

目前 Axe的自动化测试功能已初步成型, 以下有两份测试报告可供了解:

但是还有一些部分没有开发完成。 对于整个自动化测试功能,是作为 Axe框架的v0.2版本的重大更新, 框架下几乎所有库都要有相应的变更,所以预计还要一段时间才能正式发布。

基础功能

  1. 记录测试中关键节点的截图。
  2. 记录测试中, 业务组件之间的交互信息,即Axe框架中的 RouteDataEvent交互。
  3. 对于测试中的崩溃,导出并记录崩溃日志。

性能测试

  1. 在测试过程中,使用 Instruments 监控应用的性能情况。

  2. AXE : 在Xcode10上,支持自定义Instrument ,所以我们自定义了一个 AXE的测试类型,来获取基础的信息:CPU使用率、内存情况、磁盘读写、FPS和GPU使用率、网络读写情况。 (不支持低版本的机型)

  3. Time Profiler : 获取函数耗时情况, 展示数据分为两份,一份是使用SpeedScope展示的火焰图,一份是主线程高耗时函数分析:通过分析耗时,发现在主线程中执行超过17毫秒的函数。

  4. Leaks : 一开始设想在自动化测试时,通过Leaks来自动检测内存泄漏情况。 但是现在使用上存在问题:

    1. Instruments只支持自身调起设备上用的情况下去检测,而不支持运行时attach到该应用上, 而目前appium只支持 attach到已运行应用的模式。(旧系统设备可以连接,如我测试使用的iOS10的设备。)
    2. Leaks的测试数据太大,5、6分钟的检测数据,可能就达到了2G以上的大小,而 appium现在对大的测试文件的传输的处理并不好,导致无法准确地获取性能测试的结果。

    基于以上两个原因,Leaks测试暂时还是无法稳定运行,之后我们会继续研究解决Leaks测试的稳定性。

配置说明

目前测试用例的编写和使用情况,参考 Test模块. 在 test文件夹下,设置一个 setting.json的配置文件,以进行配置。

目前将测试分为三种类型:

  • debug: 通常用来本地测试的情况,默认选中第一台真机来测试。
  • release: 提交代码,进行打包发布版本时使用的测试,一般要多设置几台指定机型以保证一定的兼容性。
  • profile: 性能测试一般覆盖需要进行的性能测试种类即可,即一种性能测试只测一次。

配置介绍:

  • debugTestDevices : Array类型,指定测试列表。如果没有指定,则默认使用第一个真机。列表中的值为设备的udid,如 ["e876a55aec299761251f30d808fdd94bf66e26cf"].

  • releaseTestDevices : Array类型,指定测试列表。 如果没有指定,则默认使用所有真机。。。

  • profileTestSetting : Object类型, 对于性能测试,我们将其按照具体的类型来设置,如 :

      	"profileTestSetting": {
      		"AXE": ["e876a55aec299761251f30d808fdd94bf66e26cf"],
      		"Time Profiler": ["e876a55aec299761251f30d808fdd94bf66e26cf"]
      	},
  • testServer : 测试服务器的地址,测试服务器默认由axe-appium-ios调起,与appium客户端位于同一台机器中,使用端口2670. 但是测试设备也要访问测试服务器,所以设备与测试服务器要在同一个网络环境下,而这里写的服务器地址,是给测试设备访问测试服务器使用的。 如 :"testServer":"http://192.168.1.3:2670"

  • testOutputDir : 测试数据和报告输出文件夹,应固定为 ../build/autotest . 测试用例放在项目的test目录下,而测试输出在项目的build目录下。

使用细节

安装依赖

  • appium

  • ios-deploy

  • ifuse 安装:

      brew uninstall ideviceinstaller
      brew uninstall libimobiledevice
      brew uninstall --ignore-dependencies usbmuxd
      brew install --HEAD usbmuxd
      brew install --HEAD libimobiledevice
      brew link --overwrite libimobiledevice
      brew install ideviceinstaller
      brew link --overwrite ideviceinstaller
      brew cask install osxfuse
      brew install ifuse 
  • TraceUtil安装 : 见TraceUtility 仓库,目前需要手动编译并安装,以支持分析性能测试数据。

测试约束

  • 每个小的测试项,完成时必须恢复到最初的页面。
  • 只支持一次启动的测试, 暂时不支持多次启动的测试。
  • 测试分两块, UI测试, 和功能的mock测试。 当前我们只关注于业务组件的UI测试。

接口说明

  • getDriver() : 获取一个appium的PromiseChainWebdriver
  • close() : 关闭一个driver, 用于在一次测试中,测试多次启动的情况。目前暂未很好支持这种需求。
  • mark(title) : 截图并记录信息。
  • action : 在脚本中,获取到最近的业务组件的交互信息,目前不推荐使用。
  • createScenario() 和 endScenario(): 测试用例的开始和结束的信息上报。

相关库

  • axe-instruments-profiler : AXE提供的自定义Instruments,获取应用的CPU使用率、内存情况、磁盘读写、FPS和GPU使用率、网络读写情况。
  • TraceUtility : 从Instruments文档中导出数据的工具。
  • axe-test-server : 测试服务器,用于接受appium测试脚本和测试设备上报数据,整理测试报告。
  • axe-test-report : 测试报告网页部分。 需要结合测试服务器的数据,才能正确展示测试报告。