本文整理汇总了Python中helpers.Helpers.Helpers.verifyPeopleExportFile方法的典型用法代码示例。如果您正苦于以下问题:Python Helpers.verifyPeopleExportFile方法的具体用法?Python Helpers.verifyPeopleExportFile怎么用?Python Helpers.verifyPeopleExportFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.Helpers.Helpers
的用法示例。
在下文中一共展示了Helpers.verifyPeopleExportFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testImportExportPeople
# 需要导入模块: from helpers.Helpers import Helpers [as 别名]
# 或者: from helpers.Helpers.Helpers import verifyPeopleExportFile [as 别名]
def testImportExportPeople(self):
self.testname="TestImportExportPeople"
self.setup()
util = WebdriverUtilities()
util.setDriver(self.driver)
do = Helpers(self)
do.setUtils(util)
do.login()
# create a person
number = str(do.getRandomNumber())
aEmail = "email" + number + "@gmail.com"
aName = "name" + number
aCompany = "company" + number
do.createPersonLHN(aName, aEmail, aCompany)
do.uncheckMyWorkBox()
do.navigateToObjectWithSearch(aName, "Person")
print ""
print "On screen."
print "User is displayed as : " + aName
print "Email is displayed as : " + aEmail
print "Company is displayed as : " + aCompany
# export people
filePath = config.test_db + "PEOPLE.csv"
print filePath
do.selectMenuInTopRight("Admin Dashboard")
do.exportFile("people", filePath)
# verify that information in file matched
self.assertTrue(do.verifyPeopleExportFile(aName, aEmail, aCompany, filePath), "User not found in exported file.")
# import people
# create some data, add it to the import file and upload
number = str(do.getRandomNumber())
aEmail = "emailImport" + number + "@gmail.com"
aName = "nameImport" + number
aCompany = "companyImport" + number
print ""
print "Add this new user info to the import file and upload."
print "User name: " + aName
print "Email: " + aEmail
print "Company: " + aCompany
userInfo = aName + "," + aEmail + "," + aCompany
# proof: verify that this user never exist in the database
do.navigateToObjectWithSearchWithNoAssertion(aName, "Person")
count = do.countOfAnyObjectLHS("Person")
self.assertEqual(0, count, "User " + aName + " is verified not existed.")
do.appendToFile(userInfo, filePath)
do.importFile("People", filePath)
do.refresh()
# after import, verify that user has been added to the database
do.navigateToObjectWithSearch(aName, "Person")
count = do.countOfAnyObjectLHS("Person")
self.assertEqual(1, count, "User " + aName + " is verified not existed.")
self.assertEqual(aName, do.getObjectNavWidgetInfo("username"), "User's name " + aName + " is not found in the database.")
self.assertEqual(aEmail, do.getObjectNavWidgetInfo("email"), "User's email " + aEmail + " is not found in the database.")
self.assertEqual(aCompany, do.getObjectNavWidgetInfo("company"), "User's company " + aCompany + " is not found in the database.")
print ""
print "User is imported successfully and found in the database."
print aName + "," + aEmail + "," + aCompany