Skip to content

[MaterialTimePicker] UI test support for MaterialTimePicker #2515

@rekhagopi18

Description

@rekhagopi18

Description: I want to replace the default Android TimePicker with the new MaterialTimePicker, but testing it is difficult compared to the normal TimePicker. Espresso picker action is not working for the new time picker. what is the way to set the time for a new time picker for the UI test.

Old way:

  // Sets a time in a time picker widget
    onView(isAssignableFrom(TimePicker::class.java)).perform(
        setTime(
            calendar.get(Calendar.HOUR_OF_DAY),
            calendar.get(Calendar.MINUTE)
        )
    )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions