syager
Topic Author
Posts: 2
Joined: 30 Aug 2019, 14:49

Automated Testing

30 Aug 2019, 15:09

I was curious if anyone had found a good automation testing framework for Noesis GUI's that is independent of windows?
 
User avatar
jsantos
Site Admin
Posts: 3918
Joined: 20 Jan 2012, 17:18
Contact:

Re: Automated Testing

03 Sep 2019, 02:22

We already have an internal tool here for testing the quality of builds, we render hundreds of XAMLs and compare pixel by pixel with reference images. Adding support for input should be easy. Noesis already provides you a platform independent input system through View functions.

If anyone is interested in improving this command line tool (with a GUI for example, to record input events, capture reference images, etc) just contact us please.
 
davjs
Posts: 3
Joined: 07 Sep 2020, 14:45

Re: Automated Testing

16 Mar 2021, 17:54

We are interested in this as well. Especially an interface like selenium or cypress that lets you:

Find UI elements programmatically by using identifiers and traversing the hierarchy.
Trigger click on those elements.
Assert on UI elements to have specific properties, exist, be visible etc.

If the possibility to do these things exist we could sort of build our own testing framework around it.

Preferably in the same application that runs the engine (would make it easier to debug tests), but that's not a must.
 
peterh
Posts: 39
Joined: 13 Mar 2015, 13:50

Re: Automated Testing

16 Mar 2021, 21:07

We have developed an automated testing system that runs in Unity's Playmode Tests framework. It's in-house specific to our product so I can't share any code, but I can share the general principle we use.
  • Assign a unique ID to UI elements relevant to tests using an Attached Property.
  • Elements add their ID to a dictionary when Loaded.
  • Tests are executed as a series of commands such as Touch(ID), WaitUntilVisible(ID, Timeout), Assert(ID, ID => bool) using a mix of methods on the elements themselves and methods such as View.TouchUp and View.TouchDown.
  • Commands are combined into more and more complex and useful commands in order to make tests easier to write and understand.
  • Tests are able to run asynchronously through the use of Unity Coroutines.
  • Unity lets you speed up the execution of your entire application, so we can run a lot of tests in a short amount of time.
This approach works decently enough and lets us make automated tests that are very close to executing a list of test actions manually.
 
Sybaris
Posts: 39
Joined: 21 Feb 2019, 10:13

Re: Automated Testing

22 Mar 2021, 17:04

Coming from WPF I'd see the main advantage of XAML being able to work with view models/MVVM which seems to work pretty nice with Noesis GUI. That should be the cleanest and most flexible way of unit testing/integration testing.
In the project that I am working at the moment, I use view models for every window/control and do the testing only over the view models - completely without UI/XAML/Noesis GUI. That's especially interesting because I don't even rely on Unity. The unit tests therefore don't run under Unity but in Visual Studio.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 24 guests