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


Python Home.random_string方法代码示例

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


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

示例1: test_datadriven_rbac

# 需要导入模块: from pages.home import Home [as 别名]
# 或者: from pages.home.Home import random_string [as 别名]
    def test_datadriven_rbac(self, mozwebqa, org, perm_name, resource, verbs, allowed, disallowed):
        """
        Perform a data driven test related to role based access controls.
        All parameters are fullfilled by the data.  
        
        :param org: Organization Name
        :param perm_name: Permission name
        :param resource: Resource
        :param verbs: A tuple of verbs
        :returns: Pass or Fail for the test
        """

        sysapi = ApiTasks(mozwebqa)
        home_page = Home(mozwebqa)
        rolestab = RolesTab(mozwebqa)
        
        role_name = "role_%s" % (home_page.random_string())
        perm_name = "perm_%s" % (home_page.random_string())
        username = "user%s" % home_page.random_string()
        email = username + "@example.com"
        password = "redhat%s" % (home_page.random_string())
        
        sysapi.create_org(org)
        sysapi.create_user(username, password, email)
        
        home_page.login()
        
        home_page.tabs.click_tab("administration_tab")
        home_page.tabs.click_tab("roles_administration")
        home_page.click_new()
        rolestab.create_new_role(role_name)
        
        rolestab.click_role_permissions()
            
        rolestab.role_org(org).click()
        rolestab.click_add_permission()
        
        rolestab.select_resource_type(resource)
        home_page.click_next()
        for v in verbs:
            home_page.select('verbs', v)
        home_page.click_next()
        
        rolestab.enter_permission_name(perm_name)
        rolestab.enter_permission_desc('Added by QE test.')
        rolestab.click_permission_done()
        
        rolestab.click_root_roles()
        rolestab.click_role_users()
            
        rolestab.role_user(username).add_user()
        
        home_page.header.click_logout()
        home_page.login(username, password)
        
        for t in allowed:
            Assert.true(t(home_page))
        
        for t in disallowed:
            Assert.false(t(home_page))
        #home_page.header.click_logout()
开发者ID:eanxgeek,项目名称:katello_challenge,代码行数:63,代码来源:test_roles_datadriven.py


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