| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Test.Sandwich.WebDriver.Video
Description
Functions for recording videos of browser windows.
Synopsis
- startBrowserVideoRecording :: (BaseVideoConstraints context m, WebDriver m) => FilePath -> VideoSettings -> m VideoProcess
- startFullScreenVideoRecording :: BaseVideoConstraints context m => FilePath -> VideoSettings -> m VideoProcess
- startVideoRecording :: BaseVideoConstraints context m => FilePath -> (Word, Word, Int, Int) -> VideoSettings -> m VideoProcess
- endVideoRecording :: (MonadLoggerIO m, MonadUnliftIO m) => VideoProcess -> m ()
- recordVideoIfConfigured :: (BaseVideoConstraints context m, WebDriver m, HasSomeCommandLineOptions context) => String -> m a -> m a
- data VideoSettings = VideoSettings {
- xcbgrabOptions :: [String]
- avfoundationOptions :: [String]
- gdigrabOptions :: [String]
- hideMouseWhenRecording :: Bool
- logToDisk :: Bool
- defaultVideoSettings :: VideoSettings
- fastX11VideoOptions :: [String]
- qualityX11VideoOptions :: [String]
- defaultAvfoundationOptions :: [String]
- defaultGdigrabOptions :: [String]
- data VideoProcess
- videoProcessProcess :: VideoProcess -> ProcessHandle
- type BaseVideoConstraints context m = (MonadLoggerIO m, MonadUnliftIO m, MonadMask m, MonadReader context m, HasBaseContext context, HasWebDriverContext context)
Documentation
startBrowserVideoRecording Source #
Arguments
| :: (BaseVideoConstraints context m, WebDriver m) | |
| => FilePath | Output path |
| -> VideoSettings | |
| -> m VideoProcess |
Wrapper around startVideoRecording which uses WebDriver to find the rectangle corresponding to the browser.
startFullScreenVideoRecording Source #
Arguments
| :: BaseVideoConstraints context m | |
| => FilePath | Output path |
| -> VideoSettings | |
| -> m VideoProcess |
Wrapper around startVideoRecording which uses the full screen dimensions.
Lower-level
Arguments
| :: BaseVideoConstraints context m | |
| => FilePath | Output path |
| -> (Word, Word, Int, Int) | Rectangle to record, specified as |
| -> VideoSettings | |
| -> m VideoProcess | Returns handle to video process and list of files created |
Record video to a given path, for a given screen rectangle.
endVideoRecording :: (MonadLoggerIO m, MonadUnliftIO m) => VideoProcess -> m () Source #
Gracefully stop the ProcessHandle returned by startVideoRecording.
Wrap a test to conditionally record video
recordVideoIfConfigured Source #
Arguments
| :: (BaseVideoConstraints context m, WebDriver m, HasSomeCommandLineOptions context) | |
| => String | Session name |
| -> m a | |
| -> m a |
Record video around a given action, if configured to do so in the CommandLineWebdriverOptions.
This can be used to record video around individual tests. It can also keep videos only in case of exceptions, deleting them on successful runs.
Configuration
data VideoSettings Source #
Constructors
| VideoSettings | |
Fields
| |
defaultVideoSettings :: VideoSettings Source #
Default video settings.
fastX11VideoOptions :: [String] Source #
Default options for fast X11 video recording.
qualityX11VideoOptions :: [String] Source #
Default options for quality X11 video recording.
defaultAvfoundationOptions :: [String] Source #
Default options for AVFoundation recording (for Darwin).
defaultGdigrabOptions :: [String] Source #
Default options for gdigrab recording (for Windows).
Types
data VideoProcess Source #
A type representing a live video recording process
videoProcessProcess :: VideoProcess -> ProcessHandle Source #
The process handle
type BaseVideoConstraints context m = (MonadLoggerIO m, MonadUnliftIO m, MonadMask m, MonadReader context m, HasBaseContext context, HasWebDriverContext context) Source #