Instead of using the sleep method to wait for an element to finish, we can create a method to make the elements asynchronous. Since estimating how long the element will stay on the screen leads to overlap issues which could be avoided by having a method like this:
Instead of using the
sleep
method to wait for an element to finish, we can create a method to make the elements asynchronous. Since estimating how long the element will stay on the screen leads to overlap issues which could be avoided by having a method like this:https://github.com/PointMotionInc/activity-experience/blob/33013b4a1ea01449c1d35f0551c4173f8da81fa5/src/app/services/game/sit-to-stand/sit-to-stand.service.ts#L182-L193 The above code will be re-written as:
This will ensure elements don't overlap with each other and also avoid too much timeout between two elements.
The
sleep
method can still be used for adding extra timeout.