Get help with testing, discuss unit testing strategies etc.


Post by filip »

Hei,

my goal is to move to the next test step after observing an event eventName which is induced by clicking a button. I tried
return function(next) {
    this.chain(
        { action ... },
        function(innerNext) {
            controller.on('eventName', innerNext, me, { single: true });
            this.click(target);
        },
        { action ... },
        next
    );
};
but it seems that the performed actions are not processed in order. Furthermore, there is no mouse cursor transition from one element to the other in comparision with the the test step defined by { click: target }. When applying the former, the mouse cursor is directly moved to the target without a transition from one element to the target element. Thus, is there a difference with regard to the mouse transition behavior between { click: target } and this.click(target) ?

Thank you in advance!

Regards,
Frank

Post by mats »

You should then do:
    return function(next) {
        this.chain(
            { action ... },
            { waitForEvent : [controller, 'eventName'], trigger : { click : target } },
            { action ... },
            next
        );
    };



Post by filip »

Hei Mats,

thanks for the reply. The problem arose from wrong timings induced by our code. When I corrected them, my code snipped worked.
However, the question of the mouse cursor transition remains. Does t.click(target) only perform a click without processing a mouse cursor transition from the last target to the next? So I have to implement the transition by myself?

Thanks in advance!

Regards,
Frank

Post by mats »

Yes, in this notation the click is synchronous.
t.click(target) 
Please see docs:

https://bryntum.com/docs/siesta/#!/api/ ... thod-click

To move mouse to target first, pass callback as the 2nd argument.

Post by filip »

Yes, that worked.

Thank you for your help.

Regards,
Frank

Post Reply