我目前正在努力捕获iOS上的截图,以便使用java和junit进行appium测试.在测试完成之前,它会运行此代码以在杀死连接之前获取屏幕上最后一个可见的内容
@After
public void tearDown() throws Exception {
if (platform.equals(iOS)) {
captureScreenshot(testName.getMethodName());
}
driver.quit();
}
@SuppressWarnings("Augmenter")
public void captureScreenshot(String testName) {
String imagesLocation = "target/surefire-reports/screenshot/" + platform + "/";
new File(imagesLocation).mkdirs(); // Insure directory is there
String filename = imagesLocation + testName + ".jpg";
try {
Thread.sleep(500);
WebDriver augmentedDriver = new Augmenter().augment(driver);
File scrFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(filename), true);
} catch (Exception e) {
System.out.println("Error capturing screen shot of " + testName + " test failure.");
// remove old …Run Code Online (Sandbox Code Playgroud) 当我使用xcodebuild通过命令行构建iOS应用程序时,有没有办法可以选择目标文件夹(目录)?
现在我正在使用像这样的命令
xcodebuild -sdk iphonesimulator -workspace /<path_to_project>/ios-app/CompanyName-iOS.xcworkspace -scheme AppName -configuration Debug RUN_APPLICATION_TESTS_WITH_IOS_SIM=YES ONLY_ACTIVE_ARCH=NO clean build 2>&1
Run Code Online (Sandbox Code Playgroud)
在输出中我看到类似的东西
GenerateDSYMFile /Users/<username>/Library/Developer/Xcode/DerivedData/CompanyName-iOS-fcvhojqctgtmvgdaavahmjutbfyy/Build/Products/Debug-iphonesimulator/AppNAme.app.dSYM
Run Code Online (Sandbox Code Playgroud)
有没有办法我可以获得应用程序输出到的位置,甚至指定我希望将应用程序发送到哪里?我需要访问应用程序才能运行Appium selenium测试,只需进行构建执行和运行测试就没有用.还尝试将jenkins合并到混合中,并且需要具有完全自动化过程的命令