1efb1413ce2bec149a9b1a120c37507b957bf94c
[testsuite.git] / robot / resources / portal-sdk / portalSdkDef.robot
1 *** Settings ***
2 Documentation    This is RobotFrame work script
3 Library    ExtendedSelenium2Library
4 Library    OperatingSystem
5 #Library        XvfbRobot
6
7
8 *** Variables ***
9 ${PORTAL_SDK_URL}               http://portal.api.simpledemo.onap.org:8990
10 ${PORTAL_SDK_ENV}            /ONAPPORTALSDK
11 ${PORTAL_SDK_LOGIN_URL}                ${PORTAL_SDK_URL}${PORTAL_ENV}/login.htm
12 ${PORTAL_SDK_HOME_PAGE}        ${PORTAL_SDK_URL}${PORTAL_ENV}/welcome
13 ${PORTAL_SDK_MICRO_ENDPOINT}    ${PORTAL_SDK_URL}${PORTAL_ENV}/commonWidgets
14 ${PORTAL_SDK_HOME_URL}                ${PORTAL_SDK_URL}${PORTAL_ENV}/applicationsHome
15 ${GLOBAL_APPLICATION_ID}           robot-functional
16 ${GLOBAL_PORTAL_ADMIN_USER}             demo
17 ${GLOBAL_PORTAL_ADMIN_PWD}              demo
18 ${GLOBAL_SELENIUM_BROWSER}        chrome
19 ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}        Create Dictionary
20 ${GLOBAL_SELENIUM_DELAY}          0
21 ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}        5
22 ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}        15
23 ${GLOBAL_BUILD_NUMBER}    0
24 ${GLOBAL_VM_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
25
26 #*** Test Cases ***
27
28 *** Keywords ***
29
30 SDKPortal admin Login To Portal GUI
31     [Documentation]    Logs into Portal GUI
32     #    Setup Browser
33     #    Start Virtual Display    1920    1080
34     Open Browser    ${PORTAL_SDK_LOGIN_URL}    chrome
35     #    Go To    ${PORTAL_SDK_LOGIN_URL}
36     Maximize Browser Window
37     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
38     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
39     Log    Logging in to ${PORTAL_SDK_URL}${PORTAL_SDK_ENV}
40     # Handle Proxy Warning
41     Title Should Be    Login
42     Input Text    xpath=//input[@id='loginId']    ${GLOBAL_PORTAL_ADMIN_USER}
43     Input Password    xpath=//input[@id='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
44     Click Element    //*[@id="loginBtn"]
45     Wait Until Page Contains Element    xpath=//img[@src='app/fusionapp/icons/logo_onap_transbg.png']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
46     Log    Logged in to ${PORTAL_SDK_URL}${PORTAL_SDK_ENV}
47
48 SDKPortalAdmin Navigation Application Link Tab
49     [Documentation]    Logs into Portal GUI as Portal admin
50     Comment    Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
51     Comment    Go To    ${PORTAL_SDK_HOME_PAGE}
52     Comment    Dismiss Alert    accept=false
53     #Scroll Element Into View    xpath=//span[@id='tab-Home']
54     #Click Element    xpath=//span[@id='tab-Home']
55     #Click Element    xpath=(//span[@id='tab-xDemo-App']/following::i[@class='ion-close-round'])[1]
56     Comment    Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
57
58 Validate SDK Sub Menu
59     [Documentation]    Logs into SDK GUI as Portal admin
60     Page Should Contain    Home
61     Page Should Contain    Sample Pages
62     Page Should Contain    Reports
63     Page Should Contain    Profile
64     Page Should Contain    Admin
65
66 Click Sample Pages and validate sub Menu
67     [Documentation]    Click Sample Pages
68     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
69     Click Link    xpath=//a[@id='parent-item-Sample-Pages']
70     Element Text Should Be    xpath=//a[@title='Collaboration']    Collaboration
71     Element Text Should Be    xpath=//a[@title='Notebook']    Notebook
72     Click Link    xpath=//a[contains(@title,'Collaboration')]
73     Page Should Contain    User List
74     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
75     Click Link    xpath=//a[@id='parent-item-Sample-Pages']
76     Click Link    xpath=//a[contains(@title,'Notebook')]
77     Element Text Should Be    xpath=//h1[contains(.,'Notebook')]    Notebook
78
79 Click Reports and validate sub Menu
80      [Documentation]    Click Reports Tab
81      #Select frame    xpath=.//*[@id='tabframe-xDemo-App']
82      Click Link    xpath=//a[@id='parent-item-Reports']
83      Element Text Should Be    xpath=//a[@title='All Reports']    All Reports
84      Element Text Should Be    xpath=//a[@title='Create Reports']    Create Reports
85      Click Link    xpath=//a[contains(@title,'All Reports')]
86      Page Should Contain    Report search
87      Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
88      Click Link    xpath=//a[@id='parent-item-Reports']
89      Click Link    xpath=//a[contains(@title,'Create Reports')]
90      Page Should Contain    Report Wizard
91
92 Click Profile and validate sub Menu
93     [Documentation]    Click Profile Tab
94     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
95     Click Link    xpath=//a[@id='parent-item-Profile']
96     Element Text Should Be    xpath=//a[@title='Search']    Search
97     Element Text Should Be    xpath=//a[@title='Self']    Self
98     Click Link    xpath=//a[contains(@title,'Search')]
99     Page Should Contain    Profile Search
100     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
101     Click Link    xpath=//a[@id='parent-item-Profile']
102     Click Link    xpath=//a[contains(@title,'Self')]
103     Page Should Contain    Self Profile Detail
104
105 Click Admin and validate sub Menu
106     [Documentation]    Click Admin Tab
107     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
108     Click Link    xpath=//a[@id='parent-item-Admin']
109     Element Text Should Be    xpath=//a[@title='Roles']    Roles
110     Element Text Should Be    xpath=//a[@title='Role Functions']    Role Functions
111     Element Text Should Be    xpath=//a[@title='Cache Admin']    Cache Admin
112     Element Text Should Be    xpath=//a[@title='Menus']    Menus
113     Element Text Should Be    xpath=//a[@title='Usage']    Usage
114     Click Link    xpath=//a[contains(@title,'Roles')]
115     Page Should Contain    Roles
116     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
117     Click Link    xpath=//a[@id='parent-item-Admin']
118     Click Link    xpath=//a[contains(@title,'Role Function')]
119     Page Should Contain    Role Function
120     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
121     Click Link    xpath=.//a[@id='parent-item-Admin']
122     #Select frame    xpath=.//*[@id='tabframe-xDemo-App']
123     Click Link    xpath=//a[@id='parent-item-Admin']
124     Click Link    xpath=//a[contains(@title,'Cache Admin')]
125     Page Should Contain    Cache Regions
126     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
127     Click Link    xpath=.//a[@id='parent-item-Admin']
128     Click Link    xpath=//a[@id='parent-item-Admin']
129     Click Link    xpath=//a[contains(@title,'Menus')]
130     Page Should Contain    Admin Menu Items
131     Comment    Select frame    xpath=.//*[@id='tabframe-xDemo-App']
132     Click Link    xpath=//a[@id='parent-item-Admin']
133     Click Link    xpath=//a[@id='parent-item-Admin']
134     Click Link    xpath=//a[contains(@title,'Usage')]
135     Page Should Contain    Current Usage
136
137