Open dergo opened 11 years ago
Maybe it's even a bad idea to hide this timeout mechanism because if a test fail, we don't know if the button has really been clicked or not.
I think a better solution would be to offer an explicit method to check the button state, and this would also allow to specify the timeout value. e.g. checkButtonClickable(int pTimeoutInMs)
That's means that all calls to the method clickOnButton have to be preceded by this check... If a button is set invisible in a GUI, the javagui controller is still able to "click" on it... Without this check, the test will not detect that the action is impossible for a user....
2013/10/8 dergo notifications@github.com
Maybe it's even a bad idea to hide this timeout mechanism because if a test fail, we don't know if the button has really been clicked or not.
I think a better solution would be to offer an explicit method to check the button state, and this would also allow to specify the timeout value. e.g. checkButtonClickable(int pTimeoutInMs)
— Reply to this email directly or view it on GitHubhttps://github.com/qspin/qtaste/issues/64#issuecomment-25889707 .
No, clickOnButton() can also check, without timeout, that the button is clickable before clicking on it.
So if the button should be immediately clickable, you just need to call clickOnButton(), otherwise you explicitely verify it, using a timeout.
JavaGUI clickOnButton() and other methods support a timeout before executing the action, in case the widget is not yet enabled or visible. Unfortunately, the current implementation will only check the widget state every second, which is pretty slow for an automated test system, because sometimes we need to do the action faster than 1 second!
It should check the widget at least every 100 ms or even better listen for the widget state changes and do the action as soon as possible.
Code implementing the timeout is in UpdateComponentCommander.executeCommand().