当前位置: 首页>>代码示例>>Python>>正文


Python KolabWAPTestHelpers.wait_loading方法代码示例

本文整理汇总了Python中helperKolabWAP.KolabWAPTestHelpers.wait_loading方法的典型用法代码示例。如果您正苦于以下问题:Python KolabWAPTestHelpers.wait_loading方法的具体用法?Python KolabWAPTestHelpers.wait_loading怎么用?Python KolabWAPTestHelpers.wait_loading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helperKolabWAP.KolabWAPTestHelpers的用法示例。


在下文中一共展示了KolabWAPTestHelpers.wait_loading方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: KolabRoundcubeChangePassword

# 需要导入模块: from helperKolabWAP import KolabWAPTestHelpers [as 别名]
# 或者: from helperKolabWAP.KolabWAPTestHelpers import wait_loading [as 别名]
class KolabRoundcubeChangePassword(unittest.TestCase):

    def setUp(self):
        self.kolabWAPhelper = KolabWAPTestHelpers()
        self.driver = self.kolabWAPhelper.init_driver()

    def helper_user_change_password(self):
        driver = self.driver

        url = driver.current_url[:driver.current_url.find("?")]
        driver.get(url + "?_task=settings&_action=plugin.password")
        self.kolabWAPhelper.wait_loading(0.5)

        elem = driver.find_element_by_id("curpasswd")
        elem.send_keys("test")
        elem = driver.find_element_by_id("newpasswd")
        elem.send_keys("test1234")
        elem = driver.find_element_by_id("confpasswd")
        elem.send_keys("test1234")

        elem = driver.find_element_by_xpath("//form[@id=\"password-form\"]//input[@class=\"button mainaction\"]")
        elem.click()

        self.kolabWAPhelper.wait_loading()
        try:
            elem = driver.find_element_by_class_name("error")
            self.assertEquals("", elem.text, "User password was not changed: " + elem.text)            
        except NoSuchElementException, e:
            # no problem, usually there should not be an error
            elem = driver.find_element_by_class_name("confirmation")
            self.assertEquals("Successfully saved.", elem.text, "User password should have been successfully saved, but was: " + elem.text)
        
        self.kolabWAPhelper.log("User has updated his password successfully")
开发者ID:Celera,项目名称:KolabScripts,代码行数:35,代码来源:testRoundcubeChangePassword.py

示例2: KolabWAPDomainAdmin

# 需要导入模块: from helperKolabWAP import KolabWAPTestHelpers [as 别名]
# 或者: from helperKolabWAP.KolabWAPTestHelpers import wait_loading [as 别名]
class KolabWAPDomainAdmin(unittest.TestCase):

    def setUp(self):
        self.kolabWAPhelper = KolabWAPTestHelpers()
        self.driver = self.kolabWAPhelper.init_driver()

    # test if correct user type is used in a normal domain
    def test_default_user_type_in_normal_domain(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_default_user_type_in_normal_domain")
        
        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        username, emailLogin, password = kolabWAPhelper.create_user(
            prefix = "user")

        # now edit the user
        kolabWAPhelper.load_user(username)

        # check if the user type is actually a normal kolab user
        elem = self.driver.find_element_by_xpath("//form[@id='user-form']/fieldset/table/tbody/tr/td[@class='value']")
        self.assertEquals("Kolab User", elem.text, "user type should be Kolab User, but was " + elem.text)

        kolabWAPhelper.logout_kolab_wap()

    def test_domain_admin_with_own_domain(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_domain_admin_with_own_domain")

        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        username, emailLogin, password, domainname = kolabWAPhelper.create_domainadmin()

        # now edit the user
        self.driver.get(self.driver.current_url)
        elem = self.driver.find_element_by_link_text("Users")
        elem.click()
        kolabWAPhelper.wait_loading()
        elem = self.driver.find_element_by_id("searchinput")
        elem.send_keys(username)
        elem.send_keys(Keys.ENTER)
        kolabWAPhelper.wait_loading(initialwait = 2)

        elem = self.driver.find_element_by_xpath("//table[@id='userlist']/tbody/tr/td")
        self.assertEquals(username + ", " + username, elem.text, "Expected to select user " + username + " but was " + elem.text)
        elem.click()

        kolabWAPhelper.wait_loading(initialwait = 1)

        # check if the user type is a Kolab user with domain admin permissions
        elem = self.driver.find_element_by_xpath("//form[@id='user-form']/fieldset/table/tbody/tr/td[@class='value']")
        self.assertEquals("Kolab User", elem.text, "user type should be Kolab user, but was " + elem.text)
        elem = self.driver.find_element_by_link_text("Domain Administrator")
        elem.click()
        if not self.driver.find_element_by_xpath("//input[@name='tbitskolabisdomainadmin']").is_selected():
            self.assertTrue(False, "isDomainAdmin should be checked")

        kolabWAPhelper.logout_kolab_wap()

    # test that domain admin cannot edit its own maxaccount / overallquota
    def test_domain_admin_edit_own_parameters(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_domain_admin_edit_own_parameters")

        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        username, emailLogin, password, domainname = kolabWAPhelper.create_domainadmin()
        kolabWAPhelper.logout_kolab_wap()

        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)
        elem = self.driver.find_element_by_xpath("//div[@class=\"settings\"]")
        elem.click()
        self.kolabWAPhelper.wait_loading()
        elem = self.driver.find_element_by_link_text("Domain Administrator")
        elem.click()
        self.kolabWAPhelper.wait_loading()
        # the domain admin should not be able to edit his own parameters, eg max accounts
        elem = self.driver.find_element_by_xpath("//input[@name=\"tbitskolabmaxaccounts\"]")
        if not "readonly" in elem.get_attribute('class'):
          self.assertTrue(False, "maxaccounts should be readonly for the domain admin")
        # also not tbitskolaboverallquota
        elem = self.driver.find_element_by_xpath("//input[@name=\"tbitskolaboverallquota\"]")
        if not "readonly" in elem.get_attribute('class'):
          self.assertTrue(False, "overallquota should be readonly for the domain admin")
        # and the checkbox for domainadmin itself should be readonly and disabled
        elem = self.driver.find_element_by_xpath("//input[@name=\"tbitskolabisdomainadmin\"]")
        if not "readonly" in elem.get_attribute('class'):
          self.assertTrue(False, "isdomainadmin should be readonly for the domain admin")
        if not elem.get_attribute('disabled') == 'true':
          self.assertTrue(False, "isdomainadmin should be disabled for the domain admin")

        kolabWAPhelper.logout_kolab_wap()

    # test if the domain admin can add users to his domain
    def test_domain_admin_create_user(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_domain_admin_edit_create_user")
#.........这里部分代码省略.........
开发者ID:Celera,项目名称:KolabScripts,代码行数:103,代码来源:testDomainAdmin.py

示例3: KolabWAPCreateUserAndEditSelf

# 需要导入模块: from helperKolabWAP import KolabWAPTestHelpers [as 别名]
# 或者: from helperKolabWAP.KolabWAPTestHelpers import wait_loading [as 别名]
class KolabWAPCreateUserAndEditSelf(unittest.TestCase):

    def setUp(self):
        self.kolabWAPhelper = KolabWAPTestHelpers()
        self.driver = self.kolabWAPhelper.init_driver()

    # edit yourself; testing bug https://issues.kolab.org/show_bug.cgi?id=2414
    def helper_user_edits_himself(self):
        driver = self.driver
        elem = driver.find_element_by_xpath("//div[@class=\"settings\"]")
        elem.click()
        self.kolabWAPhelper.wait_loading(1.0)
        elem = driver.find_element_by_name("initials")
        elem.send_keys("T")
        elem = driver.find_element_by_xpath("//input[@value=\"Submit\"]")
        elem.click()
        self.kolabWAPhelper.wait_loading()
        elem = driver.find_element_by_xpath("//div[@id=\"message\"]")
        self.assertEquals("User updated successfully.", elem.text, "User was not saved successfully, message: " + elem.text)
        
        self.kolabWAPhelper.log("User has updated his own data successfully")


    def test_edit_user_himself(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_edit_user_himself")
        
        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        username, emailLogin, password = kolabWAPhelper.create_user()

        kolabWAPhelper.logout_kolab_wap()

        # login the new user
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)

        self.helper_user_edits_himself()
        
        kolabWAPhelper.logout_kolab_wap()

    def test_edit_user_himself_multi_domain_with_quota(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_edit_user_himself_multi_domain_with_quota")
        
        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        domainname = kolabWAPhelper.create_domain()

        username, emailLogin, password = kolabWAPhelper.create_user(mail_quota="20kb")

        kolabWAPhelper.logout_kolab_wap()

        # login the new user
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)

        self.helper_user_edits_himself()
        
        kolabWAPhelper.logout_kolab_wap()

    def test_edit_user_himself_multi_domain(self):
        kolabWAPhelper = self.kolabWAPhelper
        kolabWAPhelper.log("Running test: test_edit_user_himself_multi_domain")
        
        # login Directory Manager
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", "cn=Directory Manager", "test")

        domainname = kolabWAPhelper.create_domain()

        username, emailLogin, password = kolabWAPhelper.create_user()

        kolabWAPhelper.logout_kolab_wap()

        # login the new user
        kolabWAPhelper.login_kolab_wap("/kolab-webadmin", emailLogin, password)

        self.helper_user_edits_himself()
        
        kolabWAPhelper.logout_kolab_wap()


    def tearDown(self):
        
        # write current page for debugging purposes
        self.kolabWAPhelper.log_current_page()
        
        self.driver.quit()
开发者ID:Celera,项目名称:KolabScripts,代码行数:90,代码来源:testCreateUserAndEditSelf.py


注:本文中的helperKolabWAP.KolabWAPTestHelpers.wait_loading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。