use of io.appium.java_client.android.AndroidStartScreenRecordingOptions in project page-factory-2 by sbtqa.
the class AppiumVideoRecorder method startRecord.
public void startRecord() {
if (Environment.isDriverEmpty()) {
LOG.error("Can't start video recording because driver is null");
return;
}
if (PROPERTIES.getAppiumPlatformName() == PlatformName.IOS) {
IOSStartScreenRecordingOptions startOptions = new IOSStartScreenRecordingOptions().withVideoType(PROPERTIES.getAppiumVideoType()).withVideoScale(PROPERTIES.getAppiumVideoScale()).withTimeLimit(Duration.ofSeconds(PROPERTIES.getAppiumTimeLimit())).withVideoQuality(VideoQuality.valueOf(PROPERTIES.getAppiumVideoQuality())).withFps(PROPERTIES.getAppiumVideoFps()).enableForcedRestart();
((IOSDriver) Environment.getDriverService().getDriver()).startRecordingScreen(startOptions);
} else {
AndroidStartScreenRecordingOptions startOptions = new AndroidStartScreenRecordingOptions().withBitRate(PROPERTIES.getAppiumVideoBitRate()).withVideoSize(PROPERTIES.getAppiumVideoSize()).withTimeLimit(Duration.ofSeconds(PROPERTIES.getAppiumTimeLimit())).enableForcedRestart();
if (PROPERTIES.getAppiumVideoBugReport()) {
startOptions.enableBugReport();
}
((AndroidDriver) Environment.getDriverService().getDriver()).startRecordingScreen(startOptions);
}
isRecording = true;
}
Aggregations