Esempio n. 1
0
 def setUp(self):
     self.driver = WebdriverFactory.getWebdriver(DataTest.browser)
     self.driver.get(DataTest.url['home'])
     self.welcomePage = Welcome(self.driver)
     self.loginPage = Login(self.driver)
     self.mainUserPage = MainUserPage(self.driver)
     self.paymentPage = PaymentsPage(self.driver)
     self.utilityDetailsPopup = PopupUtilityDetails(self.driver)
     self.selectSumPopup = PopupSelectPaymentSum(self.driver)
     self.easyPayPopup = PopupEasyPay(self.driver)
    def testGetToPaymentWindow(self):

        self.driver.get("http://localhost:8080/")
        welcomePage = Welcome(self.driver)
        loginPage = Login(self.driver)
        mainUserPage = MainUserPage(self.driver)
        paymentPage = PaymentsPage(self.driver)
        utilityDetailsPopup = PopupUtilityDetails(self.driver)
        selectSumPopup = PopupSelectPaymentSum(self.driver)
        easyPayPopup = PopupEasyPay(self.driver)

        welcomePage.signIn()
        loginPage.login(DataTest.popupEasyPay['email'],
                        DataTest.popupEasyPay['password'])
        mainUserPage.getToPaymentPage()
        paymentPage.getPaymentDetails()
        utilityDetailsPopup.clickButtonPay()
        selectSumPopup.enterInputSum(DataTest.sumValue)
        selectSumPopup.clickBtnDownload()
        selectSumPopup.clickBtnProceed()
        easyPayPopup.getToIframe()

        title = easyPayPopup.getTitleEasypay()
        print(title)
        self.assertEqual(title, 'EasyPay')
Esempio n. 3
0
    def testCheckBalanceAfterPay(self):
        driver = self.driver
        welcomePage = Welcome(driver)
        loginPage = Login(driver)
        mainUserPage = MainUserPage(driver)
        paymentPage = PaymentsPage(driver)
        utilityDetailsPopup = PopupUtilityDetails(driver)
        selectSumPopup = PopupSelectPaymentSum(driver)
        easyPayPopup = PopupEasyPay(driver)

        welcomePage.signIn()
        loginPage.login(DataTest.popupEasyPay['email'],
                        DataTest.popupEasyPay['password'])
        mainUserPage.getToPaymentPage()
        paymentPage.getPaymentDetails()
        balanceValue1 = paymentPage.getBalanceValue()
        utilityDetailsPopup.clickButtonPay()

        selectSumPopup.enterInputSum(DataTest.sumValue)
        selectSumPopup.clickBtnDownload()
        selectSumPopup.clickBtnProceed()

        easyPayPopup.getToIframe()
        easyPayPopup.fillPopupEasyPayFields(DataTest.popupEasyPay['cardNumber'],
                                            DataTest.popupEasyPay['dateCard'],
                                            DataTest.popupEasyPay['cvNumber'])
        easyPayPopup.clickRememberMe()
        easyPayPopup.fillAdditionalFieldsPopupEasy(DataTest.popupEasyPay['zipCode'],
                                                   DataTest.popupEasyPay['phone'],
                                                   DataTest.popupEasyPay['mail'])
        easyPayPopup.clickBackPopupEasy()

        driver.switch_to.default_content()
        time.sleep(10)
        driver.get(DataTest.url['paymentsPage'])
        balanceValue2 = paymentPage.getBalanceValue()
        result = balanceValue2 - balanceValue1
        self.assertEquals(float(result), float(DataTest.sumValue))
Esempio n. 4
0
    def testButtonsDownloadAndSend(self):
        welcomePage = Welcome(self.driver)
        loginPage = Login(self.driver)
        mainUserPage = MainUserPage(self.driver)
        paymentPage = PaymentsPage(self.driver)
        utilityDetailsPopup = PopupUtilityDetails(self.driver)
        selectSumPopup = PopupSelectPaymentSum(self.driver)

        welcomePage.signIn()
        loginPage.login(DataTest.popupEasyPay['email'],
                        DataTest.popupEasyPay['password'])
        mainUserPage.getToPaymentPage()
        paymentPage.getPaymentDetails()
        utilityDetailsPopup.clickButtonPay()

        selectSumPopup.clickBtnDownload()
        active = selectSumPopup.getAtributeDownload()
        print(active)
        self.assertEqual(active, 'btn btn-default active')

        selectSumPopup.clickBtnSendCheck()
        active = selectSumPopup.getAttributeSend()
        print(active)
        self.assertEqual(active, 'btn btn-default active')
Esempio n. 5
0
class Test(unittest.TestCase):
    def setUp(self):
        self.driver = WebdriverFactory.getWebdriver(DataTest.browser)
        self.driver.get(DataTest.url['home'])
        self.welcomePage = Welcome(self.driver)
        self.loginPage = Login(self.driver)
        self.mainUserPage = MainUserPage(self.driver)
        self.paymentPage = PaymentsPage(self.driver)
        self.utilityDetailsPopup = PopupUtilityDetails(self.driver)
        self.selectSumPopup = PopupSelectPaymentSum(self.driver)
        self.easyPayPopup = PopupEasyPay(self.driver)

    def getToPaymentDetailsPopup(self):
        self.welcomePage.signIn()
        self.loginPage.login(DataTest.popupEasyPay['email'],
                             DataTest.popupEasyPay['password'])
        self.mainUserPage.getToPaymentPage()
        self.paymentPage.getPaymentDetails()

    def loggerInfo(self, name):
        self.logger = logging.getLogger()
        self.logger.info("_" * 10 + name)

    def testCheckNoSaveCvcAfterRefresh(self):
        name = unittest.TestCase.id(self)
        self.loggerInfo(name)
        self.getToPaymentDetailsPopup()
        self.utilityDetailsPopup.clickButtonPay()

        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()

        self.easyPayPopup.getToIframe()
        self.easyPayPopup.fillPopupEasyPayFields(
            DataTest.popupEasyPay['cardNumber'],
            DataTest.popupEasyPay['dateCard'],
            DataTest.popupEasyPay['cvNumber'])

        self.driver.refresh()

        self.paymentPage.getPaymentDetails()
        self.utilityDetailsPopup.clickButtonPay()

        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()

        self.easyPayPopup.getToIframe()

        self.cvNumber = self.easyPayPopup.getCvNumber()
        self.assertEqual(self.cvNumber, '')

    def testCheckNoSaveCardDataAfterRefresh(self):
        name = unittest.TestCase.id(self)
        self.loggerInfo(name)
        self.getToPaymentDetailsPopup()
        self.utilityDetailsPopup.clickButtonPay()

        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()

        self.easyPayPopup.getToIframe()
        self.easyPayPopup.fillPopupEasyPayFields(
            DataTest.popupEasyPay['cardNumber'],
            DataTest.popupEasyPay['dateCard'],
            DataTest.popupEasyPay['cvNumber'])

        self.driver.refresh()

        self.paymentPage.getPaymentDetails()
        self.utilityDetailsPopup.clickButtonPay()

        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()

        self.easyPayPopup.getToIframe()

        cardNumber = self.easyPayPopup.getCardNumber()
        self.assertEqual(cardNumber, '')

    def testCheckBalanceAfterPay(self):
        name = unittest.TestCase.id(self)
        self.loggerInfo(name)
        self.getToPaymentDetailsPopup()

        balanceValue1 = self.paymentPage.getBalanceValue()
        self.utilityDetailsPopup.clickButtonPay()

        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()

        self.easyPayPopup.getToIframe()
        self.easyPayPopup.fillPopupEasyPayFields(
            DataTest.popupEasyPay['cardNumber'],
            DataTest.popupEasyPay['dateCard'],
            DataTest.popupEasyPay['cvNumber'])
        self.easyPayPopup.clickRememberMe()
        self.easyPayPopup.fillAdditionalFieldsPopupEasy(
            DataTest.popupEasyPay['zipCode'], DataTest.popupEasyPay['phone'],
            DataTest.popupEasyPay['mail'])
        self.easyPayPopup.clickBackPopupEasy()

        self.driver.switch_to.default_content()
        time.sleep(10)
        self.driver.get(DataTest.url['paymentsPage'])
        balanceValue2 = self.paymentPage.getBalanceValue()
        result = balanceValue2 - balanceValue1
        self.assertEquals(result, float(DataTest.sumValue))

    def tearDown(self):
        self.driver.close()
    def testCheckNoSaveCvcAfterRefresh(self):
        welcomePage = Welcome(self.driver)
        loginPage = Login(self.driver)
        mainUserPage = MainUserPage(self.driver)
        paymentPage = PaymentsPage(self.driver)
        utilityDetailsPopup = PopupUtilityDetails(self.driver)
        selectSumPopup = PopupSelectPaymentSum(self.driver)
        easyPayPopup = PopupEasyPay(self.driver)

        welcomePage.signIn()
        loginPage.login(DataTest.popupEasyPay['email'],
                        DataTest.popupEasyPay['password'])
        mainUserPage.getToPaymentPage()
        paymentPage.getPaymentDetails()
        utilityDetailsPopup.clickButtonPay()

        selectSumPopup.enterInputSum(DataTest.sumValue)
        selectSumPopup.clickBtnDownload()
        selectSumPopup.clickBtnProceed()

        easyPayPopup.getToIframe()
        easyPayPopup.fillPopupEasyPayFields(
            DataTest.popupEasyPay['cardNumber'],
            DataTest.popupEasyPay['dateCard'],
            DataTest.popupEasyPay['cvNumber'])

        self.driver.refresh()

        paymentPage.getPaymentDetails()
        utilityDetailsPopup.clickButtonPay()

        selectSumPopup.enterInputSum(DataTest.sumValue)
        selectSumPopup.clickBtnDownload()
        selectSumPopup.clickBtnProceed()

        easyPayPopup.getToIframe()

        cvNumber = easyPayPopup.getCvNumber()
        self.assertEqual(cvNumber, '')
Esempio n. 7
0
class Test(unittest.TestCase):
    def setUp(self):
        self.driver = WebdriverFactory.getWebdriver(DataTest.browser)
        self.driver.get(DataTest.url['home'])
        self.logger = logging.getLogger()

        self.welcomePage = Welcome(self.driver)
        self.loginPage = Login(self.driver)
        self.mainUserPage = MainUserPage(self.driver)
        self.paymentPage = PaymentsPage(self.driver)
        self.utilityDetailsPopup = PopupUtilityDetails(self.driver)
        self.selectSumPopup = PopupSelectPaymentSum(self.driver)
        self.easyPayPopup = PopupEasyPay(self.driver)

    def getToPaymentDetailsPopup(self):

        self.welcomePage.signIn()
        self.loginPage.login(DataTest.popupEasyPay['email'],
                             DataTest.popupEasyPay['password'])
        self.mainUserPage.getToPaymentPage()
        self.paymentPage.getPaymentDetails()

    def testSelectBill(self):
        name = unittest.TestCase.id(self)
        self.logger.info("_" * 10 + name)

        self.getToPaymentDetailsPopup()

        actual = self.utilityDetailsPopup.getTitleDetails()
        self.assertEquals(actual, "Utility details")

    def testButtonsDownloadAndSend(self):
        name = unittest.TestCase.id(self)
        self.logger.info("_" * 10 + name)

        self.getToPaymentDetailsPopup()

        self.utilityDetailsPopup.clickButtonPay()
        self.selectSumPopup.clickBtnDownload()
        active = self.selectSumPopup.getAtributeDownload()
        self.assertEqual(active, 'btn btn-default active')

        self.selectSumPopup.clickBtnSendCheck()
        active = self.selectSumPopup.getAttributeSend()
        self.assertEqual(active, 'btn btn-default active')

    def testGetToPaymentWindow(self):
        name = unittest.TestCase.id(self)
        self.logger.info("_" * 10 + name)

        self.getToPaymentDetailsPopup()

        self.utilityDetailsPopup.clickButtonPay()
        self.selectSumPopup.enterInputSum(DataTest.sumValue)
        self.selectSumPopup.clickBtnDownload()
        self.selectSumPopup.clickBtnProceed()
        self.easyPayPopup.getToIframe()

        title = self.easyPayPopup.getTitleEasypay()
        self.assertEqual(title, 'EasyPay')

    def tearDown(self):
        self.driver.close()