def test_loginSuccess_LogOut(self): driver = self.driver driver.get(self.base_url + '/Account/Login') LoginPage.logIn(self, "svetast555", "Ss123456") #### Check that user stay login after page refreshed: ##### self.driver.refresh() self.assertIs(True, HomePage.checkLogOutLink(self)) HomePage.logOut(self) time.sleep(5) self.assertIs(LoginPage.checkLoginForm(self), True)
def test_changePassword(self): driver = self.driver driver.get(self.base_url + '/Account/Dashboard') text0 = 'Password is required.' text1 = 'New password is required.' text2 = 'Re-type new password is required.' text4 = 'Cannot use any of the four previous passwords.' text5 = 'Password must be at least 8 alphanumeric characters and contain at least one number' text6 = 'Password and Re-Type password do not match' text7 = 'Update Successful' LoginPage.logIn(self, "svetast999", "Ss123456") time.sleep(5) ManageAccountPage.clickAccountSettings(self) time.sleep(2) ManageAccountPage.changePassword(self, currentPW='', newPW='', reTypePW='') time.sleep(3) self.assertIn(text0, self.driver.page_source) self.assertIn(text1, self.driver.page_source) self.assertIn(text2, self.driver.page_source) self.driver.refresh() # Check validation ####### ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ss1!@#$%^&*()_+<>[]{}?', reTypePW='Ss1!@#$%^&*()_+<>?[]{}') time.sleep(4) self.assertIn(text5, self.driver.page_source) # Check that password shoul be consist minimum of 8 symbols ####### ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ss12345', reTypePW='Ss12345') time.sleep(4) self.assertIn(text5, self.driver.page_source) # Check that User Can't use any of the four previous passwords: ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ss123456', reTypePW='Ss123456') time.sleep(3) self.assertIn(text4, self.driver.page_source) # Check that Password must be at least 8 alphanumeric characters and contain at least one number': ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='12345678', reTypePW='12345678') time.sleep(3) self.assertIn(text5, self.driver.page_source) # Check that Password must be at least 8 alphanumeric characters and contain at least one number': ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Asdfghjk', reTypePW='Asdfghjk') time.sleep(3) self.assertIn(text5, self.driver.page_source) # Check that Password and Re-Type password should be match: ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ss123456', reTypePW='Ff123456') time.sleep(3) self.assertIn(text6, self.driver.page_source) # Check that Password and Re-Type password should be match: ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ff123456', reTypePW='Ss123456') time.sleep(3) self.assertIn(text6, self.driver.page_source) ###### Check that Password has been changed successfully after entered valid data: ########### ManageAccountPage.changePassword(self, currentPW='Ss123456', newPW='Ff123456', reTypePW='Ff123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() ######## Return Test Data ################ ManageAccountPage.changePassword(self, currentPW='Ff123456', newPW='Rr123456', reTypePW='Rr123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() ManageAccountPage.changePassword(self, currentPW='Rr123456', newPW='Nn123456', reTypePW='Nn123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() ManageAccountPage.changePassword(self, currentPW='Nn123456', newPW='Mm123456', reTypePW='Mm123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() ManageAccountPage.changePassword(self, currentPW='Mm123456', newPW='Kk123456', reTypePW='Kk123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() ManageAccountPage.changePassword(self, currentPW='Kk123456', newPW='Ss123456', reTypePW='Ss123456') time.sleep(3) self.assertIn(text7, self.driver.page_source) self.driver.refresh() HomePage.logOut(self) time.sleep(3) LoginPage.logIn(self, "svetast999", "Ss123456") HelperTestBase.waitLogOutLink(self) self.assertIs(True, HomePage.checkLogOutLink(self))
def test_applyNowRelogin_Sussess(self): driver = self.driver driver.get(self.base_url) url_1 = self.base_url + '/Account/Signup' url_2 = self.base_url + '/Account/Login' x = random.randint(100, 10000) text6 = 'Congratulations!' driver.get(url_1) PORTAL = 'mainstreet' ##### Page 1: START ########### RegistrationPage1.fillForm1(self, email='*****@*****.**', username='******' + str(x), password="******", passwordConfirm="Ss123456", answer='valya') HelperTestBase.waitNextButton(self) ################## Page2 : Contact Information ######################### RegistrationPage2.fillForm2(self, firstName='sveta', lastName='step' + str(x), phone='77777777777', portal=PORTAL) ################## Page3: Employment Information ######################### RegistrationPage3.fillForm3(self, employerName='Private Firm Niagara', empPhone='5986547899', income='9999', ohterIncome='') HomePage.logOut(self) driver.get(url_2) LoginPage.logIn(self, "svetast" + str(x), "Ss123456") HelperTestBase.waitLogOutLink(self) self.assertIs(True, RegistrationPage4.checkSSN_Present(self)) ################## Page4: Personal Information ######################### RegistrationPage4.fillForm4( self, ssn='121512230', driverLic='555555555', # driverLic='12121212121212121212', #### => if case nedd to get iPredict Sorry Screen ##### state="TX") time.sleep(5) HomePage.logOut(self) driver.get(url_2) LoginPage.logIn(self, "svetast" + str(x), "Ss123456") HelperTestBase.waitLogOutLink(self) self.assertIs(True, RegistrationPage4.checkCardNumberPresent(self)) ######## Page5: Payment Information ########################### RegistrationPage5.fillForm5(self, accountType='DebitCard', cardNumber='5454-5454-5454-5454', cvv="1234", month='12', year='2021') time.sleep(35) self.assertIn(text6, self.driver.page_source) HomePage.logOut(self) #####Test scope - new user can Log In with credentials: driver.get(self.base_url + '/Account/Login') LoginPage.logIn(self, "svetast" + str(x), "Ss123456") self.assertIs(True, HomePage.checkLogOutLink(self))
def test_registration_GetSpendingLimitSuccess(self): driver = self.driver driver.get(self.base_url) url_1 = self.base_url + '/Account/Signup' url_2 = self.base_url + '/Account/ApplyNow' url_3 = self.base_url + '/Account/ApplyNow#' x = random.randint(100, 10000) text3 = 'Employment Information' text4 = 'Personal Information' text5 = 'Payment Information' text6 = 'Congratulations!' PORTAL = 'mainstreet' time.sleep(3) driver.get(self.base_url + '/Account/Signup') # self.assertEqual(url_1, HelperTestBase.getURL(self)) ##### Page 1: START Let’s Create Your Account ########### RegistrationPage1.fillForm1(self, email='*****@*****.**', username='******' + str(x), password="******", passwordConfirm="Ss123456", answer='valya') # self.assertEqual(url_2, HelperTestBase.getURL(self)) HelperTestBase.waitNextButton(self) ################## Page2 : Contact Information ######################### RegistrationPage2.fillForm2(self, firstName='sveta', lastName='step' + str(x), phone='7777777777', portal=PORTAL) time.sleep(20) self.assertEqual(url_3, HelperTestBase.getURL(self)) self.assertIn(text3, self.driver.page_source) ################## Page3: Employment Information ######################### RegistrationPage3.fillForm3(self, employerName='Private Firm Niagara', empPhone='5986547899', income='9999', ohterIncome='') time.sleep(5) # self.assertIn(text4, self.driver.page_source) ################## Page4: Personal Information ######################### RegistrationPage4.fillForm4(self, ssn='121512230', driverLic='555555555', state="AL") time.sleep(10) self.assertIn(text5, self.driver.page_source) ######## Page5: Payment Information ########################### RegistrationPage5.fillForm5(self, accountType='DebitCard', cardNumber='5454-5454-5454-5454', cvv="1234", month='12', year='2021') time.sleep(35) self.assertIn(text6, self.driver.page_source) RegistrationPage5.clickContinueButton(self) time.sleep(15) self.assertIs(True, HomePage.checkINFOBannerPresent(self)) HomePage.logOut(self) #####Test scope - new user can Log In with credentials: driver.get(self.base_url + '/Account/Login') LoginPage.logIn(self, "svetast" + str(x), "Ss123456") self.assertIs(True, HomePage.checkLogOutLink(self))