@ -1,9 +1,12 @@
import unittest
import os
import traceback
from multiprocessing import Value
import nose2
import time
import functions . Collections as Collections
import functions . Functions as Functions
import selenium . common . exceptions
from selenium import webdriver
from selenium . webdriver . common . keys import Keys
from selenium . webdriver . common . desired_capabilities import DesiredCapabilities
@ -11,40 +14,49 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium . webdriver . support import expected_conditions as EC
from selenium . webdriver . common . by import By
domainname = " thistextwillbereplaced "
customer name = " thistextwillalsobereplaced "
execs = Value ( ' i ' , 0 )
customer s = { }
filename = 0
def preparation ( ) :
global customers
driver = Functions . create_driver ( )
Collections . login_panel ( driver )
for i in range ( 0 , int ( os . environ [ ' THREADS ' ] ) ) :
customers [ Collections . create_customer (
driver ) ] = Collections . create_domain ( driver )
del i
for customer in customers . keys ( ) :
Collections . create_subscriber ( driver , customer , customers [ customer ] )
driver . quit ( )
def cleanup ( ) :
global customers
driver = Functions . create_driver ( )
Collections . login_panel ( driver )
for customer in customers :
Collections . delete_customer ( driver , customer )
Collections . delete_domain ( driver , customers [ customer ] )
driver . quit ( )
class testrun ( unittest . TestCase ) :
def setUp ( self ) :
profile = webdriver . FirefoxProfile ( )
profile . accept_untrusted_certs = True
caps = DesiredCapabilities ( ) . FIREFOX
caps [ " pageLoadStrategy " ] = " normal "
self . driver = webdriver . Firefox (
capabilities = caps , firefox_profile = profile , log_path = ' /dev/null ' )
self . driver . implicitly_wait ( 10 )
self . driver . set_page_load_timeout ( 10 )
global execs
global customers
self . driver = Functions . create_driver ( )
self . longMessage = True
execs . value + = 1
key = list ( customers . keys ( ) ) [ execs . value % int ( os . environ [ ' THREADS ' ] ) ]
self . domainname = customers [ key ]
def test_a_preparation ( self ) :
global domainname
global customername
def test_login_page ( self ) :
global customers
global filename
filename = " test_a_preparation.png "
driver = self . driver
Collections . login_panel ( driver )
domainname = Collections . create_domain ( driver )
customername = Collections . create_customer ( driver )
Collections . create_subscriber ( driver , customername , domainname )
filename = 0
def test_b_login_logout ( self ) :
global domainname
global filename
filename = " test_b_login_logout.png "
filename = " test_login_page.png "
driver = self . driver
driver . get ( os . environ [ ' CATALYST_SERVER ' ] )
driver . find_element_by_xpath (
@ -60,7 +72,7 @@ class testrun(unittest.TestCase):
. is_displayed ( ) , " Error Message was not shown " )
Functions . fill_element (
driver , ' //*[@id= " csc-login-form " ]//div//input[@type= '
' " text " ] ' , " testuser@ " + domainname )
' " text " ] ' , " testuser@ " + self . domainname )
Functions . fill_element (
driver , ' //*[@id= " csc-login-form " ]//div//input[@type= '
' " password " ] ' , " testpasswd " )
@ -143,12 +155,13 @@ class testrun(unittest.TestCase):
' Language was not changed back to English ' )
filename = 0
def test_c _c all_blocking( self ) :
global domainname
def test_c all_blocking( self ) :
global customers
global filename
filename = " test_c _c all_blocking.png"
filename = " test_c all_blocking.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Call Blocking " )] ' ) ) )
@ -189,7 +202,7 @@ class testrun(unittest.TestCase):
' " q-toggle " )]/div[contains(@class, " active " )] ' ) . is_displayed ( ) ,
" Option ' All anonymous incoming calls are blocked ' was not "
" enabled " )
self . assertEqual s ( " 12345 " , driver . find_element_by_xpath (
self . assertEqual ( " 12345 " , driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-blocked-number '
' csc-list-item " )]//div[@class= " q-item-label " ] ' ) . text ,
" Number is not correct " )
@ -212,7 +225,7 @@ class testrun(unittest.TestCase):
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element ( (
By . XPATH , ' //*[@id= " q-app " ]//div[@class= " csc-spinner " ]/svg ' ) ) )
driver . implicitly_wait ( 10 )
self . assertEqual s ( " 54321 " , driver . find_element_by_xpath (
self . assertEqual ( " 54321 " , driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-blocked-number '
' csc-list-item " )]//div[@class= " q-item-label " ] ' ) . text ,
" Number is not correct " )
@ -255,7 +268,7 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " csc-form-actions row justify-center '
' " ]/button[2] ' ) . click ( )
self . assertEqual s ( " 12345 " , driver . find_element_by_xpath (
self . assertEqual ( " 12345 " , driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-blocked-number '
' csc-list-item " )]//div[@class= " q-item-label " ] ' ) . text ,
" Number is not correct " )
@ -275,10 +288,10 @@ class testrun(unittest.TestCase):
' //*[@id= " q-app " ]//div//i[text()= " check " ] ' )
driver . execute_script ( " arguments[0].click(); " , elem )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element ( (
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element _located ( (
By . XPATH , ' //*[@id= " q-app " ]//div[@class= " csc-spinner " ]/svg ' ) ) )
driver . implicitly_wait ( 10 )
self . assertEqual s ( " 54321 " , driver . find_element_by_xpath (
self . assertEqual ( " 54321 " , driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-blocked-number '
' csc-list-item " )]//div[@class= " q-item-label " ] ' ) . text ,
" Number is not correct " )
@ -298,9 +311,16 @@ class testrun(unittest.TestCase):
' //*[@id= " q-app " ]//div[@class= " csc-list-message " ] '
' [contains(text(), " No numbers found " )] ' ) . is_displayed ( ) ,
" Number has not been deleted " )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Privacy " )] ' ) ) )
' [contains(text(), " Privacy " )]/div[@class= " q-inner-loading '
' animate-fade absolute-full column flex-center " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Privacy " )]/div[@class= " q-inner-loading '
' animate-fade absolute-full column flex-center " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Privacy " )] ' ) . click ( )
@ -323,12 +343,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ d_ call_forward_after_hours( self ) :
global domainname
def test_ call_forward_after_hours( self ) :
global customers
global filename
filename = " test_ d_ call_forward_after_hours.png"
filename = " test_ call_forward_after_hours.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Call Forward " )] ' ) ) )
@ -404,6 +425,10 @@ class testrun(unittest.TestCase):
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button '
' /span[contains(text(), " Save " )] ' ) . click ( )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
@ -466,12 +491,21 @@ class testrun(unittest.TestCase):
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
Functions . click_js (
driver ,
' //*[@id= " q-app " ]//div[@class= " q-field-content col-xs-12 col-sm " ] '
' /div[@tabindex= " 0 " ] ' ) . click ( )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-destination '
' csc-own-phone " )]/div[contains(@class, " dest-btns " )] ' ) . click ( )
' /div[@tabindex= " 0 " ]/div[@class= " q-option-inner '
' relative-position " ] ' )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@tabindex= " 0 " ][contains(@class, " q-toggle " '
' )]/div[@class= " q-option-inner relative-position '
@ -499,14 +533,14 @@ class testrun(unittest.TestCase):
" im busy ' is missing " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-tab column flex-center '
' relative-position icon-and-label " ]//span[ @class=" q-tab-label " ] '
) . click ( )
' relative-position icon-and-label " ]//span[ contains '
' (text(), " Add new " )] ' ) . click ( )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[1]//input ' , ' testsourceset' )
' div[1]//input ' , ' first testsourceset' )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[2]//input ' , ' testsource' )
' div[2]//input ' , ' first testsource' )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/div '
' [@tabindex=0] ' ) . click ( )
@ -526,10 +560,10 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div/span[contains (text(), " testsourceset " )] '
) . click ( )
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " firsttestsourceset " )] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " testsource" )] '
' //*[@id= " q-app " ]//div[contains(text(), " first testsource" )] '
) . is_displayed ( ) , " Source was not found " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " sources-section " ]/button ' ) . click ( )
@ -569,7 +603,7 @@ class testrun(unittest.TestCase):
" Second Source was not deleted " )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " testsource" )]/../ '
' //*[@id= " q-app " ]//div[contains(text(), " first testsource" )]/../ '
' div[2] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' /html/body//div[@class= " q-alert row no-wrap shadow-2 '
@ -665,7 +699,8 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
time . sleep ( 1 )
self . assertFalse ( driver . find_elements_by_xpath (
' //*[@id= " q-app " ]//div/span[contains(text(), " testsourceset " )] ' ) ,
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " firsttestsourceset " )] ' ) ,
" Second Source Set was not deleted " )
driver . implicitly_wait ( 10 )
Collections . logout_csc ( driver )
@ -674,12 +709,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ e_ call_forward_always( self ) :
global domainname
def test_ call_forward_always( self ) :
global customers
global filename
filename = " test_ e_ call_forward_always.png"
filename = " test_ call_forward_always.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Call Forward " )] ' ) ) )
@ -718,6 +754,10 @@ class testrun(unittest.TestCase):
' //*[@id= " q-app " ]//div[@class= " add-destination-form " ]//button '
' /span[contains(text(), " Save " )] ' ) . click ( )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
@ -823,12 +863,21 @@ class testrun(unittest.TestCase):
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
Functions . click_js (
driver ,
' //*[@id= " q-app " ]//div[@class= " q-field-content col-xs-12 col-sm " ] '
' /div[@tabindex= " 0 " ] ' ) . click ( )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-destination '
' csc-own-phone " )]/div[contains(@class, " dest-btns " )] ' ) . click ( )
' /div[@tabindex= " 0 " ]/div[@class= " q-option-inner '
' relative-position " ] ' )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@tabindex= " 0 " ][contains(@class, " q-toggle " '
' )]/div[@class= " q-option-inner relative-position '
@ -864,14 +913,14 @@ class testrun(unittest.TestCase):
" im offline ' is missing " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-tab column flex-center '
' relative-position icon-and-label " ]//span[ @class=" q-tab-label " ] '
) . click ( )
' relative-position icon-and-label " ]//span[ contains '
' (text(), " Add new " )] ' ) . click ( )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[1]//input ' , ' testsourceset' )
' div[1]//input ' , ' second testsourceset' )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[2]//input ' , ' testsource' )
' div[2]//input ' , ' second testsource' )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/div '
' [@tabindex=0] ' ) . click ( )
@ -891,10 +940,10 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div/span[contains (text(), " testsourceset " )] '
) . click ( )
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " secondtestsourceset " )] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " testsource" )] '
' //*[@id= " q-app " ]//div[contains(text(), " second testsource" )] '
) . is_displayed ( ) , " Source was not found " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " sources-section " ]/button ' ) . click ( )
@ -934,7 +983,7 @@ class testrun(unittest.TestCase):
" Second Source was not deleted " )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " testsource" )]/../ '
' //*[@id= " q-app " ]//div[contains(text(), " second testsource" )]/../ '
' div[2] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' /html/body//div[@class= " q-alert row no-wrap shadow-2 '
@ -1030,7 +1079,8 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
time . sleep ( 1 )
self . assertFalse ( driver . find_elements_by_xpath (
' //*[@id= " q-app " ]//div/span[contains(text(), " testsourceset " )] ' ) ,
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " secondtestsourceset " )] ' ) ,
" Second Source Set was not deleted " )
driver . implicitly_wait ( 10 )
Collections . logout_csc ( driver )
@ -1039,12 +1089,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ f_ call_forward_company_hours( self ) :
global domainname
def test_ call_forward_company_hours( self ) :
global customers
global filename
filename = " test_ f_ call_forward_company_hours.png"
filename = " test_ call_forward_company_hours.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Call Forward " )] ' ) ) )
@ -1186,12 +1237,21 @@ class testrun(unittest.TestCase):
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
Functions . click_js (
driver ,
' //*[@id= " q-app " ]//div[@class= " q-field-content col-xs-12 col-sm " ] '
' /div[@tabindex= " 0 " ] ' ) . click ( )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(@class, " csc-destination '
' csc-own-phone " )]/div[contains(@class, " dest-btns " )] ' ) . click ( )
' /div[@tabindex= " 0 " ]/div[@class= " q-option-inner '
' relative-position " ] ' )
driver . implicitly_wait ( 2 )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . invisibility_of_element_located ( (
By . XPATH , ' //div[@class= " q-loading animate-fade fullscreen column '
' flex-center z-maxundefined " ]/svg[@class= " q-spinner q-spinner-mat '
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@tabindex= " 0 " ][contains(@class, " q-toggle " '
' )]/div[@class= " q-option-inner relative-position '
@ -1219,14 +1279,14 @@ class testrun(unittest.TestCase):
" im busy ' is missing " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-tab column flex-center '
' relative-position icon-and-label " ]//span[ @class=" q-tab-label " ] '
) . click ( )
' relative-position icon-and-label " ]//span[ contains '
' (text(), " Add new " )] ' ) . click ( )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[1]//input ' , ' t estsourceset' )
' div[1]//input ' , ' t hirdt estsourceset' )
Functions . fill_element (
driver , ' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/ '
' div[2]//input ' , ' t estsource' )
' div[2]//input ' , ' t hirdt estsource' )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " q-item- row no-wrap " ]/div '
' [@tabindex=0] ' ) . click ( )
@ -1246,10 +1306,10 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div/span[contains (text(), " testsourceset " )] '
) . click ( )
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " thirdtestsourceset " )] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " t estsource" )] '
' //*[@id= " q-app " ]//div[contains(text(), " t hirdt estsource" )] '
) . is_displayed ( ) , " Source was not found " )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[@class= " sources-section " ]/button ' ) . click ( )
@ -1289,7 +1349,7 @@ class testrun(unittest.TestCase):
" Second Source was not deleted " )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath (
' //*[@id= " q-app " ]//div[contains(text(), " t estsource" )]/../ '
' //*[@id= " q-app " ]//div[contains(text(), " t hirdt estsource" )]/../ '
' div[2] ' ) . click ( )
self . assertTrue ( driver . find_element_by_xpath (
' /html/body//div[@class= " q-alert row no-wrap shadow-2 '
@ -1385,7 +1445,8 @@ class testrun(unittest.TestCase):
' text-white " ] ' ) ) )
time . sleep ( 1 )
self . assertFalse ( driver . find_elements_by_xpath (
' //*[@id= " q-app " ]//div/span[contains(text(), " testsourceset " )] ' ) ,
' //*[@id= " q-app " ]//div/span[contains '
' (text(), " thirdtestsourceset " )] ' ) ,
" Second Source Set was not deleted " )
driver . implicitly_wait ( 10 )
Collections . logout_csc ( driver )
@ -1394,12 +1455,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ g_ conference_conversations( self ) :
global domainname
def test_ conference_conversations( self ) :
global customers
global filename
filename = " test_ g_ conference_conversations.png"
filename = " test_ conference_conversations.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Join conference " )] ' ) ) )
@ -1428,28 +1490,28 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath (
' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Conversations " )] ' ) . click ( )
self . assertEqual s ( driver . find_element_by_xpath (
self . assertEqual ( driver . find_element_by_xpath (
' //*[@id= " csc-conversation-content " ]/div[@class= " row justify- '
' center csc-conversation-list-message " ] ' ) . text , ' No Calls, '
' Voicemails or Faxes found ' , " Section ' All ' is not empty " )
driver . find_element_by_xpath (
' //*[@id= " csc-conversations-tabs " ]//div[@class= " q-tabs-scroller '
' row no-wrap " ]//span[contains(text(), " Calls " )] ' ) . click ( )
self . assertEqual s ( driver . find_element_by_xpath (
self . assertEqual ( driver . find_element_by_xpath (
' //*[@id= " csc-conversation-content " ]/div[@class= " row justify- '
' center csc-conversation-list-message " ] ' ) . text , ' No Calls found ' ,
" Section ' Calls ' is notempty " )
driver . find_element_by_xpath (
' //*[@id= " csc-conversations-tabs " ]//div[@class= " q-tabs-scroller '
' row no-wrap " ]//span[contains(text(), " Faxes " )] ' ) . click ( )
self . assertEqual s ( driver . find_element_by_xpath (
self . assertEqual ( driver . find_element_by_xpath (
' //*[@id= " csc-conversation-content " ]/div[@class= " row justify- '
' center csc-conversation-list-message " ] ' ) . text , ' No Faxes found ' ,
" Section ' Faxes ' is not empty " )
driver . find_element_by_xpath (
' //*[@id= " csc-conversations-tabs " ]//div[@class= " q-tabs-scroller '
' row no-wrap " ]//span[contains(text(), " Voicemails " )] ' ) . click ( )
self . assertEqual s ( driver . find_element_by_xpath (
self . assertEqual ( driver . find_element_by_xpath (
' //*[@id= " csc-conversation-content " ]/div[@class= " row justify- '
' center csc-conversation-list-message " ] ' ) . text , ' No Voicemails '
' found ' , " Section ' Voicemails ' is not empty " )
@ -1459,12 +1521,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ h_ reminder( self ) :
global domainname
def test_ reminder( self ) :
global customers
global filename
filename = " test_ h_ reminder.png"
filename = " test_ reminder.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Reminder " )] ' ) ) )
@ -1520,12 +1583,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ i_ settings( self ) :
global domainname
def test_ settings( self ) :
global customers
global filename
filename = " test_ i_ settings.png"
filename = " test_ settings.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Reminder " )] ' ) ) )
@ -1618,7 +1682,8 @@ class testrun(unittest.TestCase):
self . assertEqual (
driver . current_url , os . environ [ ' CATALYST_SERVER ' ] +
" /login/subscriber/#/login " , " Logout failed " )
Collections . login_csc ( driver , " testuser@ " + domainname , " pass1234 " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' pass1234 ' )
self . assertEqual ( " testuser " , driver . find_element_by_xpath (
' //*[@id= " csc-header-toolbar " ]//div//span[contains(text(), '
' " testuser " )] ' ) . text , " Login failed " )
@ -1648,12 +1713,16 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ j_ speed_dial( self ) :
global domainname
def test_ speed_dial( self ) :
global customers
global filename
filename = " test_ j_ speed_dial.png"
filename = " test_ speed_dial.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Speed Dial " )] ' ) ) )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Speed Dial " )] ' ) ) )
@ -1735,12 +1804,13 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_ k_ voicebox( self ) :
global domainname
def test_ voicebox( self ) :
global customers
global filename
filename = " test_ k_ voicebox.png"
filename = " test_ voicebox.png"
driver = self . driver
Collections . login_csc ( driver , " testuser@ " + domainname , " testpasswd " )
Collections . login_csc (
driver , " testuser@ " + self . domainname , ' testpasswd ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( (
By . XPATH , ' //*[@id= " main-menu " ]//div[@class= " q-item-label " ] '
' [contains(text(), " Voicebox " )] ' ) ) )
@ -1804,36 +1874,30 @@ class testrun(unittest.TestCase):
" /login/subscriber/#/login " , " Logout failed " )
filename = 0
def test_z_cleanup ( self ) :
global domainname
global customername
global filename
filename = " test_z_cleanup.png "
driver = self . driver
Collections . login_panel ( driver )
Collections . delete_customer ( driver , customername )
Functions . fill_element (
driver , ' //*[@id= " Customer_table_filter " ]//input ' , customername )
self . assertTrue ( driver . find_element_by_css_selector (
' #Customer_table tr > td.dataTables_empty ' ) . is_displayed ( ) ,
" Customer has not been deleted " )
Collections . delete_domain ( driver , domainname )
Functions . fill_element (
driver , ' //*[@id= " Domain_table_filter " ]//input ' , domainname )
self . assertTrue ( driver . find_element_by_css_selector (
' #Domain_table tr > td.dataTables_empty ' ) . is_displayed ( ) ,
" Domain has not been deleted " )
filename = 0
def tearDown ( self ) :
global customers
global filename
driver = self . driver
driver . implicitly_wait ( 10 )
if filename :
driver . save_screenshot ( ' /results/ ' + filename )
filename = 0
driver . close ( )
driver . quit ( )
if __name__ == ' __main__ ' :
nose2 . main ( )
print ( ' Preparing Domain, Customer and Subscriber for NGCP CSC tests ... ' )
try :
preparation ( )
except Exception as e :
print ( ' Preperation failed! See logs below for more details ' )
print ( ' -------------------------------------------------------------- ' )
traceback . print_exc ( )
print ( ' -------------------------------------------------------------- ' )
quit ( 1 )
print ( ' Preperation successful, running tests now ... ' )
nose2 . main ( exit = False )
try :
cleanup ( )
except Exception as e :
traceback . print_exc ( )
quit ( 1 )