Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / dluxapps / yangman / 505__yangmam_modules_loading.robot
1 *** Settings ***
2 Documentation     Verification that Yangman Modules tab contains at least 1 module loaded.
3 ...               Verification that each loaded module can be expanded and collapsed.
4 ...               Verification that each module contains operations, or operational, or config list items when it is extended.
5 ...               Verification that when operations or operational or config of in modules list is clicked, the name of the module in module detail is the same as the name of the module in module list.
6 ...               Verification that when operations or operational or config is clicked, module detail tab contains chosen tab in selected mode.
7 Suite Setup       YangmanKeywords.Open DLUX And Login And Navigate To Yangman URL
8 Suite Teardown    Close Browser
9 Resource          ${CURDIR}/../../../libraries/YangmanKeywords.robot
10
11 *** Variables ***
12
13 *** Test Cases ***
14 Verify that any module has been loaded
15     ${number_of_modules}=    YangmanKeywords.Return Number Of Modules Loaded    ${MODULE_LIST_ITEM}
16     Set Suite Variable    ${number_of_modules}
17     YangmanKeywords.Verify Any Module Is Loaded
18
19 Verify that each loaded module can be expanded and collapsed
20     Verify Each Loaded Module Is Collapsed
21     Expand Each Loaded Module    ${number_of_modules}
22     Verify Each Loaded Module Is Expanded
23     Collapse Each Expanded Module    ${number_of_modules}
24     Verify Each Loaded Module Is Collapsed
25
26 Verify that each loaded module contains either operations, or operational and config, when expanded
27     Expand Each Loaded Module    ${number_of_modules}
28     Verify Each Loaded Module Contains Operational Or Config Or Operations    ${number_of_modules}
29     Compare Module Name In Module List And Module Detail    ${number_of_modules}
30
31 Verify that when operations or operational and config in modules list is clicked, module detail with chosen tab is displayed
32     Click Operations Or Operational And Config Of All Modules And Verify Chosen Tab Is Selected    ${number_of_modules}
33
34 *** Keywords ***
35 Verify Each Loaded Module Is Collapsed
36     ${number_of_modules_loaded}=    YangmanKeywords.Return Number Of Modules Loaded    ${MODULE_LIST_ITEM}
37     ${number_of_modules_loaded_collapsed}=    YangmanKeywords.Return Number Of Modules Loaded    ${MODULE_LIST_ITEM_COLLAPSED}
38     BuiltIn.Should Be Equal    ${number_of_modules_loaded}    ${number_of_modules_loaded_collapsed}
39
40 Verify Each Loaded Module Is Expanded
41     ${number_of_modules_loaded}=    YangmanKeywords.Return Number Of Modules Loaded    ${MODULE_LIST_ITEM}
42     ${number_of_modules_loaded_expanded}=    YangmanKeywords.Return Number Of Modules Loaded    ${MODULE_LIST_ITEM_EXPANDED}
43     BuiltIn.Should Be Equal    ${number_of_modules_loaded}    ${number_of_modules_loaded_expanded}
44
45 Expand Each Loaded Module
46     [Arguments]    ${number_of_modules_loaded}
47     FOR    ${index}    IN RANGE    0    ${number_of_modules_loaded}
48         ${module_list_item_collapsed_indexed}=    YangmanKeywords.Return Module List Item Collapsed Indexed    ${index}
49         ${indexed_module_expander_icon}=    YangmanKeywords.Return Indexed Module Expander Icon    ${index}
50         ${status}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${module_list_item_collapsed_indexed}
51         BuiltIn.Run Keyword If    "${status}"=="True"    GUIKeywords.Focus And Click Element    ${indexed_module_expander_icon}
52         Selenium2Library.Wait Until Page Does Not Contain Element    ${module_list_item_collapsed_indexed}
53     END
54
55 Collapse Each Expanded Module
56     [Arguments]    ${number_of_modules_loaded}
57     FOR    ${index}    IN RANGE    0    ${number_of_modules_loaded}
58         ${module_list_item_expanded_indexed}=    YangmanKeywords.Return Module List Item Expanded Indexed    ${index}
59         ${indexed_module_expander_icon}=    YangmanKeywords.Return Indexed Module Expander Icon    ${index}
60         ${status}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${module_list_item_expanded_indexed}
61         BuiltIn.Run Keyword If    "${status}"=="True"    Run Keyword    GUIKeywords.Focus And Click Element    ${indexed_module_expander_icon}
62         Selenium2Library.Wait Until Page Does Not Contain Element    ${module_list_item_expanded_indexed}
63     END
64
65 Verify Each Loaded Module Contains Operational Or Config Or Operations
66     [Arguments]    ${number_of_modules_loaded}
67     FOR    ${index}    IN RANGE    0    ${number_of_modules_loaded}
68         ${indexed_module_operations}=    YangmanKeywords.Return Indexed Module Operations Label    ${index}
69         ${indexed_module_operational}=    YangmanKeywords.Return Indexed Module Operational Label    ${index}
70         ${indexed_module_config}=    YangmanKeywords.Return Indexed Module Config Label    ${index}
71         ${contains_operational}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Page Should Contain Element    ${indexed_module_operational}
72         ${contains_operations}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Page Should Contain Element    ${indexed_module_operations}
73         ${contains_config}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Page Should Contain Element    ${indexed_module_config}
74         @{states}=    BuiltIn.Create List    "${contains_operational}"    "${contains_operations}"    "${contains_config}"
75         Collections.List Should Contain Value    ${states}    "True"
76     END
77
78 Compare Module Name In Module List And Module Detail
79     [Arguments]    ${number_of_modules_loaded}
80     FOR    ${index}    IN RANGE    0    ${number_of_modules_loaded}
81         ${indexed_module}=    YangmanKeywords.Return Module List Indexed Module    ${index}
82         ${indexed_module_operations}=    YangmanKeywords.Return Indexed Module Operations Label    ${index}
83         ${indexed_module_operational}=    YangmanKeywords.Return Indexed Module Operational Label    ${index}
84         ${indexed_module_config}=    YangmanKeywords.Return Indexed Module Config Label    ${index}
85         ${contains_operational}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_operational}
86         ${contains_operations}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_operations}
87         ${contains_config}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_config}
88         ${module_list_module_name}=    Selenium2Library.Get Text    ${indexed_module}//p
89         BuiltIn.Run Keyword If    "${contains_operations}"=="True"    BuiltIn.Run Keywords    GUIKeywords.Focus And Click Element    ${indexed_module_operations}
90         ...    AND    Selenium2Library.Wait Until Page Contains Element    ${MODULE_DETAIL_MODULE_NAME_LABEL}
91         ${module_detail_module_name}=    BuiltIn.Run Keyword If    "${contains_operations}"=="True"    Selenium2Library.Get Text    ${MODULE_DETAIL_MODULE_NAME_LABEL}
92         BuiltIn.Run Keyword If    "${contains_operations}"=="True"    BuiltIn.Run Keywords    BuiltIn.Should Contain    ${module_detail_module_name}    ${module_list_module_name}
93         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
94         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_operations}
95         ${contains_operational}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Page Should Contain Element    ${indexed_module_operational}
96         BuiltIn.Run Keyword If    "${contains_operational}"=="True"    BuiltIn.Run Keywords    GUIKeywords.Focus And Click Element    ${indexed_module_operational}
97         ...    AND    Selenium2Library.Wait Until Page Contains Element    ${MODULE_DETAIL_MODULE_NAME_LABEL}
98         ${module_detail_module_name}=    BuiltIn.Run Keyword If    "${contains_operational}"=="True"    Selenium2Library.Get Text    ${MODULE_DETAIL_MODULE_NAME_LABEL}
99         BuiltIn.Run Keyword If    "${contains_operational}"=="True"    BuiltIn.Run Keywords    BuiltIn.Should Contain    ${module_detail_module_name}    ${module_list_module_name}
100         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
101         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_operational}
102         ${contains_config}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Page Should Contain Element    ${indexed_module_config}
103         BuiltIn.Run Keyword If    "${contains_config}"=="True"    BuiltIn.Run Keywords    GUIKeywords.Focus And Click Element    ${indexed_module_config}
104         ...    AND    Selenium2Library.Wait Until Page Contains Element    ${MODULE_DETAIL_MODULE_NAME_LABEL}
105         ${module_detail_module_name}=    BuiltIn.Run Keyword If    "${contains_config}"=="True"    Selenium2Library.Get Text    ${MODULE_DETAIL_MODULE_NAME_LABEL}
106         BuiltIn.Run Keyword If    "${contains_config}"=="True"    BuiltIn.Run Keywords    BuiltIn.Should Contain    ${module_detail_module_name}    ${module_list_module_name}
107         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
108         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_config}
109     END
110
111 Click Operations Or Operational And Config Of All Modules And Verify Chosen Tab Is Selected
112     [Arguments]    ${number_of_modules_loaded}
113     FOR    ${index}    IN RANGE    0    ${number_of_modules_loaded}
114         ${indexed_module_operations}=    YangmanKeywords.Return Indexed Module Operations Label    ${index}
115         ${indexed_module_operational}=    YangmanKeywords.Return Indexed Module Operational Label    ${index}
116         ${indexed_module_config}=    YangmanKeywords.Return Indexed Module Config Label    ${index}
117         ${contains_operational}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_operational}
118         ${contains_operations}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_operations}
119         ${contains_config}=    BuiltIn.Run Keyword And Return Status    Selenium2Library.Wait Until Page Contains Element    ${indexed_module_config}
120         BuiltIn.Run Keyword If    "${contains_operations}"=="True"    Run Keywords    YangmanKeywords.Click Indexed Module Operations To Load Module Detail Operations Tab    ${index}
121         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
122         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_operations}
123         BuiltIn.Run Keyword If    "${contains_operational}"=="True"    BuiltIn.Run Keywords    YangmanKeywords.Click Indexed Module Operational To Load Module Detail Operational Tab    ${index}
124         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
125         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_operational}
126         BuiltIn.Run Keyword If    "${contains_config}"=="True"    BuiltIn.Run Keywords    YangmanKeywords.Click Indexed Module Config To Load Module Detail Config Tab    ${index}
127         ...    AND    YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab
128         ...    AND    Selenium2Library.Wait Until Element Is Visible    ${indexed_module_config}
129     END