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


Python Helpers.getUniqueString方法代码示例

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


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

示例1: testFourLevelsMapping

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testFourLevelsMapping(self):
        self.testname="TestFourLevelsMapping"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        # mapping and un-mapping up to 3 levels: 
        # Program->Regulation->Section->Object
        titlePol = do.getUniqueString("policy")
        titlePrgm = do.getUniqueString("program")
        titleSec = do.getUniqueString("section")
        titleMkt = do.getUniqueString("policy")

        do.createObject("Policy", titlePol)
        do.createObject("Program", titlePrgm)
        do.mapAObjectWidget("Policy", titlePol)
        
        do.createObject("Market", titleMkt)         
        do.createObject("Section", titleSec)
        do.mapAObjectWidget("Market", titleMkt)
                  
        
        do.mapAObjectWidget("Section", titleSec)
开发者ID:amrishs,项目名称:ggrc-test,代码行数:29,代码来源:TestFourLevelsMapping.py

示例2: testCreatePersonProgramCreatorLogInOut

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testCreatePersonProgramCreatorLogInOut(self):
        self.testname="TestCreatePersonProgramCreatorLogInOut"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()
 
        aEmail = "auto_email_" + str(do.getRandomNumber(65535)) + "@gmail.com"
        aName = do.getUniqueString("name")
        aCompany = do.getUniqueString("company")
    
        do.selectMenuInTopRight("Admin Dashboard")
        do.selectMenuItemInnerNavDashBoard("People") 
        do.addPersonInAdminDB(aName, aEmail, aCompany)
        self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
    
            
        # edit person authorization
        do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
        do.clickOnEditAuthorization(aName)
        do.assignUserRole("ProgramCreator")
            
        # now log out and then log in with the new account and try to create a program
        oldEmail = "[email protected]"
        oldName = "Example User"
        absFilePath = expanduser("~") + "/ggrc-core/src/ggrc/login/noop.py"
        do.changeUsernameEmail(oldName, aName, oldEmail, aEmail, absFilePath)
        do.selectMenuInTopRight("Logout")
            
        # Refresh the page
        do.refresh()
            
        # Log in with new user
        do.login()
        print "Log in as : " + do.whoAmI()
        
        object_list = ["Program", "Workflow", "Audit", "Regulation", "Policy", "Standard", "Contract", "Clause", 
                       "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                       "Product", "Project", "Facility", "Market"]
        
        for object in object_list:
            
            # cannot create audit; it requires other non-system wide role
            if object == "Audit":          
                do.assertFalse(do.doesCreateNewExist(object), "Create New button exists for " + str(object))          
            else:
                do.assertTrue(do.doesCreateNewExist(object), "Create New button does not exist for " + str(object))
        
        # should be able to create a program object
        last_created_object_link = do.createObject("Program")
        object_name = str(do.util.getTextFromXpathString(last_created_object_link)).strip()
        self.assertTrue(do.partialMatch("program-auto-test", object_name), "Fail to match program name.")
        
        # Restore old login information
        do.changeUsernameEmail(aName, oldName, aEmail, oldEmail, absFilePath)
        do.selectMenuInTopRight("Logout")   
开发者ID:amrishs,项目名称:ggrc-test,代码行数:61,代码来源:TestCreatePersonProgramCreatorLogInOut.py

示例3: testRelevantStress

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testRelevantStress(self):
        self.testname="TestRelevantStress"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        titleContract = do.getUniqueString("contract")
        titleClause = do.getUniqueString("clause")
          
        print "Contract: " + titleContract
        print "Clause: " + titleClause
                       
        # SETUP        
        do.checkMyWorkBox() # show my objects only
        # Make sure we have at least 20 data assets already if not create them
        count = do.countOfAnyObjectLHS("Data")
        diff = 20 - count
        while diff > 0:
            id = do.getRandomNumber()            
            do.createObject("Data", "data_" + str(id))
            diff = diff - 1
            do.delay(5)
           
        # Map 20 data assets to Clause
        do.createObject("Clause", titleClause)   
        expandables = []   
        do.mapAObjectWidget("Data_Asset", "data_", False, expandables, 20)
           
        # Map a clause to contract
        do.createObject("Contract", titleContract)
         
        do.mapAObjectWidget("Clause", titleClause, False, ("Clause"), 1)         
        # expand it

        do.expandItemWidget("Clause", titleClause)
         
        # check the MakeAllRelevant checkbox
        do.makeAllRelevant(True)
        do.delay(120) 
        # switch to Data Asset tab
        do.selectInnerNavTab("data_asset")
        do.assertEqual(20, do.countOfAnyObjectInWidget("data_asset"), "Count is not 20 in Data Asset Widget.")
       
        # just select because it will maintain its expanded mode
        do.selectInnerNavTab("clause")  
        
        do.makeAllRelevant(False)
        do.delay(120) # takes time for the unmapping to complete
        
        # switch to Data Asset tab again
        do.selectInnerNavTab("data_asset")
        
        # if MAKE ALL RELEVANT checkbox is deselected, no data asset tab is shown and thus no count is shown either
        print "Continue to fail until CORE-890 is fixed."
        do.assertEqual(0, do.countOfAnyObjectInWidget("data_asset"), "Count is not 0 in Data Asset Widget.")
开发者ID:amrishs,项目名称:ggrc-test,代码行数:61,代码来源:TestRelevantStress.py

示例4: testCreatePersonNoAccessLogInOut

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testCreatePersonNoAccessLogInOut(self):
        self.testname="TestCreatePersonNoAccessLogInOut"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        aEmail = "auto_email_" + str(do.getRandomNumber(65535)) + "@gmail.com"
        aName = do.getUniqueString("name")
        aCompany = do.getUniqueString("company")
   
        do.selectMenuInTopRight("Admin Dashboard")
        do.selectMenuItemInnerNavDashBoard("People") 
        do.addPersonInAdminDB(aName, aEmail, aCompany)
        self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
   
           
        # edit person authorization
        do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
        do.clickOnEditAuthorization(aName)
        do.assignUserRole("No access")
           
        # now log out and then log in with the new account and try to create a program
        oldEmail = "[email protected]"
        oldName = "Example User"
        absFilePath = expanduser("~") + "/ggrc-core/src/ggrc/login/noop.py"
        do.changeUsernameEmail(oldName, aName, oldEmail, aEmail, absFilePath)
        do.selectMenuInTopRight("Logout")
           
        # Refresh the page
        do.refresh()
           
        # Log in with new user
        do.login()
        print "Log in as : " + do.whoAmI()
                
        object_list = ["Program", "Task", "Audit", "Regulation", "Policy", "Standard", "Contract", "Clause", 
                       "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                       "Product", "Project", "Facility", "Market"]
        
        # no Create New occurs
        for object in object_list:           
            do.navigateLHSMenu4NoAccess(object)
            do.assertFalse(do.doesThisElementExist(str(Elements.left_nav_object_section_add_button).replace("OBJECT", object), 8))
       
        # Restore old login information
        do.changeUsernameEmail(aName, oldName, aEmail, oldEmail, absFilePath)
        do.selectMenuInTopRight("Logout")     
开发者ID:amrishs,项目名称:ggrc-test,代码行数:53,代码来源:TestCreatePersonNoAccessLogInOut.py

示例5: testMapRegulationToSystem

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testMapRegulationToSystem(self):
        self.testname="TestMapRegulationToSystem"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        titleReg = do.getUniqueString("regulation")
        titleSys = do.getUniqueString("system")
        
        do.createObject("Regulation", titleReg)
        do.createObject("System", titleSys)       
        do.mapAObjectLHN("Regulation", titleReg)
开发者ID:amrishs,项目名称:ggrc-test,代码行数:18,代码来源:TestMapRegulationToSystem.py

示例6: testPersonCreate

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
 def testPersonCreate(self):
     self.testname="TestPersonCreate"
     self.setup()
     util = WebdriverUtilities()
     util.setDriver(self.driver)
     element = Elements()
     do = Helpers(self)
     do.setUtils(util)
     do.login()
     print "Log in as : " + do.whoAmI()
     
     number = str(do.getRandomNumber())
     aEmail = "auto_email_" + number + "@gmail.com"
     aName = do.getUniqueString("name")
     aCompany = do.getUniqueString("company")      
     do.createPersonLHN(aName, aEmail, aCompany)        
开发者ID:amrishs,项目名称:ggrc-test,代码行数:18,代码来源:TestPersonCreate.py

示例7: testMapSystemToPeople

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testMapSystemToPeople(self):
        self.testname="TestMapSystemToPeople"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        aEmail = "auto_email_" + str(do.getRandomNumber()) + "@gmail.com"
        aName = do.getUniqueString("name")
        aCompany = do.getUniqueString("company")
        
        titleSys = do.getUniqueString("system")        
        do.createObject("System", titleSys)
        
        do.createPersonLHN(aName, aEmail, aCompany)
        do.mapAObjectLHN("System", titleSys)
开发者ID:amrishs,项目名称:ggrc-test,代码行数:21,代码来源:TestMapSystemToPeople.py

示例8: testCreatePersonObjectEditorLogInOut

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testCreatePersonObjectEditorLogInOut(self):
        self.testname="TestCreatePersonObjectEditorLogInOut"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        # ***************************** run this block of codes if run locally *****************************
        if "localhost" in config.url:
            print "Executing the block of codes locally ..."
            aEmail = "auto_email_" + str(do.getRandomNumber(65535)) + "@gmail.com"
            aName = do.getUniqueString("name")
            aCompany = do.getUniqueString("company")
       
            do.selectMenuInTopRight("Admin Dashboard")
            do.selectMenuItemInnerNavDashBoard("People") 
            do.addPersonInAdminDB(aName, aEmail, aCompany)
            self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
       
               
            # edit person authorization
            do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
            do.clickOnEditAuthorization(aName)
            do.assignUserRole("ObjectEditor")
               
            # now log out and then log in with the new account and try to create a program
            oldEmail = "Example user"
            oldName = "[email protected]"
            absFilePath = expanduser("~") + "/ggrc-core/src/ggrc/login/noop.py"
            do.changeUsernameEmail(oldName, aName, oldEmail, aEmail, absFilePath)
            do.selectMenuInTopRight("Logout")
               
            # Refresh the page
            do.refresh()
               
            # Log in with new user
            do.login()
            print "Log in as : " + do.whoAmI()
            
            object_list = ["Workflow", "Vendor", "Regulation", "Policy", "Standard", "Contract", "Clause", "Section",
                           "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                           "Product", "Project", "Facility", "Market", "Program", "Audit"]
            
            # since it's an object editor role, the Create New button won't show for certain types
            for object in object_list:
                
                if object=="Program" or object=="Audit":
                    do.assertFalse(do.doesCreateNewExist(object), "Create New button exists for " + str(object))
                else:
                    do.assertTrue(do.doesCreateNewExist(object), "Create New button does not exist for " + str(object))
            
            # should be able to create an object that is not Program or Audit
            last_created_object_link = do.createObject("Contract")
            object_name = str(do.util.getTextFromXpathString(last_created_object_link)).strip()
            self.assertTrue(do.partialMatch("contract-auto-test", object_name), "Fail to match contract name.")
            
            # Restore old login information
            do.changeUsernameEmail(aName, oldName, aEmail, oldEmail, absFilePath)
            do.selectMenuInTopRight("Logout")  
        #   ******************* execute this else block of codes if not run locally *******************
        else: 
            print "Executing the block of codes for non-local ..."
            aEmail = config.editor2
            aName = do.getUniqueString("name")
            aCompany = do.getUniqueString("company")
       
            do.selectMenuInTopRight("Admin Dashboard")
            do.selectMenuItemInnerNavDashBoard("People") 
            do.addPersonInAdminDB(aName, aEmail, aCompany)
            self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
                     
            # edit person authorization
            do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
            do.clickOnEditAuthorization(aName)
            do.assignUserRole("ObjectEditor")
               
            # now log out and then log in with the new account and try to create a program
            do.selectMenuInTopRight("Logout")
               
            # Refresh the page
            do.refresh()
               
            # Log in with new user
            do.login(aEmail, config.password)
            print "Log in as : " + do.whoAmI()
            
            object_list = ["Workflow", "Vendor", "Regulation", "Policy", "Standard", "Contract", "Clause", "Section",
                           "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                           "Product", "Project", "Facility", "Market", "Program", "Audit"]
            
            # since it's an object editor role, the Create New button won't show for certain types
            
            for object in object_list:
                
                do.ensureLHNSectionExpanded(object)
                
                if object=="Program" or object=="Audit":
#.........这里部分代码省略.........
开发者ID:amrishs,项目名称:ggrc-test,代码行数:103,代码来源:TestCreatePersonObjectEditorLogInOut.py

示例9: testCreatePersonReaderLogInOut

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testCreatePersonReaderLogInOut(self):
        self.testname="TestCreatePersonReaderLogInOut"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        # run this block of codes if run locally
        if "localhost" in config.url:
            print "Executing the block of codes locally ..."
            aEmail = "auto_email_" + str(do.getRandomNumber(65535)) + "@gmail.com"
            aName = do.getUniqueString("name")
            aCompany = do.getUniqueString("company")
      
            do.selectMenuInTopRight("Admin Dashboard")
            do.selectMenuItemInnerNavDashBoard("People") 
            do.addPersonInAdminDB(aName, aEmail, aCompany)
            self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
      
              
            # edit person authorization
            do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
            do.clickOnEditAuthorization(aName)
            do.assignUserRole("Reader")
              
            # now log out and then log in with the new account and try to create a program
            oldEmail = "[email protected]"
            oldName = "Example User"
            absFilePath = expanduser("~") + "/ggrc-core/src/ggrc/login/noop.py"
            do.changeUsernameEmail(oldName, aName, oldEmail, aEmail, absFilePath)
            do.selectMenuInTopRight("Logout")
              
            # Refresh the page
            do.refresh()
              
            # Log in with new user
            do.login()
            print "Log in as : " + do.whoAmI()
            
            object_list = ["Vendor", "Regulation", "Policy", "Standard", "Contract", "Clause", "Section",
                           "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                           "Product", "Project", "Facility", "Market", "Program", "Audit"]
            
            # since it's a reader role, the Create New button won't show
            for object in object_list:
                do.assertFalse(do.doesCreateNewExist(object), "Create New button exists for " + str(object))
     
            print "hi"
            
            # Restore old login information
            do.changeUsernameEmail(aName, oldName, aEmail, oldEmail, absFilePath)
            do.selectMenuInTopRight("Logout")
        else:
            print "Executing the block of codes for non-local ..."            
            aEmail = config.reader2
            aName = do.getUniqueString("name")
            aCompany = do.getUniqueString("company")
      
            do.selectMenuInTopRight("Admin Dashboard")
            do.selectMenuItemInnerNavDashBoard("People") 
            do.addPersonInAdminDB(aName, aEmail, aCompany)
            self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
      
              
            # edit person authorization
            do.selectMenuItemInnerNavDashBoard("People") # on the roles selection      
            do.clickOnEditAuthorization(aName)
            do.assignUserRole("Reader")
              
            # now log out and then log in with the new account and try to create a program
            do.selectMenuInTopRight("Logout")
              
            # Refresh the page
            do.refresh()
              
            # Log in with new user
            do.login(aEmail, config.same_password)
            print "Log in as : " + do.whoAmI()
            
            # Workflow is left out on purpose because Create New is there but reader can't create object anyway
            object_list = ["Vendor", "Regulation", "Policy", "Standard", "Contract", "Clause", "Section",
                           "Section", "Objective", "Control", "Person", "OrgGroup", "System","Process", "DataAsset",
                           "Product", "Project", "Facility", "Market", "Program", "Audit"]
            
            # since it's a reader role, the Create New button won't show
            for object in object_list:
                do.ensureLHNSectionExpanded(object)
                do.assertFalse(do.doesCreateNewExist(object), "Create New button exists for " + str(object))          
开发者ID:amrishs,项目名称:ggrc-test,代码行数:93,代码来源:TestCreatePersonReaderLogInOut.py

示例10: testCreatePersonAuthorizationLogInOut

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testCreatePersonAuthorizationLogInOut(self):
        self.testname="TestCreatePersonAuthorizationLogInOut"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()      

        aEmail = "[email protected]"
        aName = do.getUniqueString("name")
        aCompany = do.getUniqueString("company")
        role = "ProgramCreator"
  
        do.selectMenuInTopRight("Admin Dashboard")
         
        # verify people tab
        do.selectMenuItemInnerNavDashBoard("People")
         
        # SETUP: if that email is already used change it to something else
        do.zeroizeThePersonEmail(aEmail)
           
        # you can add a person 
        do.addPersonInAdminDB(aName, aEmail, aCompany)
           
        # the Next and PREVIOUS page buttons work
        self.assertTrue(do.verifyPrevNextOperation("people"), "Fail verifying Prev and Next buttons.")
          
        # search or filter works
        self.assertTrue(do.searchPersonInAdminDB(aName), "Fail searching for newly created person in Admin Dashboard.")
           
        # edit person authorization    
        do.clickOnEditAuthorization(aName)
        do.assignUserRole(role)
        
        # at this point, 2nd tier is expanded and it's the only row displayed...
        do.verifyPersonInfoOnSecondTier(aName, aEmail, aCompany, role)

        if 'local' not in config.url:
            do.selectMenuInTopRight("Logout")
            do.refresh()
            do.login(aEmail, config.password)
            self.assertEqual(aEmail, do.whoAmI(), "Expect: " + aEmail + ", but see: " + do.whoAmI())
            
        # I can test login with the new user locally but not on on grc-test.appspot.com because it requires actual email
        # and that email has to be unique.  I can't automatically create new fake email account with google that's fraud            
        else:
            oldEmail = "[email protected]"
            oldName = "Example User"
            absFilePath = expanduser("~") + "/ggrc-core/src/ggrc/login/noop.py"
            do.changeUsernameEmail(oldName, aName, oldEmail, aEmail, absFilePath)            
            
            # now log out and then log in with the new account and try to create a program
            do.selectMenuInTopRight("Logout")
            
            # Refresh the page
            do.refresh()
              
            # Log back in
            do.login()
            print "Log in as : " + do.whoAmI()
            last_created_object_link = do.createObject("Program")
            object_name = str(do.util.getTextFromXpathString(last_created_object_link)).strip()
            self.assertTrue(do.partialMatch("program-auto-test", object_name), "Fail to match program name.")
            self.assertEqual(do.whoAmI(), aEmail, "Mismatched. I am: " + do.whoAmI() + ", " + "aEmail: " + aEmail)
            do.selectMenuInTopRight("Logout") 
     
            # Restore old login information
            do.changeUsernameEmail(aName, oldName, aEmail, oldEmail, absFilePath)
开发者ID:amrishs,项目名称:ggrc-test,代码行数:72,代码来源:TestCreatePersonAuthorizationLogInOut.py

示例11: testRelevantMapping

# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import getUniqueString [as 别名]
    def testRelevantMapping(self):
        self.testname="TestRelevantMapping"
        self.setup()
        util = WebdriverUtilities()
        util.setDriver(self.driver)
        element = Elements()
        do = Helpers(self)
        do.setUtils(util)
        do.login()

        # mapping and un-mapping up to 3 levels: 
        # Program->Policy->Section->Object
        titlePol = do.getUniqueString("policy") #regulation
        titlePrgm = do.getUniqueString("program")
        titleSec = do.getUniqueString("section")
        titleMkt = do.getUniqueString("market")
       
        print "Policy: " + titlePol
        print "Program: " + titlePrgm
        print "Section: " + titleSec
        print "Market: " + titleMkt
                    
        # SETUP
        do.createObject("Market", titleMkt) 
        do.createObject("Policy", titlePol)  
        last_created_object_link = do.createObject("Program", titlePrgm)
        do.mapAObjectLHN("Policy", titlePol)  # maps to a Policy object
        do.expandItemWidget("Policy", titlePol)  # expand the item so that "+ Section" link is displayed
        do.createSectionFromInnerNavLink(titleSec)
        do.mapObjectToSectionFromInnerNav(titleSec)
        do.mapObjectFormFilling("Market", titleMkt)
        do.expandWidget4thTier(titleMkt)
        
        # Policy page
        do.navigateToObjectWithSearch(titlePol, "Policy")
        do.navigateToInnerNavSection("Market")
        do.assertEqual(0, do.countOfAnyObjectInWidget("market"), "Count is not 0 in Widget.")
        do.assertEqual(0, do.countOfAnyObjectInnerNav("market"), "Count is not 0 in InnerNav.")
         
        # Verification: you don't see person object from Program page
        # 1 because the creator is automatically mapped to the program
        do.navigateToObjectWithSearch(titlePrgm, "Program")
        do.navigateToInnerNavSection("Market")
        do.assertEqual(1, do.countOfAnyObjectInWidget("market"), "Count is not 1 in Widget.")
        do.assertEqual(1, do.countOfAnyObjectInnerNav("market"), "Count is not 1 in InnerNav.")  
    
        # Verification: you see Market object in Section page
        do.navigateToObjectWithSearch(titleSec, "Section")
        do.navigateToInnerNavSection("Market")
        do.assertEqual(titleMkt, do.getTitleFromWidgetList(1, "Section"))
        do.assertEqual(1, do.countOfAnyObjectInWidget("market"), "Count is not 1 in Widget.")
        do.assertEqual(1, do.countOfAnyObjectInnerNav("market"), "Count is not 1 in InnerNav.") 
         
        # Verification: you see section object from People page
        do.uncheckMyWorkBox()        
        do.navigateToObjectWithSearch(titleMkt, "Market")
        do.navigateToInnerNavSection("Section")
        do.assertEqual(titleSec, do.getTitleFromWidgetList(1, "Market")) #STOP HERE
        do.assertEqual(1, do.countOfAnyObjectInWidget("section"), "Count is not 1 in Widget.")
        do.assertEqual(1, do.countOfAnyObjectInnerNav("section"), "Count is not 1 in InnerNav.") 

        # **** Test making person object relevant and verify its effect **************************
        do.navigateToObjectWithSearch(titlePol, "Regulation")
        
        # Before making it relevant
        do.navigateToInnerNavSection("Person")
        do.assertEqual(0, do.countOfAnyObjectInWidget("person"), "Count is not 0 in Widget.")
        do.assertEqual(0, do.countOfAnyObjectInnerNav("person"), "Count is not 0 in InnerNav.")
        
        do.navigateToInnerNavSection("Section")
        do.expandItemWidget("Section", titleSec)  # expand the item so that "+ Section" link is displayed
        do._searchObjectIn3rdLevelAndClickOnIt(titleMkt, True)
        do.expandWidget4thTier(titleMkt, True)

        # Verification: you now see person object from Regulation page
        do.navigateToInnerNavSection("Person")
        do.assertEqual(1, do.countOfAnyObjectInWidget("person"), "Count is not 1 in Widget.")
        do.assertEqual(1, do.countOfAnyObjectInnerNav("person"), "Count is not 1 in InnerNav.")

        # Verification: you don't see person object from Program page
        # 1 because the creator is automatically mapped to the program
        do.navigateToObjectWithSearch(titlePrgm, "Program")
        do.navigateToInnerNavSection("Person")
        do.assertEqual(1, do.countOfAnyObjectInWidget("person"), "Count is not 1 in Widget.")
        do.assertEqual(1, do.countOfAnyObjectInnerNav("person"), "Count is not 1 in InnerNav.")  

        # Verification: regulation object appears in the widget on People page
        do.navigateToObjectWithSearch(titleMkt, "Person")
        do.navigateToInnerNavSection("regulation")
        
        title_fr_widget = do.getTitleFromWidgetList(1, "Person")
        do.assertEqual(titlePol, title_fr_widget, "Titles do match.")
开发者ID:amrishs,项目名称:ggrc-test,代码行数:94,代码来源:TestRelevantMapping.py


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