Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About RoborazziTaskType parameter to RoborazziOptions #215

Open
takahirom opened this issue Nov 30, 2023 · 0 comments
Open

About RoborazziTaskType parameter to RoborazziOptions #215

takahirom opened this issue Nov 30, 2023 · 0 comments

Comments

@takahirom
Copy link
Owner

Motivation

I created Roborazzi because I wanted to view layouts during UI tests. This was necessary as Robolectric did not provide layout visibility. Currently, Roborazzi doesn't support merely viewing layouts during the verification task (roborazziVerifyDebug). I also believe that these debugging screenshots shouldn't cause a failure in UI tests, such as checking button visibility, as the screenshots offer supplementary information.

Proposal

To modify the behavior of captureRoboImage(), I'm considering the addition of a taskType parameter to RoborazziOptions.

      onView(ViewMatchers.isRoot())
        .captureRoboImage(
          roborazziOptions = RoborazziOptions(
            taskType = RoborazziTaskType.Verify
          )
        )

This change enables image comparison during the verification task.

      onView(ViewMatchers.isRoot())
        .captureRoboImage(
          roborazziOptions = RoborazziOptions(
            taskType = roborazziSystemPropertyTaskType().convertVerifyingToComparing()
          )
        )

Tradeoffs

There is a risk that users might misuse Roborazzi. If used without the Roborazzi plugin, screenshots will be created, but without the plugin, no test report can be generated.

The Roborazzi plugin needs to accommodate various types of screenshot tests, even when a specific task is being used.

Pull request

#211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant