Exemplo n.º 1
0
    def test_registrationAgeUnder18(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(10, 1000)
        text3 = 'Employment Information'
        text4 = 'Personal Information'
        text7 = 'We’re sorry.'
        text8 = 'We were unable to locate enough information to approve you for a spending limit at this time.'

        LoginPage.startRegistration(self)

        ##### Page 1: START  ###########
        PORTAL = 'mainstreet'

        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='6547899123',
                                    portal=PORTAL)

        ################## Page3: Employment Information   #########################

        RegistrationPage3.fillForm3(self,
                                    employerName='Private Firm Niagara',
                                    empPhone='5986547899',
                                    income='9999',
                                    ohterIncome='')

        ################## Page4: Personal Information   #########################

        RegistrationPage4.fillForm4_AgeLimitation(self,
                                                  ssn='121512230',
                                                  driverLic='555555555',
                                                  state='PA')
        time.sleep(35)
        self.assertIn(text7, self.driver.page_source)
        self.assertIn(text8, self.driver.page_source)

        ### Check that Home button is present:
        RegistrationPage5.clickHomeButton(self)

        ### click on Home button => Home Page is opened, INFO banner, Header menu, Footer menu, Search field  are presennt:
        self.assertIs(True, HomePage.checkINFOBannerPresent(self))
        self.assertIs(True, HomePage.checkHeaderMenuPresent(self))
        self.assertIs(True, HomePage.checkFooterMenuPresent(self))
        self.assertIs(True, HomePage.checkSearchPresent(self))
Exemplo n.º 2
0
    def test_registration_GetSpendingLimitUnSuccess_InvalidDriverLicense(self):
        driver = self.driver
        driver.get(self.base_url)
        url_1 = self.base_url + '/Account/Signup'

        x = random.randint(100, 1000)

        text7 = 'We’re sorry.'
        text8 = 'We were unable to locate enough information to approve you for a spending limit at this time.'
        PORTAL = 'mainstreet'

        LoginPage.startRegistration(self)

        ##### Page 1: START  ###########

        RegistrationPage1.fillForm1(self,
                                    email='',
                                    username='******' + str(x),
                                    password="******",
                                    passwordConfirm="Ss123456",
                                    answer='valya')

        time.sleep(5)

        ################## Page2 : Contact Information  #########################

        RegistrationPage2.fillForm2(self,
                                    firstName='sveta',
                                    lastName='step' + str(x),
                                    phone='3333333333',
                                    portal=PORTAL)

        ################## Page3: Employment Information   #########################

        RegistrationPage3.fillForm3(self,
                                    employerName='Private Firm Niagara',
                                    empPhone='5986547899',
                                    income='9855',
                                    ohterIncome='')

        ################## Page4: Personal Information   #########################

        RegistrationPage4.fillForm4(self,
                                    ssn='121512230',
                                    driverLic='111111111',
                                    state='PA')

        ######## Page5: Payment Information   ###################################

        RegistrationPage5.fillForm5(self,
                                    accountType='DebitCard',
                                    cardNumber='5454-5454-5454-5454',
                                    cvv="1234",
                                    month='10',
                                    year='2020')

        time.sleep(35)
        self.assertIn(text7, self.driver.page_source)
        self.assertIn(text8, self.driver.page_source)
    def test_LeaseSuccessSTAGE_NewUser(self):
        driver = self.driver
        driver.get(self.base_url)
        url_1 = self.base_url + '/Account/Signup'
        x = random.randint(100, 10000)
        text6 = 'Congratulations!'

        text1 = 'Thank you.'
        text2 = 'No items found in your cart.'
        url_2 = self.base_url + '/cart'
        s = '/Secure/Orders/OrderManagement/ViewOrders/Default.aspx'
        url_3 = 'https://admin.xxx.com'

        self.driver.get(url_1)
        PORTAL = 'mainstreet'

        ##### Page 1: START Let’s Create Your Account  ###########

        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='1212121212',
                                    portal=PORTAL)

        ################## Page3: Employment Information   #########################

        RegistrationPage3.fillForm3(self,
                                    employerName='Private Firm Niagara',
                                    empPhone='5986547899',
                                    income='9999',
                                    ohterIncome='')

        ################## Page4: Personal Information   #########################

        RegistrationPage4.fillForm4(self,
                                    ssn='121512230',
                                    driverLic='555555555',
                                    state="AL")

        ######## 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))

        ### Precondition : check that Cart is empty:
        driver.get(url_2)
        self.assertIn(text2, self.driver.page_source)

        ### test scope : add the item to Cart:

        HomePage.submitSearch(self, 'canon')
        SearchResultsPage.clickAddToCart(self)
        self.driver.get(url_2)
        time.sleep(5)
        ### test scope : click on Checkout button :
        CartPage.clickCheckoutButton(self)
        time.sleep(3)
        ### test scope : click on Price Reviewed Opt In , ReviewYourLease  buttons:
        CartPage.selectPriceReviewedOptIn(self)
        CartPage.clickReviewYourLease(self)

        ### test scope : check that user accepted the Lease:
        LeasePage.signAgreement(self, firstName='sveta', lastName=' step' + str(x))
        time.sleep(100)
        self.assertIn(text1, self.driver.page_source)
        driver.get(url_2)
        time.sleep(8)
        self.assertIn(text2, self.driver.page_source)
        # time.sleep(10)

        #####  Checking - Admin can canceled payment ##########

        driver.get(url_3)
        time.sleep(8)
        ConfiguratorAdminPage.loginAdminStage(self)
        driver.get(url_3 + s)
        time.sleep(10)
        OrdersAdminPage.findOrdersByLastname(self, 'step' + str(x))
        OrdersAdminPage.clickManageOrder(self)
        OrdersAdminPage.clickUpdateOrderStatus(self)
        OrdersAdminPage.clickCancelOrder(self)
        time.sleep(30)
        OrdersAdminPage.clickBackToOrderList(self)
Exemplo n.º 4
0
    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_checkRequirementFields(self):
        driver = self.driver
        driver.get(self.base_url)
        url_1 = self.base_url + '/Account/Signup'
        # Requiure fied on Registation form Page 1:

        text0 = 'Email Address is required.'
        text1 = 'Email Address is required.'
        text2 = 'Username is required.'
        text3 = 'Password is required.'
        text4 = 'Re-type Password is required.'
        text5 = 'Security question is required.'
        text6 = 'Security answer is required.'

        # Required field on Registration form Page 2:

        text7 = 'First name is required.'
        text8 = 'Last name is required.'
        text9 = 'Street address is required.'
        text10 = 'Mobile phone number is required.'

        # Required field on Registration form Employment INFO  Page 3 :
        text11 = 'Employer Name is required.'
        text12 = 'Phone number is required.'
        text13 = 'Pay frequency is required.'
        text14 = 'Income is required.'
        text15 = 'Please select an option.'

        # Required field on Registration form Personal Information Page4:
        text16 = 'Social Security Number is required.'
        text17 = "Driver's License Number is required."
        text18 = 'State of Issue is required'
        text19 = 'Age Indicator is required.'

        # Success Page:
        text20 = 'Congratulations!'
        PORTAL = 'mainstreet'

        x = random.randint(10, 1000)

        self.driver.get(url_1)
        time.sleep(5)

        ##### Page 1: START Let’s Create Your Account ###########

        # self.assertEqual(url_1, HelperTestBase.getURL(self))
        RegistrationPage.selectTermsRadiobutton(self)

        RegistrationPage.clickNext(self)
        time.sleep(3)
        # self.assertEqual(url_1, HelperTestBase.getURL(self))
        self.assertIn(text0, self.driver.page_source)
        self.assertIn(text1, self.driver.page_source)
        self.assertIn(text2, self.driver.page_source)
        self.assertIn(text3, self.driver.page_source)
        self.assertIn(text4, self.driver.page_source)
        self.assertIn(text5, self.driver.page_source)
        self.assertIn(text6, self.driver.page_source)
        self.driver.get(url_1)

        RegistrationPage1.fillForm1(self,
                                    email='*****@*****.**',
                                    username='******' + str(x),
                                    password="******",
                                    passwordConfirm="Ss123456",
                                    answer='valya')

        ########

        time.sleep(20)
        RegistrationPage.clickNext(self)
        time.sleep(5)

        self.assertIn(text7, self.driver.page_source)
        self.assertIn(text8, self.driver.page_source)
        self.assertIn(text9, self.driver.page_source)
        self.assertIn(text10, self.driver.page_source)

        self.driver.refresh()

        ################## Page2 : Contact Information  #########################

        HelperTestBase.waitNextButton(self)
        time.sleep(2)

        RegistrationPage2.fillForm2(self,
                                    firstName='sveta',
                                    lastName='step' + str(x),
                                    phone='1111111111',
                                    portal=PORTAL)

        time.sleep(15)
        self.assertIn(text11, self.driver.page_source)
        RegistrationPage.clickNext(self)

        ################## Page3: Employment Information   #########################

        RegistrationPage.clickNext(self)
        time.sleep(2)
        self.assertIn(text11, self.driver.page_source)
        self.assertIn(text12, self.driver.page_source)
        self.assertIn(text13, self.driver.page_source)
        self.assertIn(text14, self.driver.page_source)
        self.assertIn(text15, self.driver.page_source)

        RegistrationPage3.fillForm3(self,
                                    employerName='Private Firm Niagara',
                                    empPhone='5986547899',
                                    income='9999',
                                    ohterIncome='')

        time.sleep(5)

        ################## Page4: Personal Information   #########################

        RegistrationPage.clickNext(self)
        time.sleep(2)
        self.assertIn(text16, self.driver.page_source)
        self.assertIn(text17, self.driver.page_source)
        self.assertIn(text18, self.driver.page_source)
        self.assertIn(text19, self.driver.page_source)

        RegistrationPage4.fillForm4(self,
                                    ssn='121512230',
                                    driverLic='555555555',
                                    state="AL")
        time.sleep(5)

        ######## Page5: Payment Information   ###########################

        RegistrationPage5.fillForm5(self,
                                    accountType='DebitCard',
                                    cardNumber='5454-5454-5454-5454',
                                    cvv="1234",
                                    month='12',
                                    year='2021')

        time.sleep(30)
        self.assertIn(text20, self.driver.page_source)
    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))
Exemplo n.º 7
0
    def test_LeaseSuccess_NewUser(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!'

        time.sleep(3)
        driver.get(self.base_url + '/Account/Signup')

        self.driver.refresh()

        ##### Page 1: START Let’s Create Your Account  ###########

        RegistrationPage1.fillForm1(self,
                                    email='*****@*****.**',
                                    username='******' + str(x),
                                    password="******",
                                    passwordConfirm="Ss123456",
                                    answer='valya')

        ################## Page2 : Contact Information  #########################

        RegistrationPage2.fillForm2(self,
                                    firstName='sveta',
                                    lastName='step' + str(x),
                                    phone='121212121212',
                                    portal='mainstreet')

        ################## Page3: Employment Information   #########################

        RegistrationPage3.fillForm3(self,
                                    employerName='Private Firm Niagara',
                                    empPhone='5986547899',
                                    income='9999',
                                    ohterIncome='')

        ################## Page4: Personal Information   #########################

        RegistrationPage4.fillForm4(self,
                                    ssn='121512230',
                                    driverLic='555555555',
                                    state="AL")
        time.sleep(5)
        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))

        text1 = 'Thank you.'
        text2 = 'No items found in your cart.'
        url_2 = self.base_url + '/cart'

        ### Precondition : check that Cart is empty:
        driver.get(url_2)
        self.assertIn(text2, self.driver.page_source)

        ### test scope : add the item to Cart:

        HomePage.submitSearch(self, 'canon')
        SearchResultsPage.clickAddToCart(self)
        self.driver.get(url_2)
        time.sleep(5)
        ### test scope : click on Checkout button :
        CartPage.clickCheckoutButton(self)
        time.sleep(5)
        ### test scope : click on Price Reviewed Opt In , ReviewYourLease  buttons:
        CartPage.selectPriceReviewedOptIn(self)
        CartPage.clickReviewYourLease(self)

        ### test scope : check that user accepted the Lease:
        LeasePage.signAgreement(self,
                                firstName='sveta',
                                lastName=' step' + str(x))
        time.sleep(100)
        self.assertIn(text1, self.driver.page_source)
        driver.get(url_2)
        time.sleep(8)
        self.assertIn(text2, self.driver.page_source)