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

Slider instrumentation testing is not supported (espresso) #3275

Open
iliaskomp opened this issue Mar 1, 2023 · 0 comments
Open

Slider instrumentation testing is not supported (espresso) #3275

iliaskomp opened this issue Mar 1, 2023 · 0 comments

Comments

@iliaskomp
Copy link

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.

Expected behavior:
I would expect to be able to perform a click on a slider value via a provided api, something like this:

onView(withId(R.id.slider)).perform(clickSliderValue(10.0f))

Source code:

  • Not applicable

Minimal sample app repro:

  • Not applicable

Android API version:

  • Not applicable

Material Library version:
com.google.android.material:material:1.8.0

Device: Device on which the bug was encountered here

  • Not applicable

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

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

No branches or pull requests

2 participants