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
RED doesn't correctly validate that keywords used in Test Setup and Test Teardown in a suite initialization file (__init__.robot) need to be defined in the test case file, not the initialization file.
Test Setup, Test Teardown, Test Timeout
Set the default value for test setup/teardown or test timeout to all test cases this directory contains. Can be overridden on lower level. Notice that keywords used as setups and teardowns must be available in test case files where tests using them are. Defining keywords in the initialization file itself is not enough.
(http://robotframework.org/robotframework/3.2.2/RobotFrameworkUserGuide.html#initialization-files)
Case 1:
Library imported in initialization file. This makes RED happy, but doesn't make the library accessible to the test setup.
Case 2:
Library is imported in the test case file, but not in the initialization file. This runs fine but RED doesn't like it.
Case 3:
Library imported using Import Library keyword as part of Test Setup, to avoid having to import the library in every test case file. This is valid, but RED doesn't seem to understand the Import Library keyword.
Workaround:
To make both RED and RobotFramework happy, combine Case 1 with either Case 2 or Case 3
eg.
The text was updated successfully, but these errors were encountered:
this is problematic because it may be OK for some of the tests down below init file in the suites hierarchy while for others it may be wrong. Now depending if you would run the suite which imports the library or the one which does not the result in Robot would be different too.
I think each test / task within each robot file would need to be validated to determine which setup / teardown would be used for that test, and whether the keywords used in them have been imported / defined.
RED doesn't correctly validate that keywords used in
Test Setup
andTest Teardown
in a suite initialization file (__init__.robot) need to be defined in the test case file, not the initialization file.Case 1:
Library imported in initialization file. This makes RED happy, but doesn't make the library accessible to the test setup.
Case 2:
Library is imported in the test case file, but not in the initialization file. This runs fine but RED doesn't like it.
Case 3:
Library imported using
Import Library
keyword as part ofTest Setup
, to avoid having to import the library in every test case file. This is valid, but RED doesn't seem to understand theImport Library
keyword.Workaround:
To make both RED and RobotFramework happy, combine Case 1 with either Case 2 or Case 3
eg.
The text was updated successfully, but these errors were encountered: