iramirez

Disclaimer

May 29th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.58 KB | None | 0 0
  1. ################################################################################
  2. ##
  3. ##  Filename:     TSTR_1253_billpay_disclaimers_unit_test.py
  4. ##
  5. ##  Description:  This unit test check the Billpay Disclaimer
  6. ##                (~atf/pages/ngam/billpay/billpay_page.py)
  7. ##
  8. ################################################################################
  9. import importer
  10. import unittest
  11. import sys
  12. import xmlrunner
  13. from lib import q2_library
  14. from pages.ngam import main_page, login_page
  15. from pages.ngam.billpay import billpay_page
  16. from proboscis.asserts import assert_true
  17.  
  18. class Billpay_Disclaimer(unittest.TestCase):
  19.     driver = None
  20.     util = None
  21.     ENV = 'CI'
  22.     BROWSER = 'CHROME_MAC'
  23.  
  24.     @classmethod
  25.     def setUpClass(cls):
  26.         cls.util = q2_library.Utilities()
  27.         cls.util.load_config(cls)
  28.         cls.driver = cls.util.get_browser()
  29.         cls.url = cls.util.get_config("base_url")
  30.         cls.user = cls.util.get_credentials('autobillpaydisc')
  31.         cls.password = cls.util.get_credentials('autobillpaydisc_password')
  32.  
  33.     def test_01_navigation(self):
  34.         self.driver.get(self.url)
  35.         self.driver.maximize_window()
  36.  
  37.     def test_02_login(self):
  38.         """Login to the app"""
  39.         login = login_page.LoginPage(self.driver)
  40.         login.enter_username(self.user)
  41.         login.enter_password(self.password)
  42.         principal_page = login.click_submit_button()
  43.         message = principal_page.validate_welcome_msg()
  44.         self.assertIn('Welcome back', message, 'Login Ok')
  45.  
  46.     def test_03_click_submenu_item(self):
  47.         """Open the iPay Multi-Billpay menu"""
  48.         side_bar_menu = main_page.Menu(self.driver)
  49.         side_bar_menu.open_menu_item("iPay Billpays")
  50.         side_bar_menu.open_menu_child_item("iPay Multi-Billpay")
  51.         iPay_multi_billpay = billpay_page.BillpayPage(self.driver)
  52.         assert_true(iPay_multi_billpay.is_billpay_disclaimer_displayed(), "Billpay Disclaimer is not displayed")
  53.  
  54.     def setUp(self):
  55.         self.util.set_up(self)
  56.  
  57.     def tearDown(self):
  58.         self.util.tear_down(self)
  59.  
  60.     @classmethod
  61.     def tearDownClass(cls):
  62.         cls.util.close_the_browser(cls.driver)
  63.  
  64. if __name__ == '__main__':
  65.     if len(sys.argv) == 2:
  66.         Billpay_Disclaimer.ENV = sys.argv.pop()
  67.     if len(sys.argv) == 3:
  68.         Billpay_Disclaimer.BROWSER = sys.argv.pop()
  69.         Billpay_Disclaimer.ENV = sys.argv.pop()
  70.     with open('test-reports/junit.xml', 'wb') as output:
  71.         unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), failfast=False, buffer=False, catchbreak=False)
Advertisement
Add Comment
Please, Sign In to add comment