# cyy-autotest **Repository Path**: com_developer/cyy-autotest ## Basic Information - **Project Name**: cyy-autotest - **Description**: 自动化测试框架,框架技术 java+cucumber + allure + springboot + hamrest + restassured + appium + selenium 该项目可以完成对Htt协议的接口自动化,移动端和selenium的ui自动化 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2022-04-21 - **Last Updated**: 2022-04-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用mvn test运行脚本的参数 - Ip 执行机的ip,在这里是指手机 - Port 执行机对应操作app关联的端口号,这里是在使用 adb -s *** tcpip port - Serverip: appium服务的ip - Serverport: appium服务的port - PlatformName: 系统名称,不区分大小写,eg:android ios - Apk: 如果是android手机,需要传入此参数,指定安装包的路径 - Ipa: 如果是ios手机,则需要传入此参数,指定ios安装包的路径 - Reload: 如果设置true,则重新安装app,运行结束则卸责该app。如果为false或不设置,则不重新安装 - baseURL: 环境地址 使用下面的命令运行: ```java mvn test -DIp=192.168.6.171 -DPort=5559 -DServerip=127.0.0.1 -DServerport=4723 -DPlatformName=android -DApk= ``` 运行结束,使用 allure serve ./target/surefire-reports 生成测试报告 ![](.\imgs\Snipaste_2020-10-19_11-02-36.png) # cucumber allure report 1. 安装scoop ps: 需要在powershell下运行 ```dos set-executionpolicy remotesigned -s cu iwr -useb get.scoop.sh | iex ``` 安装完成后,输入scoop help 查看安装成功? 2. allure windows下安装 ```cmake scoop install allure ``` 安装后,使用allure --version查看安装结果 1. 测试报告每个测试步骤有截图, 2. 并行运行,无线连接 3. 测试报告指定执行机的详细信息 4. 每个测试步骤的超时时间默认为0,让脚本编写的时候设置 // 报告配置 String buildNumber = "1"; String projectName = "cyy"; Configuration configuration = new Configuration(reportOutputDirectory, projectName); // optional configuration - check javadoc for details configuration.addPresentationModes(PresentationMode.RUN_WITH_JENKINS); // do not make scenario failed when step has status SKIPPED configuration.setNotFailingStatuses(Collections.singleton(Status.SKIPPED)); configuration.setBuildNumber(buildNumber); // addidtional metadata presented on main page configuration.addClassifications("Platform", "Windows"); configuration.addClassifications("Browser", "chrome"); configuration.addClassifications("Branch", "release/1.0"); // optionally add metadata presented on main page via properties file // List classificationFiles = new ArrayList<>(); // classificationFiles.add("properties-1.properties"); // classificationFiles.add("properties-2.properties"); // configuration.addClassificationFiles(classificationFiles);