コード例 #1
0
ファイル: Test_Functional.py プロジェクト: repon06/py_test
 def setUp(self):
     self.driver = DriverFactory().get_web_driver("chrome")
     login = ConfigHelper().getConfigOption('username1_valid', 'login')
     password = ConfigHelper().getConfigOption("username1_valid",
                                               "password")
     login_page = Login_Page(selenium_driver=self.driver)
     self.payment_page = login_page.login(login, password)
コード例 #2
0
    def _test_func(self):
        "авторизация тестовыми наборами пользователей"

        login_page = Login_Page(selenium_driver=self.driver)
        paymentPage = login_page.login(login, password)
        self.assertTrue(paymentPage.is_PaymentPage(),
                        'не Ожидалось ошибки авторизации')
コード例 #3
0
    def _test_func(self):
        "авторизация тестовыми негативными наборами тест пользователей"

        login_page = Login_Page(selenium_driver=self.driver)
        error = login_page.login(login, password)
        self.assertEqual('Wrong password, try again', error,
                         'Ожидалась ошибка авторизации')
コード例 #4
0
ファイル: Test_Functional.py プロジェクト: repon06/py_test
 def test_forgot_pass(self):
     """тесты по восстановлению пароля"""
     login_page = Login_Page(selenium_driver=self.driver)
     login_page.expand_forgot_pass()
     login_page.set_forgot_email("*****@*****.**")
     login_page.submit_forgot()
     text = login_page.get_message()
     self.assertEqual(text, "New password was send to your email address",
                      "Ожидаем определенное сообщение")
コード例 #5
0
def get_driver():
    """setUp / teaeDown"""
    driver = DriverFactory().get_web_driver("chrome")
    login = ConfigHelper().getConfigOption('username1_valid', 'login')
    password = ConfigHelper().getConfigOption("username1_valid", "password")
    login_page = Login_Page(selenium_driver=driver)
    payment_page = login_page.login(login, password)

    # def teardown():
    #    driver.close()
    #    request.addfinalizer(teardown)
    # return payment_page

    yield driver
    driver.close()
コード例 #6
0
ファイル: PageFactory.py プロジェクト: repon06/py_test
 def getPageObject(page_name, driver):
     "return page object on page_name"
     page_name = page_name.lower()
     if page_name == "login page":
         test_obj = Login_Page(selenium_driver=driver)
     elif page_name == "payment page":
         test_obj = Payment_Page(selenium_driver=driver)
     elif page_name == "pricing page":
         test_obj = Pricing_Page(selenium_driver=driver)
     return test_obj
コード例 #7
0
ファイル: Test_Functional.py プロジェクト: repon06/py_test
 def test_ibit_login_negativ(self):
     """авторизация тестовыми негативными наборами тест пользователей"""
     login_page = Login_Page(selenium_driver=self.driver)
     error = login_page.login("*****@*****.**", "123456")
     self.assertEqual(error, 'Wrong password, try again',
                      'Ожидалась ошибка авторизации')
コード例 #8
0
ファイル: Test_Functional.py プロジェクト: repon06/py_test
    def test_ibit_login(self):  # browser="chrome"
        "авторизация тестовыми наборами тест пользователей"

        login = ConfigHelper().getConfigOption('username1_valid', 'login')
        password = ConfigHelper().getConfigOption("username1_valid",
                                                  "password")

        # убрал PageFactory
        # loginPage = PageFactory().getPageObject("login page", self.driver)

        login_page = Login_Page(selenium_driver=self.driver)
        payment_page = login_page.login(login, password)

        payment_page.select_status("mini")
        payment_page.select_payment_system("Payweb")
        proceed_page = payment_page.submit_payment()
        result_text = proceed_page.get_message_result()
        print(result_text)
        payment_page = proceed_page.goto_forvard()
        '''
        print("bonus state before check: {0}".format(payment_page.get_state_bonus()))
        payment_page.check_bonus()
        print("bonus state after check: {0}".format(payment_page.get_state_bonus()))
        print("bonus value: %s" % payment_page.get_bonus_value())
        print("you get value: %s" % payment_page.get_you_get())

        print("amount: %s" % payment_page.get_amount_value())
        payment_page.set_amount_value(666)  # 999.2 граничные значения, дробные, отрицыт
        print("active status: %s" % payment_page.get_active_status())

        payment_system = "WebMoney"
        payment_page.select_payment_system(payment_system)
        payment_system_actual = payment_page.get_value_payment_system()
        self.assertEqual(payment_system_actual, payment_system, "Ожидаем плат систему")
        
        time.sleep(2)
        pricing_page = payment_page.goto_pricing()
        time.sleep(2)
        payment_page = pricing_page.goto_payment()
        time.sleep(2)
        
        currency = "CNH"
        payment_page.select_currency(currency)
        currency_actual = payment_page.get_value_currency()
        self.assertTrue(currency in currency_actual, "Ожидается выбранная валюта")
        
        #
        payment_page.select_payment_system("QIWI")
        payment_page.submit_payment(False)
        time.sleep(2)
        payment_page.qiwi_close()
        
        # ошибка ввода телефона qiwi
        payment_page.submit_payment(False)
        payment_page.qiwi_set_phone("+70")
        proceed_page = payment_page.qiwi_submit(True)
        is_error = payment_page.is_error_qiwi_phone()
        self.assertTrue(is_error, "Должна быть ошибка в форме ввода телефона")
        payment_page.qiwi_close()

        # корректный телефон qiwi
        payment_page.submit_payment(False)
        payment_page.qiwi_set_phone("+79271591181")
        proceed_page = payment_page.qiwi_submit()
        result_text = proceed_page.get_message_result()
        print(result_text)
        payment_page = proceed_page.goto_forvard()
        '''

        time.sleep(7)
        self.assertTrue(True, 'all ok')