def testsavingsaccont(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password) filename = self.refobj.accountoverview() time.sleep(3) newaccount = self.refobj.accountcreation("savings", filename) filename = self.refobj.accountoverview() time.sleep(3) self.refobj.logout() rows = xlutils.getrowcount(filename, "Sheet1") for row in range(2, rows): accountnumber = xlutils.readfromxl(filename, "Sheet1", row, 1) #print(accountnumber,newaccount) if newaccount == accountnumber: mark = "sucess" break else: mark = "not found" continue if mark == "sucess": print("Savings account- ", newaccount, " created sucessfully") assert True else: print("failure to create a new account") assert False
def testaccountoverview(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password)
def testregister(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.refobj = Registration(self.Openbrowser) self.refobj.registerpage() time.sleep(3) self.refobj.fillfirsname(self.firstname) self.refobj.filllastname(self.lastname) self.refobj.filladdress(self.address) self.refobj.fillcity(self.city) self.refobj.fillstate(self.state) self.refobj.fillzipcode(self.zipcode) self.refobj.fillphone(self.phonenumber) self.refobj.fillssn(self.ssn) self.refobj.fillusername(self.username) self.refobj.fillpassword(self.password) self.refobj.fillpasswordagain(self.password) self.refobj.registersubmit() title = self.Openbrowser.title Act_title = "ParaBank | Customer Created" if Act_title == title: assert True else: assert False
def testcheckingaccont(self, browserhandling): self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password) filename = self.refobj.accountoverview() time.sleep(3) newaccount = self.refobj.accountcreation("checking", filename) filename = self.refobj.accountoverview() time.sleep(3) self.refobj.logout() rows = xlutils.getrowcount(filename, "Sheet1") for row in range(2, rows): accountnumber = xlutils.readfromxl(filename, "Sheet1", row, 1) #print(accountnumber, newaccount) if newaccount == accountnumber: mark = "sucess" break else: mark = "not found" continue if mark == "sucess": print("Checking account- ", newaccount, " created sucessfully") self.logger.info("Checking account created") assert True else: print("failure to create a new account") self.logger("Checking account not created") assert False
def testpaybill(self,web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username,self.password) filename = self.refobj.accountoverview() time.sleep(3) self.refobj.clickpaybill() time.sleep(3) self.refobj.inputpayeename(self.payeename) self.refobj.inputpayeeaddres(self.payeeaddress) self.refobj.inputpayeecity(self.payeecity) self.refobj.inputpayeestate(self.payeestate) self.refobj.inputpayeezipcode(self.payeezip) self.refobj.inputpayeeph(self.payeeph) self.refobj.inputpayeeaccount(self.payeeaccount) self.refobj.inputpayeeverify(self.payeeaccount) self.refobj.inputpayeeamount(self.amount) time.sleep(3) accountnumber= xlutils.readfromxl(filename,"Sheet1",2,1) self.refobj.selectbillpayaccount(accountnumber) time.sleep(3) self.refobj.clickpaymentbutton() time.sleep(3) msg = self.Openbrowser.find_element_by_xpath("//h1[contains(text(),'Bill Payment Complete')]").text if msg == "Bill Payment Complete": print ("Bill Payment to ",self.payeename, "in the amount of ",self.amount, "from account ",accountnumber," was successful.") assert True else: print("Payment failure") assert False
def testlogin(self, browserhandling): self.refobj = Registration(self.Openbrowser) result = self.refobj.login(self.username, self.password) time.sleep(5) self.refobj.logout() if result == True: assert True else: assert False
def testaccountoverview(self, browserhandling): self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password) filename = self.refobj.accountoverview() time.sleep(3) self.refobj.logout() time.sleep(3) if os.path.exists(filename) == True: assert True else: assert False
def testlogin(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) result = self.refobj.login(self.username, self.password) time.sleep(5) self.refobj.logout() if result == True: assert True else: assert False
def testamounttransfer(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password) filename = self.refobj.accountoverview() time.sleep(3) result = self.refobj.transferaccount(filename) if result == True: assert True else: assert False
def testcleardb(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.adminpagelink() time.sleep(3) result = self.refobj.cleardatabase() self.Openbrowser.close() if result == True: assert True else: assert False
def testaccountoverview(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.Openbrowser.get(self.weburl) self.refobj = Registration(self.Openbrowser) self.refobj.login(self.username, self.password) filename = self.refobj.accountoverview() time.sleep(3) self.refobj.logout() time.sleep(3) if os.path.exists(filename) == True: assert True else: assert False
def browserhandling(self, web): self.Openbrowser = web self.Openbrowser.get(self.weburl) self.Openbrowser.maximize_window() self.refobj = Registration(self.Openbrowser)