Skip to main content

快速启动-android稳定性测试

Project description

###快速启动-android稳定性测试


  • 前置条件:需安装adb环境、需安装adb环境、需安装adb环境,重要事情说三遍

  • 简介: 结合字节跳动提供的开源工具Fastbot_android, 进行封装了基础版的稳定性测试, 只需要数据线连接电脑,并确定在cmd中输入adb devices,看到了手机设备号,即可运行命令。

  • 命令参数
必选参数:
  startproject              创建工程目录
  
  run                       运行
  
    package 包名,必须输入,不然会抛出异常
    
    -m 10 是设置分钟,置默认为5分钟
    
    -t 500 是设置点击事件,默认设置为500
    
    -log 是捕获异常日志,布尔值,默认是true
    
    -module 是获取自定义文件中的模块名称

  • 基础教程
  1. 新建一个工程目录testProject,在Terminal中输入命令创建脚手架:
PS E:\testProject> py -m fastrun startproject demo          
2022-02-23 11:27:43.369 | INFO     | fastrun.scaffold:create_folder:29 - 创建文件夹:demo
2022-02-23 11:27:43.371 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\__init__.py
2022-02-23 11:27:43.372 | INFO     | fastrun.scaffold:create_folder:29 - 创建文件夹:demo\modules
2022-02-23 11:27:43.373 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\modules\fastrun.json
2022-02-23 11:27:43.374 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\debugfeng.py 
  1. Terminal中输入运行命令

默认是运行 5 分钟点击 500 下

PS E:\testProject> py -m fastrun run "包名" -module "login"(login是fastrun.json文件中的模块名)

默认是运行 10 分钟点击 1000 下

PS E:\testProject> py -m fastrun run "包名" -m 10 -t 100 -module "login"(login是fastrun.json文件中的模块名)

默认是运行 5 分钟点击 500 下,并不要记录日志

PS E:\testProject> py -m fastrun run "包名" -module login -l flase
  1. 设置自定义文件fastrun.json文件

json文件固定格式:

{
  "login": [
    {
      "prob": 1,
      "activity": "xz.act.app_v4.account.LoginActivityV4",
      "times": 1,
      "actions": [
        {
          "xpath": "//*[@resource-id='xz.act:id/tv_account']",
          "action": "CLICK",
          "throttle": 2000
        }
      ]
    },
    {
      "prob": 1,
      "activity": "xz.act.app_v4.account.AccountLoginActivityV4",
      "times": 1,
      "actions": [
        {
          "xpath": "//*[@resource-id='xz.act:id/et_select']",
          "action": "CLICK",
          "throttle": 2000
        },
        {
          "xpath": "//*[@resource-id='xz.act:id/et_search']",
          "action": "CLICK",
          "text": "*测试酒店",
          "clearText": false,
          "throttle": 2000
        },
        {
          "xpath": "//*[@resource-id='xz.act:id/group_name']",
          "action": "CLICK",
          "throttle": 2000
        }
      ]
    }
  ]
}

|

后续会在增加黑白名单操作,敬请期待。。。



###严正声明

  • 作者只提供工具使用,当用户使用其他用途时,对用户或者他人造成任何形式的损失和伤害,该工具不承担任何责任。

  • 本协议的一切解释权与修改权归本工具所有。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastrun-1.0.3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastrun-1.0.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file fastrun-1.0.3.tar.gz.

File metadata

  • Download URL: fastrun-1.0.3.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for fastrun-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ca1eded0ed7c146dd5a2fa30d11e054fb913e0741d631c33d0777507f16b2d35
MD5 5007ce6970bcdfee573d3b921500a98b
BLAKE2b-256 15acac9eb4253b6a3537a4632d35ff0830e3f1017d78cef96a81e71e7056b05c

See more details on using hashes here.

File details

Details for the file fastrun-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: fastrun-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for fastrun-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0c417dbd50b58df67ce565feb89d26790c04809168385a5c80da30fd2bc7020d
MD5 a39399b2598ad2bcd3a586e8793b7cd0
BLAKE2b-256 91b69558ff6c8865f4d041e447cc9b79e0c9264ff113477f89fe0ea8c7cfa0f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page