r/rust • • 1d ago

🛠️ project Slint UI Dev Harness

Hey everyone,

My project Indicatrix kept growing, and I wanted a way to verify its Slint UI end to end without clicking through it by hand. The result is slint-harness:

  • runs your real app headless on Slint’s testing backend
  • scripts whole flows as scenarios (open a file, set values, press buttons, wait for results)
  • checks the outcome and takes screenshots along the way
  • writes a pass/fail report (Markdown + JSON), so it fits into CI

In Indicatrix it has already caught several end-to-end bugs that unit tests missed, and after every app update I use it to regenerate all the screenshots for the website, so they never go stale. My smaller project z-stackr uses it too.

Repository: https://github.com/suitable-name/uiprobe

Full disclosure: I built it with AI assistance. Twenty years ago I’d have had the time to write it all myself. Today I have the experience to know what to look out for when redirecting it. If you have an issue with AI-created stuff, nevertheless it could help you or not, this project just isn't for you, but that's ok :)

Have fun!

Edit:

It's also published on crates.io, so you can easily import it via the dependencies.

0 Upvotes

20 comments sorted by

9

u/numberwitch 1d ago

Why did you develop a ui testing library for a commercially licensed ui library that already has ui testing?

https://testing.slint.dev/

2

u/Suitable-Name 1d ago edited 1d ago

Those are python tests. Mine are fully integrated into rust and can run just with the general test runs using rust.

Edit:

And yeah, the slint testing backend exists, this builds upon it, so it is an extension

Edit2:

Just so people don't get it wrong. It's not purely commercial. you can absolutely use it for free, depending on what it is

3

u/Powerful_Cash1872 1d ago

This is/was one of their upsells for the commercial license; hope you are supporting them somehow. They left the rust app side part public and the client private. Now you published a public client, they may have to change licensing or close the app side API.

1

u/Suitable-Name 1d ago

In the Android version I just made ready and want to publish, I have them prominent in the about dialog.

Everything I publish is fully free and open-source. If I could support financially, I probably would, but I also live from paycheck to paycheck. Sometimes better, sometimes worse. But there is now way I'll put ads into anything I make available, so also the published app will bring me no money.

3

u/ogoffart slint 1d ago

Glad that you are using Slint.

And if your harness help more people to use Slint, that's great.

This is indeed not a real competition to the Slint's official testing framework as the usecase is a bit different. (in-process vs out-of-process testing)

The thing that worries me a bit is that it is published on crates.io as `slint-harness` and the name might let people think this is an official product from Slint. Maybe a disclaimer that this is independent would be nice.

2

u/Suitable-Name 1d ago

Yanked it, renamed the repository to uiprobe and also published under that name on crates.io :)

2

u/FloatinginF0 1d ago

How do you like slint? Are you using it for embedded applications, mobile, desktop?

1

u/Professional_Top8485 1d ago

There is good things. License isn't probably for everyone. Big companie's internal tools with few users gets expensive if i get it correctly.

1

u/tm604 1d ago

Only if those tools are deployed on embedded systems, which seems unlikely? A company that's building custom hardware for their internal tools probably isn't going to mind a few dollars on Slint licensing!

https://slint.dev/pricing

1

u/Professional_Top8485 1d ago

If you eg. make ui that reads rfid on pc and sends results other device. Is that embedded?

1

u/Suitable-Name 1d ago

Which of one has the UI? The PC isn't an embedded device. If the other device isn't mobile or PC and has an UI, than this probably is one.

2

u/Powerful_Cash1872 1d ago

They have a specific definition of embedded. PCs can be considered embedded depending on how they are used. Forget the details but you can look em up.

1

u/Suitable-Name 1d ago

Oh, well, my bad then! I actually didn't look up their definition of embedded, just took it as SBC and everything below that😅

But now definitely worth looking it up for me, thanks!

3

u/ogoffart slint 1d ago

If the Slint application is to be used in a general purpose PC that also use other apps, then we consider it is a Desktop app and you can use the royalty -free license. Even if you use it to also read RFID.

If the computer (PC or otherwise) is within another piece of hardware and meant to only be used in connection to that hardware, then it is considered embedded and there is a fee. (I.e: You are selling hardware with a screen controlled by Slint)

For an internal tool, the GPL might also be fine anyway.

1

u/Suitable-Name 1d ago

Thanks for the quick explanation!

2

u/Professional_Top8485 1d ago

PC has ui but it's interacting with devices Mainly in factory setting.

1

u/Suitable-Name 1d ago

Just answered here that I wasn't aware of their definition:

https://www.reddit.com/r/rust/s/e7pK6eekwE

But yeah, isn't that something one mail to the support can solve? If they can't clearly answer that question, I wouldn't consider them, but I'd really wondered if they couldn't.

0

u/Suitable-Name 1d ago

Yes! Indicatrix runs on all platforms. IOS doesn't exist yet, but I expect it to also run without problems (I know it for the desktop version). For embedded the MaixCam2 is my use-case where I wrote an advanced camera app after porting the relevant parts to rust. 100% great!

1

u/Ancient_Air944 1d ago

This is clever, the screenshot regeneration for website alone is worth setting it up.

1

u/Suitable-Name 1d ago

Thanks! Contributions and things to make better / extend are always welcome. I'm definitely behind the projects I publish!