ViddikEngine

Functions

Link copied to clipboard
fun designParity(component: ViddikComponent, designDir: File = defaultDesignDir, reportsDir: File = defaultDesignReportsDir, tolerancePercent: Double = designTolerancePercent, channelTolerance: Int = designChannelTolerance): DesignParityResult

Renders the fixture and measures it against the design it was built from — a PNG named exactly like its golden would be, in designDir (<snapshots>/design/ unless viddik.designDir says otherwise). Never records: the reference is the designer's, and a run that could overwrite it with the render would turn "does the code match the design" into "does the code match itself".

Link copied to clipboard
fun dynamicTests(components: List<ViddikComponent>, shard: Int = 0, shards: Int = 1): List<DynamicTest>

Every @ViddikScreenshot fixture in the module, as one dynamic test each — or the subset named by the viddik.filter system property.

Link copied to clipboard
fun verify(component: ViddikComponent, snapshotsDir: File = defaultSnapshotsDir, reportsDir: File = defaultReportsDir, tolerancePercent: Double = component.tolerancePercent ?: System.getProperty(TOLERANCE_PERCENT_PROPERTY)?.toDoubleOrNull() ?: DEFAULT_TOLERANCE_PERCENT, channelTolerance: Int = System.getProperty(CHANNEL_TOLERANCE_PROPERTY)?.toIntOrNull() ?: DEFAULT_CHANNEL_TOLERANCE, minMismatchedPixels: Int = System.getProperty(MIN_MISMATCHED_PIXELS_PROPERTY)?.toIntOrNull() ?: DEFAULT_MIN_MISMATCHED_PIXELS, floorChannelDelta: Int = System.getProperty(FLOOR_CHANNEL_DELTA_PROPERTY)?.toIntOrNull() ?: DEFAULT_FLOOR_CHANNEL_DELTA, record: Boolean = recordMode, force: Boolean = forceRecordMode)

Renders the fixture and compares it against its golden — or, under VIDDIK_RECORD_MODE, writes that golden (record, recordGolden).