Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thank you for those suggestions! Do you know if any of those tools following either approach has any automated tests? My immediate problem is how to manage the complexity of implementing a layout engine or editor. Somewhere I need something checking that a given asset identifier results in specific pixels. And I'd like the tests for _that_ to be nice to read. It's a bit of a chicken-and-egg problem..


Glad that you found this to be useful!

Android includes the Espresso UI testing framework [1]. Essentially, you can specify matchers that compare your expected values or predicates against an actual object identified by an R.id identifier. It's very powerful (since you can write your own custom matchers) but can be cumbersome to use [2].

[1] https://developer.android.com/training/testing/espresso/basi...

[2] Example Espresso Test: https://github.com/android/testing-samples/blob/main/ui/espr...

https://github.com/android/testing-samples

Alternatively, Squish [3] is a very polished and more elegant commercial testing tool that lets you record test-cases using a GUI tool and convert them into (ideally modularized) methods that verify object properties or compare (masked) screenshots of the GUI:

[3] https://www.froglogic.com/squish/features/

Demo video (starting at 14:24): https://youtu.be/ElH-3MVHPRw?t=864

They abstract away a lot of the functionality using the Gherkin [4] domain-specific language so that tests are easier to read at a high level (but you can still dig down into the underlying programmatic implementation).

[4] https://cucumber.io/docs/guides/overview/

This is probably too much complexity for your use-case, but may provide some ideas or inspiration for what is possible. Perhaps a simplified matcher-style system might be a good starting point though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: