Skip to content

Releases: AirtestProject/Airtest

v1.1.4版本更新

06 Jul 07:36
a48abab
Compare
Choose a tag to compare

Android API修改:

  • Android部分点击接口修改:
    将Android的点击代码进行了一些维护,对于以前一部分需要调用到Android.minitouch才能运行的接口(主要是pinch, swipe_along, two_finger_swipe),现在统一直接在Android层面进行调用:
old:
dev = device()
dev.minitouch.pinch()
dev.minitouch.swipe_along([(100, 300), (300, 300), (100, 500), (300, 600)])
dev.minitouch.two_finger_swipe( (100, 100), (200, 200) )
->
new:
dev = device()
dev.pinch()  # 双指捏合或分开
dev.swipe_along([(100, 300), (300, 300), (100, 500), (300, 600)])  # 连续滑过一系列坐标
dev.two_finger_swipe( (100, 100), (200, 200) )  # 两个手指一起滑动

更多调用代码示例与参数示例,可以参考:tests/test_android.py

  • 如果使用了自定义点击DownEvent/UpEvent/SleepEvent,请将import语句修改成如下内容:
old:
from airtest.core.android.minitouch import *
->
new:
from airtest.core.android.touch_methods.base_touch import *
  • 修复了部分型号的小米手机(主要是MIUI11版本)在横屏时使用javacap截图,会导致图像被不正确压缩的情况。

    • 请卸载手机上已有的Yosemite.apk,重新连接手机即可重装新版本的Yosemite.apk修复此问题。
      注: 若手机更新到MIUI12版本,无需使用javacap模式就能直接获取到手机屏幕了,建议大家直接更新系统
  • 修复了MIUI11+android10下,is_screenon(手机是否亮屏)和is_locked(手机是否锁屏)接口无法使用的bug

iOS部分修改:

  • 修复iOS部分机型横屏异常及提高启动应用的速度
  • iOS-Tagent对xcode的支持更新到11.5版本,iOS版本支持到13.5(最新版本的xcode目前暂时还有一些问题需要兼容)

Android API modification:

  • Modification of some click interfaces of Android:
    Performed some maintenance on the Android click code. For the previous part of the interface that needs to be called to Android.minitouch to run (mainly pinch, swipe_along, two_finger_swipe), it is now called directly at the Android level. like this:
old:
dev.minitouch.pinch()
dev.minitouch.swipe_along([(100, 300), (300, 300), (100, 500), (300, 600)])
dev.minitouch.two_finger_swipe( (100, 100), (200, 200) )
->
new:
dev.pinch()  # pinch or separate with two fingers
dev.swipe_along([(100, 300), (300, 300), (100, 500), (300, 600)])  # continuously slide through a series of coordinates
dev.two_finger_swipe( (100, 100), (200, 200) )  # Two fingers slide together

For more call code examples, you can refer to tests/test_android.py

  • If you used DownEvent/UpEvent/SleepEvent, please modify the import statement to the following:
old:
from airtest.core.android.minitouch import *
->
new:
from airtest.core.android.touch_methods.base_touch import *
  • Fixed an issue where some models of Xiaomi phones (mainly the MIUI11 version) used javacap to take incorrect screenshots in landscape mode.
    • Please uninstall the existing Yosemite.apk on your phone and reconnect the phone to reinstall the new version of Yosemite.apk to fix this problem.
      Note: If the mobile phone is updated to the MIUI12 version, you can directly get the mobile phone screen without using javacap mode. It is recommended that you update the system directly
  • Fixed the bug that the interfaces of is_screenon (whether the phone is bright) and is_locked (whether the phone is locked) under MIUI11+android10 cannot be used

iOS modification:

  • Fixed the horizontal screen abnormality of some iOS models and increase the speed of starting the application
  • iOS-Tagent support for xcode is updated to version 11.5, iOS version is supported to 13.5 (the latest version of xcode currently has some problems that need to be compatible)

v1.1.3 版本发布,更新Android10支持

21 Jan 09:00
081c023
Compare
Choose a tag to compare
  1. 增强了对Android10的支持
  2. 更新了yosemite.apk
  3. 重构了底层的touch操作,更合理一些

v1.1.2

17 Jan 10:21
41a1789
Compare
Choose a tag to compare

接口:

  • 新增了接口airtest.__version__用来查看airtest当前版本号,也可以运行命令行airtest version查看
  • log()接口目前可以更好地将报错或信息显示到报告中了
    • 在报告中显示信息,log(string_msg)
    • 在报告中显示报错,log(Exception), log(title, string_error)

报告:

  • 修复了一些新版本报告的BUG
  • 显示log.txt、步骤绝对时间,截图点击后可放大显示
  • 可自定义截图压缩精度,有以下使用方式:
    • 使用命令行启动,airtest run ... --compress quality
    • 在脚本中自定义,优先级高于命令行,取值范围是1-99的正整数,airtest默认取10,如果希望获得更高精度的图片可以改为75
    import airtest.core.api import *
    ST.SNAPSHOT_QUALITY = xxx  # [1, 99]
    
    • 设置某张图片的压缩精度,snapshot(quality=my_quality)
  • 简化了生成报告的代码,去掉了一些无需额外传入的参数,现在只需要这样写就可以了:
rpt = LogToHtml("test_bj.air", "log", export_dir="export", plugins=["poco.utils.airtest.report"])
rpt.report()

windows:

  • 修正了touch直接设置光标位置导致的部分ui未识别到光标位移的问题
  • 修正了swipe在双屏模式下会多位移一倍距离的问题
  • 修正了在某些版本的Python和pywin32下会报dll缺失的问题

Android:

  • 更新了minicap.so,对部分Android10手机进行了兼容,但是并不完全,Android10的更好兼容请参考下一个版本1.1.3
  • 更新了Yosemite.apk,修复了横屏截屏的bug,更新了录屏接口和录屏的方式,对部分手机有更好的兼容
  • 修复了部分模拟器初始化时的失败问题,现在无需勾选use ADB orientation也能连接模拟器了
  • adb的cmd操作增加了timeout参数,可以指定指令运行的超时时间了
  • 去掉了在windows下运行cmd时如果出现异常,将导致弹出"adb.exe停止响应"的弹窗,避免脚本被卡住

Interface:

  • Added interface airtest .__ version__ to view the current version of airtest. You can also run the command line airtest version to view it.
  • The log() interface can now better display errors or information in reports
    • Display information in the report, log (string_msg)
    • Show errors in the report, log (Exception), log (title, string_error)

Report:

  • Fixed some bugs reported by the new version
  • Display log.txt, step absolute time, click the screenshot to zoom in
  • You can customize the compression precision of screenshots, which can be used in the following ways:
    • Start from the command line, airtest run ... --compress quality
    • Customize in the script, the priority is higher than the command line, the value range is a positive integer from 1 to 99, the default value of airtest is 10, if you want to obtain a more accurate picture, you can change it to 75
    import airtest.core.api import *
    ST.SNAPSHOT_QUALITY = xxx  # [1, 99]
    
    • Set the compression precision of a picture, snapshot (quality = my_quality)
  • Simplified the code for generating reports, removing some parameters that do not need to be passed in, now it is only necessary to write like this:
rpt = LogToHtml("test_bj.air", "log", export_dir="export", plugins=["poco.utils.airtest.report"])
rpt.report()

Windows:

  • Fixed the problem that some UIs did not recognize the cursor displacement caused by touch directly setting the cursor position
  • Fixed an issue where swipe would double the distance in dual screen mode
  • Fixed the problem of missing dlls under certain versions of Python and pywin32

Android:

  • Updated minicap.so, compatible with some Android10 phones, but not completely. For better compatibility of Android10, please refer to the next version 1.1.3
  • Updated Yosemite.apk, fixed the bug of horizontal screen capture, updated the screen recording interface and the screen recording method, better compatibility with some mobile phones
  • Fixed the failure of some simulators during initialization, now you can connect to the simulator without checking the use ADB orientation
  • Added a timeout parameter to the cmd operation of adb, which can specify the timeout period for the instruction to run
  • Removed the "adb.exe stopped responding" pop-up window if an exception occurs when running cmd under windows, avoiding the script being stuck