Ejemplo n.º 1
0
def test_03_edit_userNAS_sudo(wb_driver):
    # Changing permission to sudo
    user_edit(wb_driver, "user", newusername)
    wb_driver.find_element_by_xpath('//*[@id="save_button"]').click()
    time.sleep(5)
    # taking screenshot
    test_name = sys._getframe().f_code.co_name
    take_screenshot(wb_driver, script_name, test_name)
Ejemplo n.º 2
0
def test_05_edit_groupNAS_sudo(wb_driver):
    time.sleep(2)
    user_edit(wb_driver, "group", newgroupname)
    wb_driver.find_element_by_xpath(xpaths['group']).click()
    wb_driver.find_element_by_xpath('//*[@id="save_button"]').click()
    time.sleep(20)
    # taking screenshot
    test_name = sys._getframe().f_code.co_name
    take_screenshot(wb_driver, script_name, test_name)
Ejemplo n.º 3
0
def test_02_edit_userNAS_email(wb_driver):
    time.sleep(2)
    # call edit funtion on the userNAS
    user_edit(wb_driver, "user", newusername)
    # get the ui element
    ui_email = wb_driver.find_element_by_xpath(xpaths['email'])
    ui_email.clear()
    ui_email.send_keys("*****@*****.**")
    # taking screenshot
    test_name = sys._getframe().f_code.co_name
    take_screenshot(wb_driver, script_name, test_name)
Ejemplo n.º 4
0
def test_05_edit_groupNAS_sudo(wb_driver):
    time.sleep(2)
    user_edit(wb_driver, "group", newgroupname)
    wb_driver.find_element_by_xpath(xpaths['group']).click()
    wb_driver.find_element_by_xpath('//*[@id="save_button"]').click()
    time.sleep(5)
    # taking screenshot
    test_name = sys._getframe().f_code.co_name
    take_screenshot(wb_driver, script_name, test_name)
    no_error = error_check(wb_driver)
    assert no_error['result'], no_error['traceback']
Ejemplo n.º 5
0
 def test_02_01_edit_groupNAS_sudo(self):
     try:
         print ("change permission of groupNAS to sudo")
         time.sleep(2)
         function.user_edit(driver, self, "group", newgroupname)
         driver.find_element_by_xpath('//*[@id="bsdgrp_sudo"]/mat-checkbox/label/div').click()
         driver.find_element_by_xpath('//*[@id="save_button"]').click()
         time.sleep(20)
         #taking screenshot
         function.screenshot(driver, self)
     except Exception:
         exc_info_p = traceback.format_exception(*sys.exc_info())
         function.screenshot(driver, self)
         for i in range(1,len(exc_info_p)):
             print (exc_info_p[i].rstrip())
         self.assertEqual("Just for fail", str(Exception), msg="Test fail: Please check the traceback")
Ejemplo n.º 6
0
 def test_01_02_edit_userNAS_sudo(self):
     try:
         print ("Changing permission to sudo user ")
         # Changing permission to sudo
         ui_sudo=driver.find_element_by_xpath('//*[@id="sudo"]/mat-checkbox')
         function.user_edit(driver, self, "user", newusername)
         driver.find_element_by_xpath('//*[@id="save_button"]').click()
         time.sleep(15)
         #taking screenshot
         function.screenshot(driver, self)
     except Exception:
         exc_info_p = traceback.format_exception(*sys.exc_info())
         #taking screenshot
         function.screenshot(driver, self)
         for i in range(1,len(exc_info_p)):
             print (exc_info_p[i].rstrip())
         self.assertEqual("Just for fail", str(Exception), msg="Test fail: Please check the traceback")
Ejemplo n.º 7
0
 def test_01_01_edit_userNAS_email(self):
     try:
         print ("Change the email to [email protected] ")
         time.sleep(2)
         #call edit funtion on the userNAS
         function.user_edit(driver, self, "user", newusername)
         # get the ui element
         ui_email=driver.find_element_by_xpath('//*[@id="email"]/mat-input-container/div/div[1]/div/input')
         ui_email.clear()
         ui_email.send_keys("*****@*****.**")
         #taking screenshot
         function.screenshot(driver, self)
     except Exception:
         exc_info_p = traceback.format_exception(*sys.exc_info())
         #taking screenshot
         function.screenshot(driver, self)
         for i in range(1,len(exc_info_p)):
             print (exc_info_p[i].rstrip())
         self.assertEqual("Just for fail", str(Exception), msg="Test fail: Please check the traceback")