Structure
Snapshot
public struct Snapshot: TestTool
The testing tool which generates snapshot images from scenarios managed by Playbook
.
Relationships
Conforms To
TestTool
Represents a tool for testing scenarios managed by playbooks.
Initializers
init(directory:clean:format:timeout:scale:keyWindow:devices:)
public init(directory: URL, clean: Bool = false, format: SnapshotSupport.ImageFormat, timeout: TimeInterval = 600, scale: CGFloat = UIScreen.main.scale, keyWindow: UIWindow? = nil, devices: [SnapshotDevice])
Creates a new snapshot tool for export all image files into specified directory.
Parameters
Name | Type | Description |
---|---|---|
directory | URL |
A base directory for exporting snapshot image files. |
clean | Bool |
Specifies whether to clean directory before generating snapshots. |
format | SnapshotSupport.ImageFormat |
An image file format of exported data. |
timeout | TimeInterval |
A timeout interval until the finish snapshot of all scenarios. |
scale | CGFloat |
A rendering scale of the snapshot image. |
keyWindow | UIWindow? |
The key window of the application. |
devices | [SnapshotDevice] |
A set of snapshot environment simulating devices. |
Properties
directory
var directory: URL
A base directory for exporting snapshot image files.
clean
var clean: Bool
Specifies whether that to clean directory before generating snapshots.
timeout
var timeout: TimeInterval
A timeout interval until the finish snapshot of all scenarios.
scale
var scale: CGFloat
A rendering scale of the snapshot image.
keyWindow
var keyWindow: UIWindow?
The key window of the application.
Methods
run(with:)
public func run(with playbook: Playbook) throws
Generates snapshot images for passed Playbook
instance.
Parameters
Name | Type | Description |
---|---|---|
playbook | Playbook |
A |