Decathlon / vitamin-compose

Decathlon Design System UI components for Compose applications
https://www.decathlon.design
Apache License 2.0
267 stars 29 forks source link

feat: add testTag for automated testing #30

Closed damien-toulouse closed 1 year ago

damien-toulouse commented 2 years ago

Is your feature request related to a problem? Please describe. When writing automated test on compose screen using component like OutlinedDropdown the lack of testTag modifier on subComponent make those screen hard to test

Describe the solution you'd like Add testTag on component with userInteraction, for example to trigger the click on the trailing Icon of the anchored Outlined of a OutlinedDropdown

GerardPaligot commented 2 years ago

Can you be more precise about "subComponent" inside the OutlinedDropdown? Options declared in the outlined dropdown is declared by you and so, you can attach your own test tag who can fit your needs for the test strategy of your product.

damien-toulouse commented 2 years ago

Hello @GerardPaligot Currently if we set a testTag as a Modifier in the OutlinedDropdown parameters it add it to the Dropdown component. Problem is if you need to access the anchored Outlined or even the Icon of that Outlined for exemple to open or close the DropDown

GerardPaligot commented 2 years ago

Ok got it. You don't speak about options of a dropdown but atomic elements inside the text field. Interesting.

We need to think of an approach who can let you give us these test tags because we can't apply the same test tag for these atomic elements for all text inputs in a screen.

ManonPolle commented 1 year ago

Closed by https://github.com/Decathlon/vitamin-compose/pull/169