Notes
Notes - notes.io |
from sg_mutate.pytest_gsapython.ElementFactory import WindowElement
import Library.Constants as con
from Library.CmpGenericActions import CmpGenericActions
from time import sleep
import re
from re import sub
from decimal import Decimal
import datetime
from datetime import datetime, timedelta,date
class TransactionHistory(WindowBasePage):
# elements
casinoBox=WindowElement.BaseElement(auto_id="1001",control_type="Edit")
historyTab=WindowElement.BaseElement(title="&1. History",control_type="TabItem")
cageTotalTab=WindowElement.BaseElement(title="&4. Cage Totals",control_type="TabItem")
tenderTab=WindowElement.BaseElement(title="&2. Tendered",control_type="TabItem")
remarksCageTotalEle=WindowElement.BaseElement(title="Ref1",control_type="DataItem")
startGamingDateEle=WindowElement.TextBox(title="To Gaming Date:",auto_id="txtStartDt")
endGamingDateEle=WindowElement.TextBox(title="Dept:",auto_id="txtEndDt")
docTextBox=WindowElement.TextBox(auto_id="txtDocument",control_type="Edit")
#actions
#Author : Taha Tariq
#Purpose : clicking on cage total tab
def clickOnCageTotal(self):
self.cageTotalTab.WaitForVisible()
self.cageTotalTab.ClickInput()
self.logger.debug("clicked on cage total tab")
#Author : Taha Tariq
#Purpose : clicking on history tab
def clickOnHistoryTab(self):
self.historyTab.WaitForVisible()
self.historyTab.ClickInput()
self.logger.debug("clicked on historyTab")
#Author : Taha Tariq
#Purpose :clicking on Tender tab
def clickOnTenderTab(self):
self.tenderTab.WaitForVisible()
self.tenderTab.ClickInput()
self.logger.debug("clicked on Tender Tab")
#Author : Taha Tariq
#Purpose : find the sum of all the cashdrop values in
def getCashDropSum(self,numberOfVals):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
amount=0
for i in range(numberOfVals):
mainPane = driver.top_window().child_window(title="UCrAmt", control_type="DataItem",found_index=i)
self.logger.info(mainPane.legacy_properties()['Value'])
value=str(mainPane.legacy_properties()['Value'])
self.logger.debug(str(value))
val=str(value.split(' ')[1])
self.logger.debug(str(val))
val2=self.convertCurrencyToDecimal(val)
amount+=float(val2)
self.logger.debug("total amount is : "+str(amount))
return str(amount)
#Author : Taha Tariq
#Purpose : convert currency string to decimal
def convertCurrencyToDecimal(self,currency):
value = Decimal(sub(r'[^d.]', '', currency))
self.logger.debug("currency value is: "+currency+" decimal value is: "+str(value))
return str(value)
#Author : Taha Tariq
#Purpose: entering value in from gaming date
def enterFromGamingdateField(self,val):
self.startGamingDateEle.WaitForVisible()
self.startGamingDateEle.DoubleClick()
self.startGamingDateEle.SendKeystrokes('{LEFT}')
self.startGamingDateEle.SendKeystrokes('{LEFT}')
self.startGamingDateEle.EnterText("27-01-2023")
self.startGamingDateEle.DoubleClick()
self.startGamingDateEle.SendKeystrokes('{LEFT}')
self.startGamingDateEle.SendKeystrokes('{LEFT}')
self.startGamingDateEle.EnterText(val)
self.logger.debug("Start date is : "+str(val))
#Author : Taha Tariq
#Purpose: entering value in to gaming date
def enterToGamingdateField(self,val):
self.endGamingDateEle.WaitForVisible()
self.endGamingDateEle.SendKeystrokes('{LEFT}')
self.endGamingDateEle.SendKeystrokes('{LEFT}')
self.endGamingDateEle.EnterText("27-01-2023")
self.endGamingDateEle.DoubleClick()
self.endGamingDateEle.SendKeystrokes('{LEFT}')
self.endGamingDateEle.SendKeystrokes('{LEFT}')
self.endGamingDateEle.EnterText(val)
self.logger.debug("end date is : "+str(val))
#Author : Taha Tariq
#Purpose : To get the subtitle details of tendered tab "txtPage2Subtitle"
def getTenderTabDocName(self):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(auto_id="txtPage2Subtitle",control_type="Text",found_index=0)
self.logger.info(mainPane.legacy_properties()['Name'])
value=str(mainPane.legacy_properties()['Name'])
val=str(value.split(' ')[1])
return str(val)
#Author : Taha Tariq
#Purpose : To get the total cashdrop details of cagetotal tab
def getCageTotalTabTotalCashdrop(self):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(auto_id="txtSumCashDrop",control_type="Edit",found_index=0)
self.logger.info(mainPane.legacy_properties()['Value'])
value=str(mainPane.legacy_properties()['Value'])
return str(self.convertCurrencyToDecimal(str(value)))
--------------
#Close Voucher Window
def closeVoucherWindow(self):
driver = self.testCache.driver_service.getDriver('CMPAPP')
close = driver.top_window().child_window(title = "Close", control_type = "Button",found_index=0)
self.sleep(20)
close.click_input()
self.logger.debug("Closed Voucher Window")
#Verify Zoom ComboBox
def verifyVoucher(self):
self.zoomButton.WaitForVisible()
status = self.zoomButton.IsVisible()
self.logger.debug("Voucher is diplayed : "+str(status))
return status
#V
def fetchHistoryData(self):
self.historyTab.WaitForVisible()
status = self.historyTab.IsVisible()
self.logger.debug("Voucher is diplayed : "+str(status)+self.TransHistoryDetails.GetWindowText())
return status
#Author : Taha Tariq
#Purpose : To find the value of Total Tab in Accounting drop window
def findTotal(self,index1based):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(title="Amount", control_type="DataItem",found_index=index1based)
self.logger.info(mainPane.legacy_properties()['Value'])
value=mainPane.legacy_properties()['Value']
self.logger.debug("total amount is : "+str(value))
return self.convertCurrencyToDecimal(str(value))
#Author : Taha Tariq
#Purpose : find the sum of all the input values in Accounting drops
def findAmount(self,numberOfVals):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
amount=0
for i in range(numberOfVals):
mainPane = driver.top_window().child_window(title="Amount", control_type="DataItem",found_index=i)
self.logger.info(mainPane.legacy_properties()['Value'])
value=mainPane.legacy_properties()['Value']
amount+=float(self.convertCurrencyToDecimal(value))
self.logger.debug("total amount is : "+str(amount))
return str(amount)
#Author : Taha Tariq
#Purpose : convert currency string to decimal
def convertCurrencyToDecimal(self,currency):
value = Decimal(sub(r'[^d.]', '', currency))
self.logger.debug("currency value is: "+currency+" decimal value is: "+str(value))
return str(value)
#Author : Umesh
#Purpose : getting future date with difference as day
def getFutureDate(self,day):
given_date=date.today()
dtObj = datetime.strptime(str(given_date), '%Y-%m-%d')
future_date = dtObj + timedelta(days=day)
banExpire = future_date.strftime('%d-%m-%Y')
self.logger.debug("Get Future time : "+str(banExpire))
future_date=str(future_date)
return str(banExpire),str(future_date[0:10])
#Author : Taha
#Purpose : getting past date with day difference as day
def getPastDate(self,day):
pastDate=date.today()-timedelta(days=day)
pastDateInStr=pastDate.strftime('%d-%m-%Y')
self.logger.debug("date in past is: "+pastDateInStr)
return pastDateInStr
#Author : Taha
#Purpose : to convert date from dd-mm-yyyy to yyyy-dd-mm
def convertToyyyyDate(self,dateStr):
date_obj = datetime.strptime(dateStr, '%d-%m-%Y')
newDateStr = date_obj.strftime('%Y-%d-%m')
return newDateStr
#Author : Taha
#Purpose : Getting curr date in str
def getCurrDate(self):
today=date.today()
todayInStr=today.strftime('%d-%m-%Y')
self.logger.debug("date in past is: "+todayInStr)
return todayInStr
def verifyEnterMarkerDropChipWindow(self):
visib = False
if self.extraTextBox.IsVisible():
visib= True
return visib
def findTitle(self):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(control_type="TitleBar",auto_id="TitleBar")
self.logger.info(mainPane.legacy_properties()['Value'])
value=mainPane.legacy_properties()['Value']
self.logger.debug("title is : "+str(value))
return value
#Author : Taha Tariq
#Purpose : To get the drop already exists msg
def dropAlreadyExistsMessage(self,dropName,today):
msgText=dropName+" already posted for Locn XXX-XBOOTH Gaming Date "+today+" Shift 1; void previous transaction(s) first."
return msgText
def getCurrentRow(self):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(auto_id="txtRecordCount",control_type="Edit",found_index=0)
self.logger.info(mainPane.legacy_properties()['Value'])
value=mainPane.legacy_properties()['Value']
self.logger.debug("total val of curr row is : "+str(value))
return int(value)-1
def getPointerLocn(self):
row=self.getCurrentRow()
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(control_type="DataItem",title="Location",found_index=row)
self.logger.info(mainPane.legacy_properties()['Value'])
value=mainPane.legacy_properties()['Value']
self.logger.debug("curr location is : "+str(value))
return str(value)
def findDropWindowLocation(self):
driver = self.testCache.driver_service.getDriver(con.CMPAPP_DRIVER)
mainPane = driver.top_window().child_window(control_type="Text",auto_id="txtLocnID",found_index=0)
self.logger.info(mainPane.legacy_properties()['Name'])
value=mainPane.legacy_properties()['Name']
self.logger.debug("curr location is : "+str(value))
return str(value)
def verifyECashDropWindow(self):
visib=False
if self.extraTextBox1.IsVisible():
visib= True
return visib
-----------------
from sg_mutate.pytest_gsapython.basePage import WindowBasePage
from sg_mutate.pytest_gsapython.ElementFactory import WindowElement
from Library.CmpGenericActions import CmpGenericActions
from time import sleep
import Library.Constants as constants
class Fill(WindowBasePage):
#Elements
pendingTab =WindowElement.BaseElement(title="P&ending",control_type="TabItem")
tenderTab =WindowElement.BaseElement(title="Te&nder",control_type="TabItem")
confirmpendingTab =WindowElement.BaseElement(title="C&onfirm Pendings",control_type="TabItem")
houseCheck = WindowElement.TextBox(title="Amount", control_type = "DataItem" ,found_index=0)
remarks = WindowElement.TextBox(title="Remarks:", control_type="Edit",auto_id = "txtRef2")
betsButton = WindowElement.Button(title="Bets:", control_type="Text",auto_id = "txtMinMaxBets_Label")
submitButton = WindowElement.Button(auto_id="cmdSubmit", control_type="Button")
cancelButton = WindowElement.Button(auto_id="cmdCancel", control_type="Button")
yesPopUpButton = WindowElement.Button(title = "Yes" ,control_type="Button", auto_id="6")
OKButton = WindowElement.Button(title ="OK",control_type="Button")
selectDocFirstRow=WindowElement.BaseElement(title="Document Row 0, Not sorted.",control_type="Edit")
selectAmountRow=WindowElement.BaseElement(title="Fill Amt Row 0, Not sorted.",control_type="Edit")
document = WindowElement.TextBox(auto_id="txtDocument",control_type="Edit")
#Actions
#Open Pending Tab
def openPendingsTab(self):
self.pendingTab.WaitForVisible()
self.pendingTab.ClickInput()
self.logger.debug("Pending Tab Opened")
#Open Tender Tab
def openTenderTab(self):
self.tenderTab.WaitForVisible()
self.tenderTab.ClickInput()
self.logger.debug("Tender Tab Opened")
#Open Confirm Tab
def openConfirmTab(self):
self.confirmpendingTab.WaitForVisible()
self.confirmpendingTab.ClickInput()
self.logger.debug("Confirm Tab Opened")
#selecting first row
def selectFirstRow(self):
self.selectDocFirstRow.WaitForVisible()
self.selectDocFirstRow.ClickInput()
self.logger.debug("select first Row")
#To Verify "Record Opening Amount" Window is opened
def verifyWindowOpen(self):
self.pendingTab.WaitForVisible()
status = self.pendingTab.IsVisible()
self.logger.debug("'Credit' Window is opened : "+ str(status))
return status
#Close Voucher Window
def closeVoucherWindow(self):
driver = self.testCache.driver_service.getDriver('CMPAPP')
close = driver.top_window().child_window(title = "Close", control_type = "Button",found_index=0)
close.click_input()
self.logger.debug("Closed Voucher Window")
#select the amount row
def AmountRow(self):
self.selectAmountRow.WaitForVisible()
self.selectAmountRow.ClickInput()
self.logger.debug("select first Row")
#to click on cancel button
def clickOnCancelBtn(self):
self.cancelButton.WaitForVisible()
self.cancelButton.ClickInput()
self.logger.debug("Clicked on cancel button")
#to click on submit button
def clickOnSubmitBtn(self):
self.submitButton.WaitForVisible()
self.submitButton.ClickInput()
self.logger.debug("Clicked on submit button")
#to enter the value of document
def enterDocument(self,document):
self.document.WaitForVisible()
self.document.ClickInput()
self.document.EnterText(document)
self.logger.debug("Document entered as :"+document)
====
from sg_mutate.pytest_gsapython.basePage import WindowBasePage
from sg_mutate.pytest_gsapython.ElementFactory import WindowElement
from Library.CmpGenericActions import CmpGenericActions
from time import sleep
import Library.Constants as constants
class RecordOpeningAmount(WindowBasePage):
#Elements
houseCheck = WindowElement.TextBox(title="Amount", control_type = "DataItem" ,found_index=0)
remarks = WindowElement.TextBox(title="Remarks:", control_type="Edit",auto_id = "txtRef2")
betsButton = WindowElement.Button(title="Bets:", control_type="Text",auto_id = "txtMinMaxBets_Label")
submitButton = WindowElement.Button(auto_id="cmdSubmit", control_type="Button")
cancelButton = WindowElement.Button(auto_id="cmdCancel", control_type="Button")
yesPopUpButton = WindowElement.Button(title = "Yes" ,control_type="Button", auto_id="6")
OKButton = WindowElement.Button(title ="OK",control_type="Button")
#Actions
#Entering Amount in HouseCheck
def enterHouseCheckAmount(self,amount):
self.houseCheck.WaitForVisible()
self.houseCheck.ClickInput()
self.houseCheck.EnterText(amount)
self.logger.debug("'Amount Entered in houseCheck' : "+ str(amount))
#Entering value in Remarks
def enterRemarks(self,remarks):
self.remarks.WaitForVisible()
self.remarks.ClickInput()
self.remarks.EnterText(remarks)
self.logger.debug("'Data Entered in Remarks' : "+ str(remarks))
#To Verify "Record Opening Amount" Window is opened
def verifyWindowOpen(self):
self.betsButton.WaitForVisible()
status = self.betsButton.IsVisible()
self.logger.debug("'Record Opening Amount' Window is opened : "+ str(status))
return status
#click on submit button
def clickOnSubmitButton(self):
self.submitButton.WaitForVisible()
self.submitButton.ClickInput()
self.logger.debug("Click on submit button")
#click on cancel button
def clickOnCancelButton(self):
self.cancelButton.WaitForVisible()
self.cancelButton.ClickInput()
self.logger.debug("Click on cancel button")
#click on cancel button
def clickOnOkPopUpButton(self):
self.OKButton.WaitForVisible()
self.OKButton.ClickInput()
self.logger.debug("Click on Ok button")
#record opening amount screen data update
def updateRecordOpeningAmount(self,amount):
self.enterHouseCheckAmount(amount)
self.clickOnSubmitButton()
self.logger.debug("update record opening amount screen data")
----------------
|
Notes.io is a web-based application for 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 12 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