1f865a28c5f5ee5035395e2d1d2f5c077735830c
[integration/test.git] / csit / libraries / SetupUtils.robot
1 *** Settings ***
2 Documentation     Simple resource with setup keywords which combine FailFast and Karaf logging.
3 ...
4 ...               See FailFast.robot documentation for intricacies of that library.
5 Resource          ${CURDIR}/FailFast.robot
6 Resource          ${CURDIR}/KarafKeywords.robot
7 Resource          ${CURDIR}/Utils.robot
8
9 *** Keywords ***
10 Setup_Utils_For_Setup_And_Teardown
11     [Documentation]    Prepare both FailFast and karaf logging, to be used in suite setup.
12     FailFast.Do_Not_Fail_Fast_From_Now_On
13     KarafKeywords.Open_Controller_Karaf_Console_On_Background
14     BuiltIn.Run Keyword And Ignore Error    KarafKeywords.Log_Test_Suite_Start_To_Controller_Karaf
15
16 Setup_Test_With_Logging_And_Fast_Failing
17     [Documentation]    Test case setup which skips on previous failure. If not, logs test case name to Karaf log.
18     ...    Recommended to be used as the default test case setup.
19     FailFast.Fail_This_Fast_On_Previous_Error
20     BuiltIn.Run Keyword And Ignore Error    KarafKeywords.Log_Testcase_Start_To_Controller_Karaf
21
22 Setup_Test_With_Logging_And_Without_Fast_Failing
23     [Documentation]    Test case setup which explicitly ignores previous failure and logs test case name to Karaf log.
24     ...    Needed if the recommended default is to be overriden.
25     FailFast.Run_Even_When_Failing_Fast
26     BuiltIn.Run Keyword And Ignore Error    KarafKeywords.Log_Testcase_Start_To_Controller_Karaf
27
28 Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
29     [Documentation]    Test case teardown. Show linked bugs and start fast failing in case of failure.
30     BuiltIn.Run_Keyword_If_Test_Failed    BuiltIn.Set_Suite_Variable    ${SuiteFastFail}    True
31     Utils.Report_Failure_And_Point_To_Linked_Bugs
32
33 Teardown_Test_Show_Bugs_If_Test_Failed
34     [Documentation]    Test case teardown. Show linked bugs in case of failure.
35     Utils.Report_Failure_And_Point_To_Linked_Bugs