summaryrefslogtreecommitdiffstats
path: root/test/csit/tests/portal/testsuites/browser_setup.robot
diff options
context:
space:
mode:
authorkishore <kk707x@att.com>2017-09-08 17:15:42 -0500
committerkishore <kk707x@att.com>2017-09-08 17:20:20 -0500
commit328996fc52eee471498f8edd21b074c8ed241602 (patch)
treef7e66cafcfc086f0be99b4d05e2de8b44072f22a /test/csit/tests/portal/testsuites/browser_setup.robot
parent7d914fc5bb4665a433701796e42cbe8af021a547 (diff)
Portal scripts for CSIT
Issue-ID: PORTAL-53 Change-Id: I23126fa0d407a8ed11e365c446caed9c3c57ff85 Signed-off-by: kishore <kk707x@att.com>
Diffstat (limited to 'test/csit/tests/portal/testsuites/browser_setup.robot')
-rw-r--r--test/csit/tests/portal/testsuites/browser_setup.robot43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/csit/tests/portal/testsuites/browser_setup.robot b/test/csit/tests/portal/testsuites/browser_setup.robot
new file mode 100644
index 000000000..6ef4f7268
--- /dev/null
+++ b/test/csit/tests/portal/testsuites/browser_setup.robot
@@ -0,0 +1,43 @@
+*** Settings ***
+Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps
+Library Collections
+Library OSUtils
+Library OperatingSystem
+Library ExtendedSelenium2Library
+Resource global_properties.robot
+
+*** Variables ***
+
+*** Keywords ***
+Setup Browser
+ [Documentation] Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
+ Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox
+ Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome
+ Log Running with ${GLOBAL_SELENIUM_BROWSER}
+
+Setup Browser Firefox
+ ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
+ Set To Dictionary ${dc} elementScrollBehavior 1
+ Create Webdriver Firefox desired_capabilities=${dc}
+ Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
+
+ Setup Browser Chrome
+ ${os}= Get Normalized Os
+ Log Normalized OS=${os}
+ ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
+ Call Method ${chrome options} add_argument no-sandbox
+ ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver
+ Set To Dictionary ${dc} elementScrollBehavior 1
+ Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc}
+ Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
+
+Handle Proxy Warning
+ [Documentation] Handle Intermediate Warnings from Proxies
+ ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE}
+ Return From Keyword if '${status}' != 'PASS'
+ ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
+ Return From Keyword if '${status}' != 'PASS'
+ Return From Keyword if "${GLOBAL_PROXY_WARNING_TITLE}" == ''
+ Return From Keyword if "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == ''
+ ${test} ${value}= Run keyword and ignore error Title Should Be ${GLOBAL_PROXY_WARNING_TITLE}
+ Run keyword If '${test}' == 'PASS' Click Element xpath=${GLOBAL_PROXY_WARNING_CONTINUE_XPATH} \ No newline at end of file