horologist icon indicating copy to clipboard operation
horologist copied to clipboard

Improve ScreenshotBaseTest

Open luizgrp opened this issue 2 years ago • 2 comments

WHAT

Improve ScreenshotBaseTest to allow it to set the parameters in a more convenient way, without requiring to call and import screenshotTestRuleParams. For example:

class MyTest : ScreenshotBaseTest({
    screenTimeText = {}
    enableA11y = true
}) {

WHY

Feedback on usage https://github.com/google/horologist/pull/1312#discussion_r1205741849

HOW

Suggestion of implementation with type safe builders.

luizgrp avatar May 30 '23 12:05 luizgrp

We should probably also pick up the record default value from a system property so we can run tests in a record mode, and not edit the files.

yschimke avatar Jun 08 '23 10:06 yschimke

Agreed, potentially with a custom gradle task that sets that property and run the tests in record mode.

I think it should be the case for a separated ticket.

luizgrp avatar Jun 08 '23 14:06 luizgrp