Get help with testing, discuss unit testing strategies etc.


Post by jflowers45 »

API docs show that WaitForComponentQuery accepts a string for the value of 'query'

https://www.bryntum.com/docs/siesta/#!/ ... ositeQuery

I need that string to be calculated from something earlier in the test chain. I've observed that it works if I pass a function that returns a string, rather than a string, as follows:
{ 
waitForCQ: 
function() { return "mycomponent[title^=Edit id - " + some_id_calculated_earlier + "]"}, 
desc: "Verify Editor Opened to appropriate record" 
}
Just checking to make sure this is supported and not something that is unintentionally possible?

Thanks
-Joe

Post by nickolay »

Yes, this is valid case. When you specify "waitForCQ" in the chain step, you actually use "MethodCall" action: https://www.bryntum.com/docs/siesta/#!/ ... MethodCall

It is same as to write:
{ 
action : 'methodCall',
methodName : 'waitForCQ',
// to be returned from function, callback will be added last
args : function() { return "mycomponent[title^=Edit id - " + some_id_calculated_earlier + "]"}, 
desc: "Verify Editor Opened to appropriate record" 
}
but more compact. Arguments can be provided as array or returned from function.

Post by jflowers45 »

excellent, that's great news. Thank you for the prompt response.

Post Reply