本文整理汇总了Python中helpers.Helpers.Helpers.verifyPrevNextOperation方法的典型用法代码示例。如果您正苦于以下问题:Python Helpers.verifyPrevNextOperation方法的具体用法?Python Helpers.verifyPrevNextOperation怎么用?Python Helpers.verifyPrevNextOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.Helpers.Helpers
的用法示例。
在下文中一共展示了Helpers.verifyPrevNextOperation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEventLog
# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import verifyPrevNextOperation [as 别名]
def testEventLog(self):
self.testname="TestEventLog"
self.setup()
util = WebdriverUtilities()
util.setDriver(self.driver)
element = Elements()
grcobject = GRCObject()
do = Helpers(self)
do.setUtils(util)
do.login()
# CREATE PROGRAM
program_name = "Program_created_from_LHN" + do.getTimeId()
object_list = ["Regulation", "Contract", "Policy", "Standard"]
last_created_object_link = do.createObject("Program", program_name)
# MAP SOME OBJECTS
for obj in object_list:
do.mapAObjectLHN(obj, program_name)
#do.selectInnerTabWhichAlreadyPresent("info")
do.selectInnerNavTab("info")
do.openObjectEditWindow()
do.deleteObject()
do.selectMenuInTopRight("Admin Dashboard")
do.selectMenuItemInnerNavDashBoard("Events")
# when delete an object that has mapping, it automatically unmap and then delete
self.assertTrue(do.verifyInfoInEventLogTable("unmapped from", 1), "Cannot find 'unmapped from Program' in the Event Log table.")
# 4 times
# 4 lines of "mapped to" because there are 4 mappings from the top
self.assertTrue(do.verifyInfoInEventLogTable("mapped to", 2), "Cannot find 'map to:row2' in the Event Log table.")
self.assertTrue(do.verifyInfoInEventLogTable("mapped to", 3), "Cannot find 'map to:row3' in the Event Log table.")
self.assertTrue(do.verifyInfoInEventLogTable("mapped to", 4), "Cannot find 'map to:row4' in the Event Log table.")
self.assertTrue(do.verifyInfoInEventLogTable("mapped to", 5), "Cannot find 'map to:row5' in the Event Log table.")
# tests the "by whom" and "when at" fields
self.assertTrue(do.verifyInfoInEventLogTable("whom", 2), "Cannot find 'whom' in the Event Log table.")
self.assertTrue(do.verifyInfoInEventLogTable("when", 2), "Cannot find 'when' in the Event Log table.")
# the program created should be logged
self.assertTrue(do.verifyInfoInEventLogTable(program_name, 6), "Cannot find 'create program' in the Event Log table.")
# verify that Prev and Next buttons work
self.assertTrue(do.verifyPrevNextOperation(), "Fail verifying Prev and Next buttons.")
# CORE-727
print "CORE-727 is still open which causes this failure."
示例2: testCreatePersonAuthorizationLogInOut
# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import verifyPrevNextOperation [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)