@ -3,6 +3,7 @@ import os
import nose2
import nose2
import time
import time
import functions . Collections as Collections
import functions . Collections as Collections
import functions . Functions as Functions
from selenium import webdriver
from selenium import webdriver
from selenium . webdriver . common . keys import Keys
from selenium . webdriver . common . keys import Keys
from selenium . webdriver . common . desired_capabilities import DesiredCapabilities
from selenium . webdriver . common . desired_capabilities import DesiredCapabilities
@ -51,24 +52,12 @@ class testrun(unittest.TestCase):
self . assertTrue ( driver . find_element_by_xpath (
self . assertTrue ( driver . find_element_by_xpath (
' //div[contains(@class, " q-alert-container " )] ' )
' //div[contains(@class, " q-alert-container " )] ' )
. is_displayed ( ) , " Error Message was not shown " )
. is_displayed ( ) , " Error Message was not shown " )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " csc-login-form " ]//div//input[@type= " text " ] '
driver , ' //*[@id= " csc-login-form " ]//div//input[@type= '
) . send_keys ( Keys . CONTROL + " a " )
' " text " ] ' , " testuser@ " + domainname )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " csc-login-form " ]//div//input[@type= " text " ] '
driver , ' //*[@id= " csc-login-form " ]//div//input[@type= '
) . send_keys ( Keys . DELETE )
' " password " ] ' , " testpasswd " )
driver . find_element_by_xpath (
' //*[@id= " csc-login-form " ]//div//input[@type= " text " ] '
) . send_keys ( ' testuser@ ' + domainname )
driver . find_element_by_xpath (
' //*[@id= " csc-login-form " ]//div//input[@type= " password " ] '
) . send_keys ( Keys . CONTROL + " a " )
driver . find_element_by_xpath (
' //*[@id= " csc-login-form " ]//div//input[@type= " password " ] '
) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " csc-login-form " ]//div//input[@type= " password " ] '
) . send_keys ( ' testpasswd ' )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " csc-login " ]//div//button ' ) . click ( )
' //*[@id= " csc-login " ]//div//button ' ) . click ( )
self . assertEqual ( " testuser " , driver . find_element_by_xpath (
self . assertEqual ( " testuser " , driver . find_element_by_xpath (
@ -241,15 +230,9 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' /input ' ) . send_keys ( ' testdestination ' )
' /input ' ) . send_keys ( ' testdestination ' )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
driver , ' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/ '
' input ' ) . send_keys ( Keys . CONTROL + " a " )
' ../input ' , " 100 " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( " 100 " )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button '
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button '
' /span[contains(text(), " Save " )] ' ) . click ( )
' /span[contains(text(), " Save " )] ' ) . click ( )
@ -276,15 +259,9 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' /input ' ) . send_keys ( ' testdestination ' )
' /input ' ) . send_keys ( ' testdestination ' )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
driver , ' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/ '
' input ' ) . send_keys ( Keys . CONTROL + " a " )
' ../input ' , " 200 " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( " 200 " )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button/ '
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button/ '
' span[contains(text(), " Save " )] ' ) . click ( )
' span[contains(text(), " Save " )] ' ) . click ( )
@ -313,15 +290,9 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' //*[@id= " q-app " ]//div[contains(text(), " Destination " )]/.. '
' /input ' ) . send_keys ( ' testdestination ' )
' /input ' ) . send_keys ( ' testdestination ' )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
driver , ' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/ '
' input ' ) . send_keys ( Keys . CONTROL + " a " )
' ../input ' , " 300 " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Timeout " )]/../ '
' input ' ) . send_keys ( " 300 " )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button/ '
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button/ '
' span[contains(text(), " Save " )] ' ) . click ( )
' span[contains(text(), " Save " )] ' ) . click ( )
@ -625,15 +596,9 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../../ '
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../../ '
' i[1] ' ) . click ( )
' i[1] ' ) . click ( )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../ '
driver , ' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../ '
' input ' ) . send_keys ( Keys . CONTROL + " a " )
' input ' , " 12345 " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../ '
' input ' ) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../ '
' input ' ) . send_keys ( " 12345 " )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../../ '
' //*[@id= " q-app " ]//div[contains(text(), " Change PIN " )]/../../ '
' i[1] ' ) . click ( )
' i[1] ' ) . click ( )
@ -646,15 +611,9 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../../ '
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../../ '
' i[1] ' ) . click ( )
' i[1] ' ) . click ( )
driver . find_element_by_xpath (
Functions . fill_element (
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../ '
driver , ' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )] '
' input ' ) . send_keys ( Keys . CONTROL + " a " )
' /../input ' , " test@email.com " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../ '
' input ' ) . send_keys ( Keys . DELETE )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../ '
' input ' ) . send_keys ( " test@email.com " )
driver . find_element_by_xpath (
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../../ '
' //*[@id= " q-app " ]//div[contains(text(), " Change Email " )]/../../ '
' i[1] ' ) . click ( )
' i[1] ' ) . click ( )