1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may
9 # not use this file except in compliance with the License. You may obtain
10 # a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 # License for the specific language governing permissions and limitations
22 # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code.
27 ${DESIRED_CAPABILITIES} desired_capabilities
31 ${VALID PASSWORD} admin
33 ${WELCOME URL} /projects/
34 ${NS LIST URL} /packages/ns/list
35 ${VNF LIST URL} /packages/vnf/list
40 ${env_host}= Get Environment Variable OSM_HOSTNAME
41 ${passed}= Run Keyword And Return Status Should Contain ${env_host} :
42 Run Keyword If ${passed} Set Dockerized Host
43 ... ELSE Set Standalone Host ${env_host}
46 Open Browser To Login Page
47 ${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
48 Call Method ${chrome_options} add_argument headless
49 Call Method ${chrome_options} add_argument disable-gpu
50 Call Method ${chrome_options} add_argument no-sandbox
51 ${options}= Call Method ${chrome_options} to_capabilities
52 Open Browser ${SERVER}${LOGIN URL} ${BROWSER} desired_capabilities=${options}
53 Maximize Browser Window
54 Set Selenium Speed ${DELAY}
55 Login Page Should Be Open
58 Login Page Should Be Open
59 Element Text Should Be //*[@id="main_content"]/div/div[2]/p Sign in to start your session
63 [Arguments] ${username} ${password}
64 Input Text name:username ${username}
65 Input Password name:password ${password}
69 Click Button //*[@id="main_content"]/div/div[2]/form/div[3]/div[2]/button
72 Home Page Should Be Open
73 Location Should Be ${SERVER}${WELCOME URL}
74 # Element Should Contain id:title_header 6e3a8415-9014-4100-9727-90e0150263be ignore_case=True
75 Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[1]/div/a href ${SERVER}${NS LIST URL}
76 Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[2]/div/a href ${SERVER}${VNF LIST URL}
81 Set Suite Variable ${SERVER} http://light-ui
85 [Arguments] ${env_host}
87 Set Suite Variable ${SERVER} http://${env_host}