App Testing


I want to test my smart apps by generating a random event stream and checking the output stream. One way is to use Android monkey to change the state of virtual devices to trigger apps.

However, I am thinking is it possible to write a device handler that allows me to change a sensor state(virtual device) at various instants.

As a concrete example, say I have an app that turns a switch on when motion is active for 3min.

To test it, I would want to change the motion Sensor(virtual device) state, once at time t = 0, then at time t < 3 and then at time t > 3.

So my question is, can I write a device handler that automatically sends events in this pattern?

I will really appreciate the help.

You don’t need to write a device handler for that I think. A simple smartapp sending the event to your existing devices dth would do the trick.

That’s what the parse function of dth generally do: read a value of something and send event like motion, on, off etc. Here you just bypass the event that the parse would… parse and direvtly send the ecent to that dth

1 Like

Thank you so much

1 Like