Notes
![]() ![]() Notes - notes.io |
# Author: Taha Tariq
# Purpose: To verify the document number mandatory and non-editable for the 'Enter Cash drop' transaction.
#############################################################################
def test_Accounting_Drops_CMP_DROP_001(bootstrap):
basePage = BasePage(bootstrap)
genericfunc = CmpGenericActions(bootstrap)
thome = ToolsHome(bootstrap)
security = Security(bootstrap)
login=CMPLoginPage(bootstrap)
phome = PlayerHome(bootstrap)
Ahome = Accounting(bootstrap)
enterCashDrop=EnterCashDrop(bootstrap)
voidCashDrop=VoidOpeningAmount(bootstrap)
dbOperationFunc=DbOperations(bootstrap)
storage=Storage(bootstrap)
geo=Geography(bootstrap)
#getting values from toml
getLocation=basePage.getData("Location")
getValues=basePage.getData("Values")
documentData=str(random.randrange(1000, 1000000))
remarks=str(random.randrange(1000, 1000000))
codeList = basePage.getData("CodeList")
action = basePage.getData("action")
choice=basePage.getData("choice")
dataValue=basePage.getData("dataValue")
keyName=basePage.getData("keyName")
keyData=basePage.getData("keyData")
dataValue2=basePage.getData("dataValue2")
keyName2=basePage.getData("keyName2")
keyData2=basePage.getData("keyData2")
dataValue3=basePage.getData("dataValue3")
keyName3=basePage.getData("keyName3")
keyData3=basePage.getData("keyData3")
localLocnCode = basePage.getData("LocalLocnCode")
locnName = basePage.getData("LocnName")
theorPercent = basePage.getData("TheorPercent")
minBet = basePage.getData("MinBet")
maxBet = basePage.getData("MaxBet")
locType = basePage.getData("LocType")
deptName = basePage.getData("Dept")
gameId = basePage.getData("GameId")
denomId = basePage.getData("DenomId")
penFills = basePage.getData("PenFills")
status = basePage.getData("Status")
status1 = basePage.getData("Status1")
# searchType=basePage.getData("SType")
# searchData=basePage.getData("SData")
casino = basePage.getData("Casino")
area = basePage.getData("Area")
localArCode = basePage.getData("localArCode")
arName = basePage.getData("ArName")
arType = basePage.getData("ArType")
arId = basePage.getData("ArId")
location2=basePage.getData("Locn")
###################################################
# PRECONDITION 1 #
###################################################
#Go to Player home
phome.goToPlayerHome()
# To verify if Player's Home is open
assert True == phome.verifyPlayerHome()
# #going to Tools Home Page
thome.goToToolsHome()
# #verify thome window
assert thome.verifyToolsHome() == True
#go to security page
genericfunc.jumpToScreensWithTree(constants.SECURITY)
# #Changing Security Code
security.changeMultipleSecurityCodes(action, codeList, constants.EMP_ROLE)
#logout and login to apply security changes
login.applicationLogout(constants.LOGOUT_VERIFY)
login.loginWithValidCredentials(constants.USERNAME,constants.PASSWORD,constants.LOGIN_LOCATION,constants.ENV)
###################################################
# PRECONDITION 2 #
###################################################
#fetchin records avaiable in tLocn table
tLocnData=dbOperationFunc.checkIfLocationExistInTLocn(constants.LOGIN_LOCATION)
#if locn doesn't exist in db then, creating it first here
if tLocnData==None:
#going to Tools Home Page
thome.goToToolsHome()
#Create New location
for localLocnCode1,locnName1 in zip(localLocnCode,locnName):
#Area and Location
thome.goToToolsHome()
#Jump to screen "Geography"
genericfunc.jumpToScreensWithTree(constants.GEOGRAPHY)
geo.goToGeography()
#Selecting the casino
geo.getCasinoValue(casino)
#geo.getAreaValue(area)
#creating new area
geo.createNewAreaForPrecondns(localArCode,arName,arType,arId)
#creates new location
geo.createNewLocationForPreconds(localLocnCode1,locnName1,theorPercent,minBet,maxBet,locType,deptName,gameId,denomId,penFills,status,status1)
#If the location is already created
if geo.btnCancelButton.IsVisible():
geo.clickBtnCancelButton()
#Go to Player home
phome.goToPlayerHome()
# To verify if Player's Home is open
assert True == phome.verifyPlayerHome()
#going to Tools Home Page
thome.goToToolsHome()
#go to Geography Page
genericfunc.jumpToScreensWithTree(constants.GEOGRAPHY)
geo.goToGeography()
#Selecting Casino
geo.getCasinoValue(casino)
geo.getAreaValue(area)
geo.getLocationValue(location2)
geo.clickOnModifyLocation()
geo.enterLocnType(locType)
geo.enterDeptId(deptName)
geo.enterGameId(gameId)
geo.checkIsMasterCheckbox()
geo.clickOnSubmit()
geo.clickYes()
geo.clickOK()
#checking if data in table is not null
assert tLocnData!=None
###################################################
# PRECONDITION 4 #
###################################################
#Go to Player home
phome.goToPlayerHome()
# To verify if Player's Home is open
assert True == phome.verifyPlayerHome()
# #going to Tools Home Page
thome.goToToolsHome()
# #verify thome window
assert thome.verifyToolsHome() == True
#go to security page
genericfunc.jumpToScreensWithTree(constants.STORAGE)
#selecting choice
storage.chooseSection(choice)
#updating multiple conditions
storage.updateDataVal(dataValue,keyName,keyData)
###################################################
# TEST STEP DESCRIPTION #
###################################################
#going to accounting home
Ahome.goToAccountingHome()
# To verify if Accounting's Home is open
assert True == Ahome.verifyAccountingHome()
#selcting Loction in Location Directory
Ahome.searchData(getLocation,constants.LOGIN_LOCATION)
#jumping to enter cash drop
genericfunc.jumpToScreens(constants.ENTER_CASHDROP_WINDOW)
#Entering amount
enterCashDrop.enterFirstAmount(getValues)
#entering remarks
enterCashDrop.enterRemarks(remarks)
#assertion if document required symbol is present on document field
isSymbolPresent=enterCashDrop.isDocumentRequiredSymbolVisible()==True
#assertion if document field is editable
isEditable=enterCashDrop.isDocumentEditable()==True
#clicking on submit button
genericfunc.smallSubmitForm()
#verifying ok Popup text is of document required
okPopupIsValid=genericfunc.verifyOkPopUpText()==constants.DOCUMENT_NO_IS_REQUIRED
#logging
basePage.logger.debug("ok popup text is: "+genericfunc.verifyOkPopUpText()+" to compare string is :"+constants.DOCUMENT_IS_REQUIRED)
#clicking ok
genericfunc.clickOK()
#clicking cancel
genericfunc.cmdCancel()
#asserting
assert True==Ahome.verifyAccountingHome()
###################################################
# PRECONDITION 3: to apply after step 1 #
###################################################
#Go to Player home
phome.goToPlayerHome()
# To verify if Player's Home is open
assert True == phome.verifyPlayerHome()
# #going to Tools Home Page
thome.goToToolsHome()
# #verify thome window
assert thome.verifyToolsHome() == True
#go to security page
genericfunc.jumpToScreensWithTree(constants.STORAGE)
#selecting choice
storage.chooseSection(choice)
#updating multiple conditions
storage.updateDataVal(dataValue2,keyName2,keyData2)
#Go to Player home
phome.goToPlayerHome()
# To verify if Player's Home is open
assert True == phome.verifyPlayerHome()
# #going to Tools Home Page
thome.goToToolsHome()
# #verify thome window
assert thome.verifyToolsHome() == True
#go to security page
genericfunc.jumpToScreensWithTree(constants.STORAGE)
#selecting choice
storage.chooseSection(choice)
#updating multiple conditions
storage.updateDataVal(dataValue3,keyName3,keyData3)
#verify if cashdrop documentType is present in tNumberMaster table
docType = dbOperationFunc.fetchDocType()
assert docType==constants.TNUM_CASHDROP
#going to accounting home
Ahome.goToAccountingHome()
# To verify if Accounting's Home is open
assert True == Ahome.verifyAccountingHome()
#selcting Loction in Location Directory
Ahome.searchData(getLocation,constants.LOGIN_LOCATION)
#jumping to enter cash drop
genericfunc.jumpToScreens(constants.ENTER_CASHDROP_WINDOW)
#Entering amount
enterCashDrop.enterFirstAmount(getValues)
#entering remarks
enterCashDrop.enterRemarks(remarks)
#saving the amount for assertion that it is posted
amount=float(Ahome.findTotal(4))
#assertion if document field is editable
isNonEditable=enterCashDrop.isDocumentEditable()==False
#clicking on submit button
genericfunc.smallSubmitForm()
#going to accounting home
Ahome.goToAccountingHome()
#verify accounting home
assert True==Ahome.verifyAccountingHome()
#selcting Loction in Location Directory
Ahome.searchData(getLocation,constants.LOGIN_LOCATION)
#jumping to void cash drop
genericfunc.jumpToScreens(constants.VOID_CASHDROP_WINDOW)
#finding document number of the latest drop to ensure auto generated
docNumber=voidCashDrop.getDocumentValue()
#finding the drop amount to ensure document is posted
dropAmount=float(voidCashDrop.getDropAmount())
#voiding second entry
voidCashDrop.updateVoidOpeningAmount2(remarks)
###################################################
# EXPECTED RESULTS #
###################################################
#Expected Result 1a: The warning message for the mandatory document number should be displayed.
assert okPopupIsValid==True
#Expected Result 1b: Mandatory symbol '*' should be displayed for the Document field and
# should be editable to enter the text.
assert isSymbolPresent==True
assert isEditable==True
#Expected Result 2a: Transaction should be posted and
# Document value should be generated automatically when the transaction is submitted.
assert float(amount)==float(dropAmount)
assert docNumber!=None
#Expected Result 2b:Text field for document should be non- editable
assert isNonEditable==True
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team