Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import importer
- import unittest
- import xmlrunner
- import time
- from lib import q2_library, modal_page
- from pages.ngam import main_page, login_page
- from pages.ngam.transactions import activity_center_page
- class TSTR_1985_DA_zerolimit_eftps_Approve(unittest.TestCase):
- driver = None
- util = None
- ENV = 'CI'
- BROWSER = 'CHROME_MAC'
- TRACKING_ID = None
- calendar_end = None
- calendar_start = None
- @classmethod
- def setUpClass(cls):
- cls.util = q2_library.Utilities()
- cls.util.load_config(cls)
- cls.input = cls.util.read_data_file("payments/tstr_1985_data.json")
- cls.driver = cls.util.get_browser(5)
- cls.url = cls.util.get_config("base_url")
- cls.user = cls.util.get_credentials('dual_action_user')
- cls.password = cls.util.get_credentials('password_ma')
- cls.second_user = cls.util.get_credentials('dual_actionfx_user_1')
- cls.current_page = None
- cls.tracking_id = None
- def test_01_navigation(self):
- """Opening the Browser"""
- self.driver.get(self.url)
- self.driver.maximize_window()
- self.assertIn("4", self.driver.title, "Checking the title has the correct value")
- def test_02_login_successful(self):
- """Login the app"""
- login = login_page.LoginPage(self.driver)
- login.enter_username(self.user)
- login.enter_password(self.password)
- main_page = login.click_submit_button()
- msg = main_page.validate_welcome_msg()
- self.assertIn("Welcome back", msg, "Login was successful")
- def test_04_tax_payments(self):
- """Going to tax payments"""
- menu = main_page.Menu(self.driver)
- menu.open_menu_item(self.input["commercial_menu"])
- tax_payment_page = menu.open_menu_child_item(self.input["tax_menu"])
- self.__class__.current_page = tax_payment_page
- tax_payment_page.wait_for_page_to_load()
- self.assertTrue(tax_payment_page.is_page_loaded(), "Checking if the tax payments page is loaded")
- def test_05_search_tax_forms(self):
- """Going to tax payments"""
- tax_payment_page = self.current_page
- #tax_payment_page.scroll_the_page(x=0, y =1)
- tax_payment_page.search_federal_forms(self.input["federal_search"])
- tax_payment_form = tax_payment_page.click_on_selected_form(self.input["form1041"])
- self.__class__.current_page = tax_payment_form
- self.assertTrue(tax_payment_form.is_page_loaded(),"The Form page is not present")
- def test_06_create_new_tax(self):
- tax_payment_form = self.current_page
- tax_payment_form.select_payment_from(self.input["payment_from"])
- tax_payment_form.select_from_account(self.input["from_account"])
- tax_payment_form.fill_payment_amount_txt(self.input["payment_amount"])
- calendar = tax_payment_form.get_calendar('single')
- calendar.select_date(0,False,1)
- tax_payment_form.select_tax_type(self.input["tax_type"])
- calendar = tax_payment_form.get_calendar('end')
- calendar.select_date(0, True, 1)
- tax_payment_form = self.current_page
- tax_payment_form.pause(3)
- warning_msg = tax_payment_form.check_for_alac_warning_msg(self.input["warning_msg"])
- warning_msg2 = tax_payment_form.check_for_alac_warning_msg(self.input["warning_msg2"])
- is_draft_enabled = tax_payment_form.is_draft_enabled()
- is_approve_disabled = not tax_payment_form.is_approve_enabled()
- self.assertTrue(warning_msg and warning_msg2 and is_draft_enabled and is_approve_disabled is False,
- "Some of the validations are not correct")
- def test_07_validate_draft_modal_page(self):
- tax_payment_form = self.current_page
- def setUp(self):
- self.util.set_up(self)
- def tearDown(self):
- self.util.tear_down(self)
- @classmethod
- def tearDownClass(cls):
- cls.util.close_the_browser(cls.driver)
- if __name__ == '__main__':
- q2_library.Utilities().set_parameters_to_this(TSTR_1985_DA_zerolimit_eftps_Approve)
- with open('test-reports/TSTR_1985_DA_zerolimit_eftps_Approve.xml', 'wb') as output:
- unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output, verbosity=2),
- failfast=False, buffer=False, catchbreak=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement