You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I want to use a Robot Framework listener to dynamically set the execution time for each test case during test execution. For example, in a CI scenario, I can define a total execution time, and during the Robot Framework run, dynamically adjust the remaining execution time for each test case.
However, it seems that there is currently no way to modify a test case's timeout parameter through a listener:
from robot import result, running
from testlogging import debug_log
logger = debug_log(__file__)
class TimeoutConfig:
ROBOT_LISTENER_API_VERSION = 3
def __init__(self, timeout: str):
self.timeout = timeout
def start_test(self, data: running.TestCase, result: result.TestSuite):
logger.info('ROBOT LISTENER: Test Case {} has timeout {}', data.name, data.timeout)
data.timeout = self.timeout
logger.info('ROBOT LISTENER: Test Case {} has timeout {}', data.name, data.timeout)
Test case:
Suite Teardown Suite Teardown
*** Test Cases ***
Log Hello World
[Timeout] 5
[Teardown] Testcase Teardown
Sleep 20
The console shows data.timout output was modified but the robot report shows the timeout still keep original.
The text was updated successfully, but these errors were encountered:
I believe Robot checks the timeout before calling listeners. In that case it ought to be enough to change the order. We've been enhancing listeners heavily in the RF 7.x series and should fix this limitation as well.
I think the result object has the timeout as a custom object that's not even properly documented. This part may require changes as well.
I looked at this quickly and some quick comments based on that:
Fixing the problem isn't as simple as I thought. The main reason is that timeout handling is internally implemented somewhat stupidly and it might be best to cleanup that as part of this issue.
Related to the, I believe timeouts should be represented as timedelta objects, but changing that should possibly wait for a major release where backwards incompatible changes are less problematic.
Description:
I want to use a Robot Framework listener to dynamically set the execution time for each test case during test execution. For example, in a CI scenario, I can define a total execution time, and during the Robot Framework run, dynamically adjust the remaining execution time for each test case.
However, it seems that there is currently no way to modify a test case's timeout parameter through a listener:
Test case:
The console shows data.timout output was modified but the robot report shows the timeout still keep original.
The text was updated successfully, but these errors were encountered: