From 8bf49988b7d6af5fdb48b5d2c1f830fbe318e83a Mon Sep 17 00:00:00 2001 From: sv764t Date: Thu, 25 Oct 2018 01:42:52 -0400 Subject: Change Management Schedule Optimization Adding scripts and robot test suites for cmso as per CSIT procedure Fixing the start up scripts to use docker Removing .pyc files Fix copyright headers for the shell scripts Change-Id: I61492abd5d5060b5a773dec74320f2ecfc0fcbf5 Issue-ID: OPTFRA-382 Signed-off-by: sv764t Signed-off-by: vrvarma --- tests/optf-cmso/cmso/resources/browser_setup.robot | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/optf-cmso/cmso/resources/browser_setup.robot (limited to 'tests/optf-cmso/cmso/resources/browser_setup.robot') diff --git a/tests/optf-cmso/cmso/resources/browser_setup.robot b/tests/optf-cmso/cmso/resources/browser_setup.robot new file mode 100644 index 00000000..032759ea --- /dev/null +++ b/tests/optf-cmso/cmso/resources/browser_setup.robot @@ -0,0 +1,50 @@ +*** 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 Selenium2Library + +*** Variables *** +${CHROME_DRIVER_WIN32_PATH} drivers/win32 +${CHROME_DRIVER_MAC64_PATH} drivers/mac64 +${CHROME_DRIVER_LINUX64_PATH} drivers/linux64 +${CHROME_DRIVER_WIN32} ${CHROME_DRIVER_WIN32_PATH}/chromedriver.exe +${CHROME_DRIVER_MAC64} ${CHROME_DRIVER_MAC64_PATH} /chromedriver +${CHROME_DRIVER_LINUX64} ${CHROME_DRIVER_LINUX64_PATH}/chromedriver + +*** Keywords *** +Setup Browser + [Documentation] Sets up browser based upon the value of + [Arguments] ${browser} + Run Keyword If '${browser}' == 'firefox' Setup Browser Firefox + Run Keyword If '${browser}' == 'chrome' Setup Browser Chrome + Log Running with ${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} + Run Keyword If '${os}' == 'win32' Append To Environment Variable PATH ${CHROME_DRIVER_WIN32_PATH} + ##Run Keyword If '${os}' == 'win32' Set Environment Variable webdriver.chrome.driver ${CHROME_DRIVER_WIN32} + Run Keyword If '${os}' == 'mac64' Append To Environment Variable PATH ${CHROME_DRIVER_MAC64_PATH} + #Run Keyword If '${os}' == 'mac64' Set Environment Variable webdriver.chrome.driver ${CHROME_DRIVER_MAC64} + Run Keyword If '${os}' == 'linux64' Append To Environment Variable PATH ${CHROME_DRIVER_LINUX64_PATH} + #Run Keyword if '${os}' == 'linux64' Set Environment Variable webdriver.chrome.driver ${CHROME_DRIVER_LINUX64} + ${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 ATT Speed Bump + [Documentation] Handle AT&T Speed Bump when accessing Rackspace UI from AT&T network + ${test} ${value}= Run keyword and ignore error Title Should Be Notice - Uncategorized Site + Run keyword If '${test}' == 'PASS' Click Element xpath=//a[contains(@href, 'accepted-Notify-Uncategorized')] \ No newline at end of file -- cgit 1.2.3-korg