suggestion: implementation of click and hold behavior
- Dominant language
- Python
- Stars
- 68
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
To interact correctly with `MDSwitch` widget, I needed to have a click and hold behavior in order to change its state:
`click_on` and `wait_click` methods from client are not working in this case, so I found a tricky workaround for this that I would like to share:
I managed to do this using `wait_drag` client method, putting as selector the Thumb and as target the same, specifying a proper duration and timeout, in this way I was able to reproduce desired behavior.
Here it is the code I wrote:
```
switch_locator = f'//MDSwitch[@name~="{provider_name}"]/Thumb[0]'
cli.wait_drag(switch_locator, switch_locator, duration=3, timeout=30)
```
Maybe it could be useful to implement a `click_hold_on` or a `wait_click_hold` method inside client that can use this "trick".
What do you think?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the client methods `click_on`, `wait_click`, and `wait_drag`, using the reported `MDSwitch` Thumb selector and the supplied workaround as the behavioral reference. Determine where a click-and-hold client method belongs and verify that it supports the stated duration and timeout behavior; the issue does not mention a specific file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100