def local_employee_discount_transaction(settings_index): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('employee discount on transaction') general_functions.extended_wait("main_page_key_pad", 300) settings_for_this_test = l_test_settings[settings_index] general_functions.fill_basket(settings_for_this_test[0], settings_for_this_test[1]) general_buttons.basket_page_footer_menu_btns_click('DISCOUNTS') add_employee(settings_for_this_test) # add employee data # test_cases.does_part_of_screen_exist('employee_search_screen', 0.5, 'are all elements on the employee_search_screen OK') # test_cases.does_part_of_screen_exist('employee_discount_btns', 0.5, 'are the right buttons present in the employee discount menu?') general_buttons.basket_page_employee_discounts_menu_btns_click( 'EMPLOYEE TRANSACTION DISCOUNT') general_buttons.basket_page_employee_percentage_discounts_menu_btns_click( settings_for_this_test[5]) # click TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') wait(3) # general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 30) general_functions.pay_transaction_with_multiple_tenders( [['DINERS', 'REST']]) general_functions.end_of_test_case()
def pick_up(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('pick up') l_general_test_settings = test_settings.general_test_settings() general_buttons.main_page_footer_menu_btns_click('OTHER') general_buttons.main_page_other_menu_btns_click('PICK UP') general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) time.sleep(6) for x in range(0, l_general_test_settings[9]): time.sleep(0.5) number_of_items = l_test_settings type(str(number_of_items[x])) time.sleep(0.5) type(Key.ENTER) time.sleep(0.5) general_functions.writeTestResults("def pick up", "GUI", "data", str(x), "", "number of denominations", "", "") x += 1 general_buttons.pick_up_page_click('TAKE OVER') type(Key.ENTER) general_functions.close_drawer_msg()
def with_loyalty_number(): general_functions.start_of_test_case('returns without receipt with loyalty number') # add items to be returned returns_with_out_receipt_add_return_items() wait(1) # customer add loyalty number general_buttons.basket_page_returns_footer_menu('CUSTOMER btn', 200, 0) general_buttons.click_element('basket_page_customer_menu', -200, -70, 'ENTER LOYALTY NUMBER btn') type(l_test_settings[2]) type(Key.ENTER) type(Key.ENTER) general_buttons.click_element('basket_page_customer_loyalty_menu', 70, -70, 'ENTER VOUCHER NUMBER btn') type(l_test_settings[3]) type(Key.ENTER) type(Key.ENTER) general_buttons.click_element('secondary_pages_key_pad', 100, 100, 'TOTAL btn') receipt_meta_data_array = general_functions.get_receipt_meta_data() general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) type(Key.ENTER) general_functions.pay_transaction_with_tender([['tender','MAESTRO']]) # general end of test case general_functions.end_of_test_case()
def no_sale(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('no sale') wait(1) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('main_page') general_buttons.main_page_footer_menu_btns_click('OTHER') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('other_screen') general_buttons.main_page_other_menu_btns_click('NO SALE') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('open_drawer_select_reason') general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) type(Key.ENTER) wait(2) general_functions.close_drawer_msg() general_functions.end_of_test_case()
def finish_returns(): # finish return general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 30) general_functions.pay_transaction_with_multiple_tenders([['VISA', 'REST']])
def item_not_found(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case( 'TC item not found all divisions test ') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('main_page') time.sleep(5) if is_gui_test == 'YES': # for the GUI test 1 division is enough number_of_divisions = 1 else: number_of_divisions = l_test_settings[0] for div in range(0, number_of_divisions): general_buttons.main_page_items_gv_menu_btns_click('ITEM NOT FOUND') if div == 0: # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('item_not_found') division = "DIV " + str(div + 1) print('division: ' + str(division)) general_buttons.main_page_items_gv_menu_item_not_found_btns_click( division) type("123456789") type(Key.ENTER) amount = 50 + div type(str(amount) + ".00") type(Key.ENTER) # click the TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 60) general_functions.pay_transaction_with_multiple_tenders(l_test_settings[1]) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('main_page') # general end of test case general_functions.end_of_test_case()
def EOD(): general_buttons.click_element_in_region( 'main_page_footer_menu', 70, 0, 'OTHER btn', general_functions.get_footer_menu_area(), 0.7) general_buttons.click_element_in_region( 'main_page_other_menu_btns', 200, -70, 'END OF DAY btn', general_functions.get_menu_buttons_area(), 0.7) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.close_drawer_msg()
def custom(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('item not found all divisions') l_general_test_settings = test_settings.general_test_settings() locale = l_general_test_settings[8] brand = l_general_test_settings[6] transactions = test_settings.custom(locale) # test_cases.item_not_found_tc_0010("does the main screen look OK?") time.sleep(5) for transaction in transactions: general_buttons.main_page_items_gv_menu_btns_click('ITEM NOT FOUND') division = transaction[0] print('division: ' + division) general_buttons.main_page_items_gv_menu_item_not_found_btns_click( division) type(transaction[1]) type(Key.ENTER) type(transaction[2]) type(Key.ENTER) # click the TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 60) general_functions.pay_transaction_with_multiple_tenders(transaction[3]) general_functions.extended_wait('main_page_key_pad', 60) # general end of test case general_functions.end_of_test_case()
def returns_with_receipt_and_exchange(): general_functions.start_of_test_case('returns with receipt and exchange') receipt_number = general_functions.make_test_receipts( l_test_settings[0], l_test_settings[1]) print('receipt_number: ' + receipt_number) general_functions.extended_wait('main_page_key_pad', 30) returns_with_receipt_return_items(receipt_number) # click SEARCH ITEM button general_buttons.main_page_key_pad_btns_click('ITEM SEARCH') # move to next line on search form type(Key.ENTER) # article number type(l_test_settings[0]) # click SEARCH button # article_search_form_en_GB.png" general_buttons.click_element('article_search_form', 300, 40, 'search btn') # add product(s) z = 0 print('number of products: ' + str(l_test_settings[1])) while z < l_test_settings[1] - 2: general_buttons.click_element('add_or_substract_product', 100, 0, 'PLUS btn') z += 1 print('z: ' + str(z)) general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.extended_wait('four_eyes_form', 60) # In case of italy there is no 4 eyes if l_general_test_settings[13] != 'IT': general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 60) general_functions.pay_transaction_with_multiple_tenders( [['DINERS', 'REST']]) general_functions.end_of_test_case()
def cancel_receipt(): general_functions.errorhandling("ABORT") l_test_settings = test_settings.void_tender_type_settings(locale) l_general_test_settings = test_settings.general_test_settings() x = 0 while x < len(l_test_settings): y = l_test_settings[x] print("y: " + str(y)) general_functions.fill_basket(y[0], y[1]) if y[5]== 1: # cancel before the total button is clicked general_buttons.click_element('secondary_pages_key_pad', 190, -100, 'CANCEL btn') else: # click TOTAL button general_buttons.click_element('secondary_pages_key_pad', 100, 100, 'TOTAL btn') receipt_meta_data_array = general_functions.get_receipt_meta_data() general_buttons.click_element('secondary_pages_key_pad_after_TOTAL', 190, -100, 'CANCEL TRANSACTION btn') general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) test_cases.errors_and_warnings_tc_0030("does the cancellation warning pop up") # confirm cancelation type(Key.ENTER) # use all cancelation reasons y_coordinaat = (160 + (x * 50)) * -1 print("y_coordinaat: " + str(y_coordinaat)) general_buttons.click_element('cancelation_reasons', 0, y_coordinaat, 'CANCEL REASON btn') # confirm reason type(Key.ENTER) x = x + 1 print("x: " + str(x)) if x == 3: break
def drop_off(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('drop off') general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) time.sleep(6) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('drop_off') for x in range(0, l_general_test_settings[9]): time.sleep(0.5) number_of_items = l_test_settings type(str(number_of_items[x])) time.sleep(0.5) type(Key.ENTER) time.sleep(0.5) general_functions.writeTestResults("def drop_off", "GUI", "data", str(x), "", "number of denominations", "", "") x += 1 general_buttons.drop_off_page_click('TAKE OVER') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('drop_off_overview') type(Key.ENTER) general_functions.close_drawer_msg() # general end of test case general_functions.end_of_test_case()
def non_merchandise_sale(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('non merchandise sale all types') general_functions.extended_wait("main_page_key_pad", 300) print('length: ' + str(len(l_test_settings))) for transaction in l_test_settings: general_buttons.main_page_items_gv_menu_btns_click( 'NON MERCHANDISE SALE') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('non_merchandise_sale_footer') general_buttons.main_page_items_gv_menu_non_merchandise_sale_btns_click( transaction[0]) wait(0.5) # enter price type(str(transaction[1])) # confirm type(Key.ENTER) # click TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') wait(2) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) wait(2) general_functions.pay_transaction_with_multiple_tenders([['AMEX', 'REST']]) general_functions.end_of_test_case()
def returns_with_receipt(): general_functions.start_of_test_case('returns with receipt line items') receipt_number = general_functions.make_test_receipts( l_test_settings[0], l_test_settings[1]) print('receipt_number: ' + receipt_number) general_functions.extended_wait('main_page_key_pad', 30) returns_with_receipt_return_items(receipt_number) if l_general_test_settings[13] != 'IT': general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 30) general_functions.pay_transaction_with_multiple_tenders( [['CHINA UNION PAY', 'REST']]) general_functions.end_of_test_case()
def cancel_receipt(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('TC cancel receipt all reasons') x = 0 while x < len(l_test_settings): y = l_test_settings[x] print("y: " + str(y)) # wait for the main screen to be there general_functions.extended_wait('main_page_key_pad', 30) general_functions.fill_basket(y[0], y[1]) if y[2] == 1: # cancel before the total button is clicked general_functions.start_of_test_case( 'cancel receipt before total button is clicked') receipt_meta_data_array = general_functions.get_receipt_meta_data() general_buttons.main_page_key_pad_btns_click('CANCEL') else: # cancel after the total button is clicked # click TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.start_of_test_case( 'cancel receipt after total button is clicked') receipt_meta_data_array = general_functions.get_receipt_meta_data() # this is actually the CANCEL TRANSACTION button but it's in the same location as the CANCEL button general_buttons.main_page_key_pad_btns_click('CANCEL') general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) #general_functions.general_message_with_subject('test', 'cancellation_warning') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('cancellation_warning') # confirm cancellation type(Key.ENTER) # short wait to get cancellation reason screen in focus wait(0.5) # use all cancelation reasons # general_functions.general_message_with_subject('test', 'cancellation_reasons') wait(5) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('cancellation_reasons') button_name = 'LIST ITEM ' + str(x + 1) print('cancel reason: ' + button_name) general_buttons.click_in_list(button_name) # confirm reason type(Key.ENTER) x = x + 1 print("x: " + str(x)) if x == 3: break # to return to the main screen wait(10) general_functions.end_of_test_case()
def manual_discount_tr(): general_functions.errorhandling("ABORT") general_functions.extended_wait("main_page_key_pad", 300) print('length: ' + str(len(l_test_settings))) x = 0 while x < len(l_test_settings): print('x: ' + str(x)) y = l_test_settings[x] print('y: ' + str(y)) # get article general_functions.fill_basket(y[0], y[1]) # click DISCOUNT buttons general_buttons.basket_page_footer_menu_btns_click('DISCOUNTS') # click ITEM DISCOUNT% button general_buttons.basket_page_discounts_menu_btns_click( 'TRANSACTION DISCOUNT TENDER') # enter discount discount = y[2] print('discount: ' + str(discount)) type(str(discount)) # confirm type(Key.ENTER) if x < 10: # first page with reasons # click discount reason general_buttons.return_reasons_click('return reason ' + str(x + 1)) print('return reason: ' + 'return reason ' + str(x + 1)) # confirm reason type(Key.ENTER) else: if x == 10: print("reason 11") type(Key.RIGHT) type(Key.ENTER) else: print("reason 12") type(Key.RIGHT) type(Key.DOWN) type(Key.ENTER) print("x: " + str(x)) # click TOTAL button general_buttons.main_page_key_pad_btns_click('TOTAL') general_functions.start_of_test_case('manual discount on transaction') wait(5) # general_functions.extended_wait('four_eyes_form', 60) general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) general_functions.extended_wait('payment_page_key_pad', 30) general_functions.pay_transaction_with_multiple_tenders( [['MAESTRO', 'REST']]) general_functions.end_of_test_case() x = x + 1 general_functions.end_of_test_case()
def pay_in(): general_functions.errorhandling("ABORT") general_functions.start_of_test_case('pay in') general_functions.extended_wait("main_page_key_pad", 300) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('main_page') for z in range(0, l_test_settings[0]): general_buttons.main_page_footer_menu_btns_click('OTHER') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('other_screen') general_buttons.main_page_other_menu_btns_click('PAY-IN') # four eyes authorization general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) # select pay_out reason print('list item: ' + 'LIST ITEM ' + str(z + 1)) general_buttons.click_in_list('LIST ITEM ' + str(z + 1)) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('pay_in_reasons') # confirm reason type(Key.ENTER) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('pay_in_total_amount_screen') # amount that's payed out type(str(z + 1) + '.00') # confirm amount type(Key.ENTER) wait(3) receipt_meta_data_array = general_functions.get_receipt_meta_data() # click CASH button general_buttons.pay_out_key_pad_click('CASH') # confirm pay out type(Key.ENTER) general_functions.close_drawer_msg() general_functions.start_of_test_case('pay in ' + 'LIST ITEM ' + str(z + 1)) z = +1 general_functions.start_of_test_case('cancel pay in') general_buttons.main_page_footer_menu_btns_click('OTHER') # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('other_screen') general_buttons.main_page_other_menu_btns_click('PAY-IN') # four eyes authorization general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) # select and confirm pay out reason # general_functions.general_message('select pay out reason') type(Key.ENTER) # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('pay_in_reasons') # type amount that's payed out # general_functions.general_message('type amount that's payed out') type("9.99") # TEST CASE if is_gui_test == 'YES': gui_screens.check_gui_element('pay_in_total_amount_screen') # confirm amount # general_functions.general_message('confirm amount') type(Key.ENTER) wait(3) # get receipt data and save it receipt_meta_data_array = general_functions.get_receipt_meta_data() # click CANCEL TRANSACTION button # general_functions.general_message('CANCEL') general_buttons.basket_page_key_pad_btns_click('CANCEL') # four eyes authorization general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5]) type(Key.ENTER) type(Key.ENTER) # general_functions.general_message('end of payout') general_functions.end_of_test_case()