coteafs-appium 项目使用教程

随笔4小时前发布 西瓜瓜呀
3 0 0

coteafs-appium 项目使用教程

coteafs-appium:iphone: Wrapper Appium Framework in Java which supports Automation of Mobile and Tablet apps.项目地址:https://gitcode.com/gh_mirrors/co/coteafs-appium

1. 项目的目录结构及介绍

coteafs-appium 项目的目录结构如下:




coteafs-appium/


├── src/


│   ├── main/


│   │   └── java/


│   │       └── com/


│   │           └── github/


│   │               └── wasiqb/


│   │                   └── coteafs/


│   │                       └── appium/


│   │                           ├── config/


│   │                           ├── device/


│   │                           ├── service/


│   │                           └── utils/


│   └── test/


│       └── java/


│           └── com/


│               └── github/


│               └── wasiqb/


│                   └── coteafs/


│                       └── appium/


│                           └── tests/


└── src/test/resources/


    └── config.yaml

目录结构介绍

src/main/java/com/github/wasiqb/coteafs/appium/: 包含项目的主要代码,包括配置、设备管理、服务启动和工具类。src/test/java/com/github/wasiqb/coteafs/appium/tests/: 包含测试用例。src/test/resources/: 包含项目的配置文件 config.yaml

2. 项目的启动文件介绍

项目的启动文件主要位于 src/main/java/com/github/wasiqb/coteafs/appium/ 目录下,关键的启动类包括:

AppiumServer.java: 负责启动和停止 Appium 服务器。DeviceManager.java: 负责设备的管理和配置。TestRunner.java: 负责运行测试用例。

启动文件介绍

AppiumServer.java: 该类包含启动和停止 Appium 服务器的方法,可以根据配置文件中的设置启动服务器。DeviceManager.java: 该类负责管理设备,包括设备的初始化、配置和连接。TestRunner.java: 该类是测试用例的入口点,负责加载配置、初始化设备并运行测试。

3. 项目的配置文件介绍

项目的配置文件位于 src/test/resources/config.yaml,该文件包含了项目运行所需的所有配置信息。

配置文件介绍




servers:


  android_server:


    host: 127.0.0.1


    port: 4723


    external: true


    logs:


      level: DEBUG


      path: logs/appium-server.log


      timestamp: true


      local_timezone: true


      debug_spacing: true


android:


  suppress_adb_kill: true


  devices:


    android:


      os: ANDROID


      name: Google Pixel 3


      version: 8.1


      type: SIMULATOR


  others:


    clear_files: true


    no_reset: false


    full_reset: true


    clear_logs: true


  automation: UIAUTOMATOR2


  android:


    avd:


      name: Pixel_3_XL_API_27


      launch_timeout: 60000


      ready_timeout: 60000


    args:


      -gpu swiftshader_indirect


    app:


      install_timeout: 60000


      type: HYBRID


      path: apps/android/VodQA.apk


      session_timeout: 120000


    playback:


      screenshot:


        on_error: true


      recording:

配置文件说明

servers: 配置 Appium 服务器的相关信息,包括主机地址、端口、日志级别和路径等。android: 配置 Android 设备的相关信息,包括设备名称、版本、类型、自动化引擎等。app: 配置要安装的应用程序的路径和类型。playback: 配置测试过程中的截图和录制设置。

通过以上配置文件,可以灵活地调整项目的运行环境和测试设置。

coteafs-appium:iphone: Wrapper Appium Framework in Java which supports Automation of Mobile and Tablet apps.项目地址:https://gitcode.com/gh_mirrors/co/coteafs-appium

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...