Skip to content

Slider testing is not supported in espresso #1713

@iliaskomp

Description

@iliaskomp

Description

There is a Slider view included in the Material Design website: https://m3.material.io/components/sliders/overview

image

I would like to test some functionality regarding Slider via instrumentation tests.
However, there are no ViewAssertions or ViewInteractions that specifically support slider values.

For assertions that's manageable since some custom assertions can be made.

For interactions though, to my understanding there is no way to change the slider values. I can obtain the slider instance and change value parameter to a new value. But this does not simulate the user's "click" on that value and therefore no actions (e.g. screen transitions) based on that click are triggered.

Steps to Reproduce

Expected Results

Actual Results

AndroidX Test and Android OS Versions

androidx.test.core 1.5.0
androidx.test.espresso 3.5.1
not os-specific

Link to a public git repo demonstrating the problem:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions