slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
15.9k stars 519 forks source link

System Testing: Add support for clicking on elements #5501

Closed tronical closed 3 days ago

tronical commented 3 days ago

I can do that, sure. That way one can also simulate a double-click with the right button - not that we detect it at the moment :)

I'll do that and merge. There's a longer game in that besides these convenience functions we can provide a full sequence that looks like this:


// Simulate a drag to scroll
element.click_sequence(ClickSequence::press(PointerEventButton::Left).then_drag_to(...).then_hold(Duration::from_millis(...)).then_release());

But I'd like to cross that bridge when we get there :)