Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.40 KB | None | 0 0
  1. import importer
  2. import sys
  3. import unittest
  4. import xmlrunner
  5. from lib import q2_library
  6. from pages.ngam import main_page, login_page
  7. from pages.ngam.transactions import activity_center_page
  8. from pages.ngam.transactions.funds_transfer import individual_transfers_page, multi_account_transfers_page, accounts_and_amounts_page, schedule_and_submit_page
  9.  
  10. class MultiTransferApproveRecurring(unittest.TestCase):
  11. driver = None
  12. util = None
  13. TRACKING_ID = None
  14. ENV = 'CI'
  15. BROWSER = 'CHROME_MAC'
  16.  
  17. @classmethod
  18. def setUpClass(cls):
  19. cls.util = q2_library.Utilities()
  20. cls.util.load_config(cls)
  21. cls.driver = cls.util.get_browser()
  22. cls.url = cls.util.get_config("base_url")
  23. cls.user = cls.util.get_credentials("multi_transfer")
  24. cls.password = cls.util.get_credentials("passwordp1")
  25. cls.current_page = None
  26. cls.user_name = "AutoMultiTaxOne asfg"
  27. cls.account1 = "****-9789"
  28. cls.account2 = "****-6789"
  29. cls.account3 = "****-7887"
  30. cls.account4 = "****-9988"
  31. cls.amount1 = "5.11"
  32. cls.amount2 = "6.11"
  33. cls.amount3 = "7.11"
  34. cls.amount4 = "8.11"
  35.  
  36. def test_01_navigation(self):
  37. self.driver.get(self.url)
  38. self.driver.maximize_window()
  39. self.assertIn("4", self.driver.title, "Checking the title has the correct value")
  40.  
  41. def test_02_login_successful(self):
  42. login = login_page.LoginPage(self.driver)
  43. login.enter_username(self.user)
  44. login.enter_password(self.password)
  45. self.main_page = login.click_submit_button()
  46. msg = self.main_page.validate_welcome_msg()
  47. self.assertIn('Welcome back', msg, "Login was successful")
  48.  
  49. def test_03_funds_transfer(self):
  50. self.menu = main_page.Menu(self.driver)
  51. self.menu.open_menu_item('Transactions')
  52. self.funds_transfer = self.menu.open_menu_child_item('Funds Transfer')
  53. self.funds_transfer.wait_for_page_to_load()
  54. self.assertTrue(self.funds_transfer.is_page_loaded(), "Checking that the Funds Transfer Page got loaded")
  55.  
  56. def test_04_multi_account_transfers(self):
  57. self.funds_transfer = individual_transfers_page.FundsTransferPage(self.driver)
  58. multi_transfers = self.funds_transfer.go_to_multitransfer_tab()
  59. self.__class__.current_page = multi_transfers
  60. self.assertTrue(multi_transfers.is_page_loaded(), "Checking that the multi transfers tab got loaded")
  61.  
  62. def test_05_select_funds_transfer(self):
  63. multi_transfers = self.current_page
  64. accounts_and_amounts_tab = multi_transfers.click_on_transfers_funds()
  65. self.__class__.current_page = accounts_and_amounts_tab
  66. self.assertTrue(accounts_and_amounts_tab.is_page_loaded(), "Checking that the multi transfers tab got loaded")
  67.  
  68. def test_06_add_more_transfers(self):
  69. accounts_and_amounts_tab = self.current_page
  70. accounts_and_amounts_tab.click_on_more_transfer()
  71. is_num_of_lines_correct = accounts_and_amounts_tab.ret_num_account_lines() == 4
  72. self.assertTrue(is_num_of_lines_correct, "Checking that 4 accounts are displayed")
  73.  
  74. def test_07_fill_accounts_and_amounts(self):
  75. accounts_and_amounts_tab = self.current_page
  76. accounts_and_amounts_tab.choose_from_account(self.account1, 1)
  77. accounts_and_amounts_tab.choose_to_account(self.account2, 1)
  78. accounts_and_amounts_tab.enter_amount(self.amount1, 1)
  79. accounts_and_amounts_tab.choose_from_account(self.account2, 2)
  80. accounts_and_amounts_tab.choose_to_account(self.account3, 2)
  81. accounts_and_amounts_tab.enter_amount(self.amount2, 2)
  82. accounts_and_amounts_tab.choose_from_account(self.account3, 3)
  83. accounts_and_amounts_tab.choose_to_account(self.account2, 3)
  84. accounts_and_amounts_tab.enter_amount(self.amount3, 3)
  85. accounts_and_amounts_tab.choose_from_account(self.account4, 4)
  86. accounts_and_amounts_tab.choose_to_account(self.account1, 4)
  87. accounts_and_amounts_tab.enter_amount(self.amount4, 4)
  88. accounts_and_amounts_tab = self.current_page
  89. schedule_and_submit = accounts_and_amounts_tab.click_on_next()
  90. self.__class__.current_page = schedule_and_submit
  91. schedule_and_submit.wait_for_page_to_load()
  92. self.assertTrue(schedule_and_submit.is_page_loaded, "Checking that the Schedule & Submit page got loaded")
  93.  
  94. def test_08_verify_accounts_submit_page(self):
  95. schedule_and_submit = self.current_page
  96. schedule_and_submit.select_date()
  97. schedule_and_submit.expand_nth_rec(1)
  98. schedule_and_submit.enter_memo_nth_rec("MemoMemoMemo", 1)
  99. schedule_and_submit.expand_nth_rec(1)
  100. total_transfers_is_correct = schedule_and_submit.ret_total_transfers() == "4"
  101. total_amount_is_correct = schedule_and_submit.ret_total_amount() == "$26.44"
  102. is_from_account1_correct = schedule_and_submit.ret_text_from_account(1) == self.account1
  103. is_to_account1_correct = schedule_and_submit.ret_text_to_account(1) == self.account2
  104. is_amount1_correct = schedule_and_submit.ret_text_amount(1) == "$" + self.amount1
  105. is_date1_correct = len(schedule_and_submit.ret_date(1)) > 0 and schedule_and_submit.ret_date(1) is not \
  106. "Choose above"
  107. is_from_account2_correct = schedule_and_submit.ret_text_from_account(2) == self.account2
  108. is_to_account2_correct = schedule_and_submit.ret_text_to_account(2) == self.account3
  109. is_amount2_correct = schedule_and_submit.ret_text_amount(2) == "$" + self.amount2
  110. is_date2_correct = len(schedule_and_submit.ret_date(2)) > 0 and schedule_and_submit.ret_date(2) is not \
  111. "Choose above"
  112. is_from_account3_correct = schedule_and_submit.ret_text_from_account(3) == self.account3
  113. is_to_account3_correct = schedule_and_submit.ret_text_to_account(3) == self.account2
  114. is_amount3_correct = schedule_and_submit.ret_text_amount(3) == "$" + self.amount3
  115. is_date3_correct = len(schedule_and_submit.ret_date(3)) > 0 and schedule_and_submit.ret_date(3) is not \
  116. "Choose above"
  117. is_from_account4_correct = schedule_and_submit.ret_text_from_account(4) == self.account4
  118. is_to_account4_correct = schedule_and_submit.ret_text_to_account(4) == self.account1
  119. is_amount4_correct = schedule_and_submit.ret_text_amount(4) == "$" + self.amount4
  120. is_date4_correct = len(schedule_and_submit.ret_date(4)) > 0 and schedule_and_submit.ret_date(4) is not \
  121. "Choose above"
  122. schedule_and_submit.expand_nth_rec(1)
  123. is_memo1_displayed = schedule_and_submit.ret_text_of_memo(1) == "MemoMemoMemo"
  124. schedule_and_submit.expand_nth_rec(2)
  125. is_memo2_displayed = schedule_and_submit.ret_text_of_memo(2) == ""
  126. schedule_and_submit.expand_nth_rec(3)
  127. is_memo3_displayed = schedule_and_submit.ret_text_of_memo(3) == ""
  128. schedule_and_submit.expand_nth_rec(4)
  129. is_memo4_displayed = schedule_and_submit.ret_text_of_memo(4) == ""
  130. self.assertTrue(total_amount_is_correct and total_transfers_is_correct and is_from_account1_correct and
  131. is_to_account1_correct and is_date1_correct and is_from_account2_correct and
  132. is_to_account2_correct and is_date2_correct and is_from_account3_correct and
  133. is_to_account3_correct and is_date3_correct and is_from_account4_correct and
  134. is_to_account4_correct and is_amount1_correct and is_amount2_correct and is_amount3_correct and
  135. is_amount4_correct and is_date4_correct and is_memo1_displayed and is_memo2_displayed and
  136. is_memo3_displayed and is_memo4_displayed,
  137. "Checking the information of Schedule & Submit page is displayed correctly")
  138.  
  139. def test_09_draft_transfer(self):
  140. schedule_and_submit = self.current_page
  141. modal = schedule_and_submit.click_draft()
  142. self.__class__.current_page = modal
  143. is_title_correct = modal.get_modal_title() == "Transfers Drafted"
  144. is_modal_text_color_correct = modal.get_modal_color() == "rgba(228, 225, 4, 1)"
  145. is_modal_text_correct = modal.get_modal_text() == "Your funds transfers have been drafted but still require approval." \
  146. " Go to Activity Center to view or approve these transactions."
  147. is_modal_amount_correct = "$26.44" in modal.get_multi_draft_amount()
  148. is_batch_id_correct = len(modal.get_multi_wire_modal_data("Batch ID:")) > 0
  149. is_from_correct = "4 accounts" in modal.get_multi_wire_modal_data("From:")
  150. is_to_correct = "3 accounts" in modal.get_multi_wire_modal_data("To:")
  151. is_download_link_present = modal.is_multi_draft_download_link_present()
  152. self.assertTrue(is_modal_text_correct and is_modal_text_color_correct and is_batch_id_correct and is_from_correct and
  153. is_modal_amount_correct and is_title_correct and is_to_correct and
  154. is_download_link_present, "Checking that the approve modal information is correct")
  155.  
  156. def test_10_go_to_activity_center(self):
  157. modal = self.current_page
  158. modal.go_to_activity_center()
  159. activity_center = activity_center_page.ActivityCenterPage(self.driver)
  160. self.__class__.current_page = activity_center
  161. activity_center.wait_for_page_to_load()
  162. is_first_transaction_not_expanded = not activity_center.is_row_expanded(1)
  163. is_second_transaction_not_expanded = not activity_center.is_row_expanded(2)
  164. is_third_transaction_not_expanded = not activity_center.is_row_expanded(3)
  165. is_fourth_transaction_not_expanded = not activity_center.is_row_expanded(4)
  166. self.assertTrue(activity_center.is_activity_center_page_loaded and is_first_transaction_not_expanded and
  167. is_second_transaction_not_expanded and is_third_transaction_not_expanded and
  168. is_fourth_transaction_not_expanded, "Checking that the Activity Center got loaded")
  169.  
  170. def test_11_ac_transfers_title_info(self):
  171. activity_center = self.current_page
  172. is_header_date_valid = len(activity_center.return_header_date()) > 0
  173. are_header_approvals_correct = activity_center.return_header_approvals() == "0 of 1"
  174. is_header_status_correct = activity_center.return_header_status() == "Drafted"
  175. is_transaction_type_correct = "Funds Transfer" in activity_center.return_header_trans_type()
  176. is_account_correct = self.account4 in activity_center.return_header_account()
  177. is_amount_correct = activity_center.return_header_amount() == "$" + self.amount4
  178. is_header_date2_valid = len(activity_center.return_header_date(2)) > 0
  179. are_header_approvals2_correct = activity_center.return_header_approvals(2) == "0 of 1"
  180. is_header_status2_correct = activity_center.return_header_status(2) == "Drafted"
  181. is_transaction_type2_correct = "Funds Transfer" in activity_center.return_header_trans_type(2)
  182. is_account2_correct = self.account3 in activity_center.return_header_account(2)
  183. is_amount2_correct = activity_center.return_header_amount(2) == "$" + self.amount3
  184. is_header_date3_valid = len(activity_center.return_header_date(3)) > 0
  185. are_header_approvals3_correct = activity_center.return_header_approvals(3) == "0 of 1"
  186. is_header_status3_correct = activity_center.return_header_status(3) == "Drafted"
  187. is_transaction_type3_correct = "Funds Transfer" in activity_center.return_header_trans_type(3)
  188. is_account3_correct = self.account2 in activity_center.return_header_account(3)
  189. is_amount3_correct = activity_center.return_header_amount(3) == "$" + self.amount2
  190. is_header_date4_valid = len(activity_center.return_header_date(4)) > 0
  191. are_header_approvals4_correct = activity_center.return_header_approvals(4) == "0 of 1"
  192. is_header_status4_correct = activity_center.return_header_status(4) == "Drafted"
  193. is_transaction_type4_correct = "Funds Transfer" in activity_center.return_header_trans_type(4)
  194. is_account4_correct = self.account1 in activity_center.return_header_account(4)
  195. is_amount4_correct = activity_center.return_header_amount(4) == "$" + self.amount1
  196. self.assertTrue(is_header_date_valid and are_header_approvals_correct and is_header_status_correct and
  197. is_transaction_type_correct and is_account_correct and is_amount_correct and
  198. is_header_date2_valid and are_header_approvals2_correct and is_header_status2_correct and
  199. is_transaction_type2_correct and is_account2_correct and is_amount2_correct and
  200. is_header_date3_valid and are_header_approvals3_correct and is_header_status3_correct and
  201. is_transaction_type3_correct and is_account3_correct and is_amount3_correct and
  202. is_header_date4_valid and are_header_approvals4_correct and is_header_status4_correct and
  203. is_transaction_type4_correct and is_account4_correct and is_amount4_correct,
  204. "Checking that the header fields are correct")
  205.  
  206. def test_12_verify_fourth_trans_body(self):
  207. activity_center = self.current_page
  208. activity_center.scroll_the_page(0,'document.body.scrollHeight')
  209. activity_center.expand_nth_item(4)
  210. is_tracking_id_correct = len(activity_center.return_tracking_id()) > 0
  211. is_batch_id_correct = len(activity_center.return_batch_id()) > 0
  212. is_created_date_valid = len(activity_center.return_created_date1()) > 0
  213. is_created_by_correct = activity_center.return_created_by() == self.user_name
  214. is_process_date_valid = len(activity_center.return_process_date()) > 0
  215. is_amount_correct = activity_center.return_item_amount() == "$" + self.amount1
  216. is_memo_msg_correct = "MemoMemoMemo" in activity_center.return_item_description()
  217. is_from_account_correct = self.account1 in activity_center.return_item_from_account()
  218. is_to_account_correct = self.account2 in activity_center.return_item_to_account()
  219. self.assertTrue(is_tracking_id_correct and is_batch_id_correct and is_created_by_correct and
  220. is_created_date_valid and is_process_date_valid and
  221. is_amount_correct and is_from_account_correct and is_memo_msg_correct and is_to_account_correct,
  222. "Checking that the transaction information in the activity center is correct")
  223.  
  224.  
  225. def test_13_transaction_boxes_activity_center(self):
  226. activity_center = self.current_page
  227. is_drafted_box_correct = activity_center.is_trans_fld_present('Drafted')
  228. is_approvals_box_present = activity_center.is_trans_fld_present('Approval(s)')
  229. is_authorized_box_present = activity_center.is_trans_fld_present('Authorized')
  230. is_processed_box_present = activity_center.is_trans_fld_present('Processed')
  231. is_draft_box_data_valid = activity_center.is_trans_fld_data_present('Drafted', 'AutoMultiTaxOne asfg')
  232. is_approve_box_data_correct = 'Pending' in activity_center.get_trans_fld_data('Approval(s)', '1.')
  233. authorized_box_does_not_have_data = not activity_center.trans_fld_has_data('Authorized')
  234. processes_box_does_not_have_data = not activity_center.trans_fld_has_data('Processed')
  235. self.assertTrue(is_drafted_box_correct and is_approvals_box_present and is_authorized_box_present and
  236. is_processed_box_present and is_draft_box_data_valid and is_approve_box_data_correct and
  237. authorized_box_does_not_have_data and processes_box_does_not_have_data,
  238. "Checking that all the transaction boxes are present and their information is correct")
  239.  
  240. def test_14_go_to_notify(self):
  241. activity_center = self.current_page
  242. activity_center.click_actions_link(4)
  243. self.activity_center.click_actions_menu_item("Notify")
  244. is_there_a_user_disabled = self.activity_center.check_if_user_disabled('AutoMulitTax Two')
  245. self.assertTrue(is_there_a_user_disabled, "Checking that there is a disabled user and an enabled user")
  246.  
  247. '''
  248. def test_20_select_user_to_notify_and_send(self):
  249. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  250. self.activity_center.select_user('AutoMulitTax Two')
  251. self.activity_center.click_send()
  252. is_modal_color_correct = modal_page.ModalPage(self.driver).return_title_color() == 'rgba(0, 154, 64, 1)'
  253. self.assertTrue(is_modal_color_correct, "Checking that the notifications were sent successfully")
  254.  
  255. def test_21_approve_payment(self):
  256. modal_page.ModalPage(self.driver).click_close_modal()
  257. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  258. self.activity_center.wait_for_page_to_load()
  259. self.activity_center.click_actions_link()
  260. self.activity_center.click_actions_menu_item("Approve")
  261. is_modal_color_correct = modal_page.ModalPage(self.driver).return_title_color() == 'rgba(228, 225, 4, 1)'
  262. is_modal_title_correct = modal_page.ModalPage(self.driver).return_title_modal() == 'Approve Transaction'
  263. is_modal_text_correct = modal_page.ModalPage(self.driver).return_text_modal() == 'Are you sure you want to approve this transaction?'
  264. self.assertTrue(is_modal_color_correct and is_modal_text_correct and is_modal_title_correct,
  265. "Checking that the confirm approval modal is shown correctly")
  266.  
  267. def test_23_verify_successful_approval(self):
  268. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  269. self.activity_center.click_confirm()
  270. self.modal_functions = modal_page.ModalPage(self.driver)
  271. is_title_correct = self.modal_functions.return_title_modal() == 'Approval Successful'
  272. is_modal_color_correct= self.modal_functions.return_title_color() == 'rgba(0, 154, 64, 1)'
  273. is_amount_correct = self.tracking_id + " ($" + self.amount2 +")" in self.activity_center.return_modal_trans_info()
  274. self.assertTrue(is_modal_color_correct and is_title_correct and is_amount_correct, "Checking that the successful modal is shown correctly")
  275.  
  276. def test_24_verify_transaction_status(self):
  277. modal_page.ModalPage(self.driver).click_close_modal()
  278. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  279. self.activity_center.wait_for_page_to_load()
  280. is_header_status_correct = self.activity_center.return_header_status() == 'Authorized'
  281. self.assertTrue(is_header_status_correct, "Checking that the header status is now approved")
  282.  
  283. def test_25_copy_payment(self):
  284. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  285. self.activity_center.click_actions_link()
  286. self.activity_center.click_actions_menu_item("Copy")
  287. payment_setup_page = set_up_wires_page.SetupWirePage(self.driver, "domestic wire")
  288. self.__class__.current_page = payment_setup_page
  289. self.assertTrue(payment_setup_page.is_page_loaded(), "Checking that the payments page got loaded")
  290.  
  291. def test_26_review_page(self):
  292. payment_setup_page = self.current_page
  293. review_and_submit_page = payment_setup_page.click_next_button()
  294. self.__class__.current_page = review_and_submit_page
  295. review_and_submit_page.wait_for_page_to_load()
  296. self.assertTrue(review_and_submit_page.is_page_loaded, "Checking that the review and submit page is loaded")
  297.  
  298. def test_27_validate_review_page_overview(self):
  299. review_and_submit_page = self.current_page
  300. is_num_of_payments_correct = review_and_submit_page.get_num_of_payments_overview() == 1
  301. is_num_of_payments_with_currency_correct = review_and_submit_page.get_num_of_payments_with_currency_in_overview() == '1 (USD)'
  302. is_tot_amount_correct = review_and_submit_page.get_total_amt_in_overview() == '$' + self.amount2
  303. is_send_payment_as_correct = review_and_submit_page.get_send_payment_as_str() == '1 subsidiaries'
  304. is_from_account_correct = review_and_submit_page.get_txt_frm_acc_overview() == '1 accounts'
  305. review_and_submit_page.get_num_of_payments_with_currency_in_overview() == '1 (USD)'
  306. review_and_submit_page = self.current_page
  307. review_and_submit_page.expand_nth_rec()
  308. is_num_correct = review_and_submit_page.ret_num_nth_rec() == 1
  309. is_name_correct = review_and_submit_page.ret_name_nth_rec() == self.recipient2
  310. is_account_id_correct = 'DW1234' in review_and_submit_page.ret_account_id_nth_rec()
  311. is_amount_correct = review_and_submit_page.ret_amount_nth_rec() == "$" + self.amount2
  312. is_subsidiary_correct = review_and_submit_page.ret_subs_nth_rec() == self.subsidiary1
  313. is_from_acc_correct = review_and_submit_page.ret_frm_acc_num_nth_rec() == self.account2
  314. is_notify_correct = review_and_submit_page.ret_notify_nth_rec() == 'No'
  315. is_process_date_correct = review_and_submit_page.ret_process_date_nth_rec() == time.strftime("%m/%d/%Y")
  316. is_orig_account_correct = self.account2 in review_and_submit_page.ret_orig_ben_data_nth_rec('From:')
  317. is_orig_amount_correct = review_and_submit_page.ret_orig_ben_data_nth_rec('Amount:') == "$" + self.amount2
  318. is_benef_rec_correct = review_and_submit_page.ret_orig_ben_data_nth_rec('To:') == self.recipient2
  319. is_benef_rec_account_correct = 'DW1234' in review_and_submit_page.ret_orig_ben_data_nth_rec('Account:')
  320. is_benef_routing_num_correct = review_and_submit_page.ret_orig_ben_data_nth_rec('Routing Number:') == '211291666'
  321. is_beneficiary_name_correct = review_and_submit_page.ret_orig_ben_data_nth_rec('Beneficiary:') == 'NEW HAMPSHIRE FCU'
  322. is_benef_address_correct = review_and_submit_page.ret_beneficiary_full_address() == '70 AIRPORT RD CONCORD, NH 03301-5297'
  323. self.assertTrue(is_num_of_payments_correct and is_num_of_payments_with_currency_correct and
  324. is_send_payment_as_correct and is_from_account_correct and is_tot_amount_correct and
  325. is_num_correct and is_name_correct and is_account_id_correct and is_amount_correct and
  326. is_subsidiary_correct and is_from_acc_correct and is_notify_correct and is_process_date_correct and
  327. is_orig_account_correct and is_orig_amount_correct and is_benef_rec_correct and
  328. is_benef_rec_account_correct and is_benef_routing_num_correct and is_beneficiary_name_correct and
  329. is_benef_address_correct, "Checking that the review page information is correct")
  330.  
  331. def test_28_approve_payment(self):
  332. review_submit_page = self.current_page
  333. modal = review_submit_page.click_approve()
  334. self.__class__.current_page = modal
  335. is_gear_displayed = modal.is_gear_displayed()
  336. is_wire_process_msg_correct = 'Your transactions have been received and are being processed.' in modal.get_modal_processing_msg()
  337. is_wire_process_title_correct = modal.get_modal_processing_title() == 'Wire Processing'
  338. is_title_correct = modal.get_modal_title() == 'Payments Approved'
  339. is_success_icon_displayed = modal.is_success_icon_displayed()
  340. is_modal_text_color_correct = modal.get_modal_text_color() == 'rgba(0, 154, 64, 1)'
  341. is_modal_text_correct = modal.get_modal_text() == 'Your payments have been approved.'
  342. is_modal_amount_correct = modal.get_multi_approve_amount() == '1 (USD): $' + self.amount2
  343. is_batch_id_correct = len(modal.get_multi_wire_modal_data("Batch ID:")) > 0
  344. is_to_correct = self.recipient2 in modal.get_multi_wire_modal_data("To Account:")
  345. is_created_by_correct = 'AutoMultiWire One' in modal.get_multi_wire_modal_data("Created By:")
  346. is_download_link_present = modal.is_multi_approve_download_link_present()
  347. self.assertTrue(is_gear_displayed and is_wire_process_title_correct and is_success_icon_displayed and is_title_correct and
  348. is_modal_text_correct and is_modal_amount_correct and is_modal_text_color_correct and
  349. is_batch_id_correct and is_to_correct and is_created_by_correct and is_download_link_present and
  350. is_wire_process_msg_correct, "Checking that the approve modal information is correct")
  351.  
  352. def test_29_go_to_activity_center(self):
  353. modal = self.current_page
  354. modal.go_to_activity_center()
  355. self.activity_center = activity_center_page.ActivityCenterPage(self.driver)
  356. self.__class__.current_page = self.activity_center
  357. self.activity_center.wait_for_page_to_load()
  358. is_transaction_not_expanded = not self.activity_center.is_row_expanded()
  359. is_header_status_correct = self.activity_center.return_header_status() == 'Authorized'
  360. self.assertTrue(self.activity_center.is_activity_center_page_loaded and is_transaction_not_expanded and
  361. is_header_status_correct,"Checking that the Activity Center got loaded")
  362.  
  363. def test_30_go_to_cancel(self):
  364. self.activity_center = self.current_page
  365. self.activity_center.click_actions_link()
  366. self.activity_center.click_actions_menu_item("Cancel")
  367. is_modal_color_correct = modal_page.ModalPage(self.driver).return_title_color() == 'rgba(228, 225, 4, 1)'
  368. is_modal_title_correct = modal_page.ModalPage(self.driver).return_title_modal() == 'Cancel Transaction'
  369. is_modal_text_correct = modal_page.ModalPage(self.driver).return_text_modal() == 'Are you sure you want to cancel this transaction?'
  370. self.assertTrue(is_modal_color_correct and is_modal_title_correct and is_modal_text_correct, "Checking that the cancel confirmation modal is shown correctly")
  371.  
  372. def test_31_confirm_cancel_modal(self):
  373. self.activity_center = self.current_page
  374. self.activity_center.click_confirm()
  375. self.modal_functions = modal_page.ModalPage(self.driver)
  376. is_title_correct = self.modal_functions.return_title_modal() == 'Transaction Cancelled'
  377. is_modal_info_correct = '($' + self.amount2 + '): Cancelled' in self.activity_center.return_modal_trans_info()
  378. is_modal_color_correct = self.modal_functions.return_title_color() == 'rgba(0, 154, 64, 1)'
  379. self.assertTrue(is_modal_color_correct and is_modal_info_correct and is_title_correct,
  380. "Checking that the successful modal is shown correctly")
  381.  
  382. def test_32_verify_transaction_status(self):
  383. modal_page.ModalPage(self.driver).click_close_modal()
  384. self.activity_center = self.current_page
  385. self.activity_center.wait_for_page_to_load()
  386. is_header_status_correct = self.activity_center.return_header_status() == 'Cancelled'
  387. is_trans_box_approval_fld_correct = 'AutoMultiWire One - Cancelled' in self.activity_center.get_trans_fld_data('Approval(s)', "2.")
  388. self.assertTrue(is_header_status_correct and is_trans_box_approval_fld_correct, "Checking that the header status is now cancelled")
  389. '''
  390.  
  391. def test_33_log_off(self):
  392. self.menu = main_page.Menu(self.driver)
  393. self.menu.open_menu_item('Log Off')
  394. login = login_page.LoginPage(self.driver)
  395. self.__class__.current_page = login
  396. login.wait_for_page_to_load()
  397. self.assertTrue(login.is_login_page_loaded(), "Checking that the user logged off correctly")
  398.  
  399. def setUp(self):
  400. self.util.set_up(self)
  401.  
  402. def tearDown(self):
  403. self.util.tear_down(self)
  404.  
  405. @classmethod
  406. def tearDownClass(cls):
  407. cls.util.close_the_browser(cls.driver)
  408.  
  409. if __name__ == '__main__':
  410. if len(sys.argv) == 2:
  411. MultiTransferApproveRecurring.ENV = sys.argv.pop()
  412. if len(sys.argv) == 3:
  413. MultiTransferApproveRecurring.BROWSER = sys.argv.pop()
  414. MultiTransferApproveRecurring.ENV = sys.argv.pop()
  415. with open('test-reports/junit.xml', 'wb') as output:
  416. unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output),
  417. failfast=False, buffer=False, catchbreak=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement