Search in sources :

Example 1 with IOSStartScreenRecordingOptions

use of io.appium.java_client.ios.IOSStartScreenRecordingOptions 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;
}
Also used : IOSDriver(io.appium.java_client.ios.IOSDriver) IOSStartScreenRecordingOptions(io.appium.java_client.ios.IOSStartScreenRecordingOptions) AndroidDriver(io.appium.java_client.android.AndroidDriver) AndroidStartScreenRecordingOptions(io.appium.java_client.android.AndroidStartScreenRecordingOptions)

Aggregations

AndroidDriver (io.appium.java_client.android.AndroidDriver)1 AndroidStartScreenRecordingOptions (io.appium.java_client.android.AndroidStartScreenRecordingOptions)1 IOSDriver (io.appium.java_client.ios.IOSDriver)1 IOSStartScreenRecordingOptions (io.appium.java_client.ios.IOSStartScreenRecordingOptions)1