Ejemplo n.º 1
0
def suspend():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('TC suspend sale with loyalty number')

    y = l_test_settings[0]
    general_functions.fill_basket(str(y[0]), y[1])
    # select loyalty client by loyalty number

    general_buttons.main_page_footer_menu_btns_click('CUSTOMER')
    general_buttons.main_page_customer_menu_btns_click('LOYALTY NUMBER SEARCH')

    type(y[4])
    type(Key.ENTER)
    type(Key.ENTER)
    type(Key.ENTER)

    general_functions.extended_wait('payment_page_key_pad_TOTAL', 30)
    general_buttons.main_page_key_pad_btns_click('TOTAL')

    receipt_meta_data_array = general_functions.get_receipt_meta_data()

    general_buttons.hamburger_click('HAMBURGER')
    general_buttons.hamburger_basket_menu_btns_click('SUSPEND')

    type(Key.ENTER)

    general_functions.end_of_test_case()
Ejemplo n.º 2
0
def remove():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('remove promotion')

    general_functions.fill_basket(l_test_settings[0], l_test_settings[1])
    wait(5)

    # select first line item
    Location(254, 214).click()

    general_buttons.basket_page_edit_line_item_click('REMOVE PROMOTION')

    general_buttons.item_editing_key_pad_btns_click('END EDITING')

    general_buttons.basket_page_key_pad_btns_click('TOTAL')

    receipt_meta_data_array = general_functions.get_receipt_meta_data()

    general_functions.pay_transaction_with_multiple_tenders([['VISA', 'REST']])

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('payment_screen')

    wait(1)

    # type(Key.ENTER)

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('main_page')

    general_functions.end_of_test_case()
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()
Ejemplo n.º 4
0
def line_items():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('commission sale line item')

    general_functions.fill_basket(l_test_settings[0], l_test_settings[1])

    # select first line item
    Location(254, 214).click()

    general_buttons.main_page_key_pad_btns_click('SALES PERSON')

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('sales_person_search')

    sleep(2)
    type(Key.ENTER)
    sleep(2)
    type(Key.ENTER)
    # general_functions.pause_test_case_msg()

    # select first line item
    Location(254, 214).click()

    general_buttons.main_page_key_pad_btns_click('SALES PERSON')

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('select_sales_person')

    sleep(2)
    type(Key.ENTER)
    sleep(2)
    type(Key.DOWN)
    type(Key.ENTER)
    # general_functions.pause_test_case_msg()

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    receipt_meta_data_array = general_functions.get_receipt_meta_data()
    if brand == 'TH':  # TH has zalando as tender
        general_functions.pay_transaction_with_multiple_tenders(
            [['MAESTRO', 'REST']])
    else:
        general_functions.pay_transaction_with_multiple_tenders(
            [['MAESTRO', 'REST']])

    general_functions.end_of_test_case()
Ejemplo n.º 5
0
def transaction():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('commission sale line transaction')

    general_functions.fill_basket(l_test_settings[0], l_test_settings[1])
    # select first line item
    general_buttons.main_page_key_pad_btns_click('SALES PERSON')
    type(Key.ENTER)
    type(Key.ENTER)

    # general_buttons.click_element_in_region('basket_page_key_pad_end_editing', 100, 100, 'END EDITING btn', general_functions.get_key_pad_area(), 0.7)

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    receipt_meta_data_array = general_functions.get_receipt_meta_data()
    general_functions.pay_transaction_with_multiple_tenders(
        [['MAESTRO', 'REST']])

    general_functions.end_of_test_case()
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
def issue_tax_form_basic_sale_any_tender():
    y = l_test_settings[0]

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case(
        'Issue tax form on basic sale paid with ' +
        str('card AMEX, paying exact amount.'))

    # fil basket and press total button
    wait(0.1)
    general_functions.fill_basket(y[0], y[1])
    #wait(0.1)
    general_buttons.main_page_key_pad_btns_click('TOTAL')

    # select the Other button to go to Issue tax form button
    wait(0.1)
    general_buttons.payment_page_footer_menu_btns_click('OTHER')

    # select the Issue tax form button
    #wait(0.1)
    general_buttons.payment_page_other_menu_btns_click('ISSUE TAX FREE')

    # 'Verify steps after this point ', 'are ok now.'
    #general_functions.show_value__msg('Tax free form requested', 'Global Blue form pulled up to be ready')
    wait(0.5)
    general_functions.extended_wait('payment_page_key_pad', 30)
    #wait(0.1)
    general_functions.get_receipt_meta_data()
    wait(1)
    general_functions.pay_transaction_with_multiple_tenders([['AMEX', 'REST']])

    # select the OK button to show the Issue tax form
    wait(1)
    click(Location(810, 584))
    wait(1)
    general_functions.extended_wait('TFF', 30)

    # Enter at least mandatory fields: country and tender
    # 'Verify steps after this point ', 'are ok now.'
    #general_functions.show_value__msg('Verify steps after this point ', 'are ok now.')

    # mandatory field1: select a country
    # click area
    #DE#click(Location(200, 490))
    #BE#
    click(Location(200, 470))
    type('1')
    type(Key.DOWN)
    type(Key.ENTER)

    # mandatory field2: select a tender
    # click area
    #DE#click(Location(535, 235))
    #BE#
    click(Location(580, 220))
    type('4')
    type(Key.DOWN)
    type(Key.ENTER)

    # select the Yes button to submit the Issue tax form
    ##
    wait(1)
    ##
    type(Key.ALT + 'y')

    ##
    wait(16)
    # general end of test case
    general_functions.end_of_test_case()
Ejemplo n.º 8
0
locale = l_general_test_settings[8]
global l_base_dir
l_base_dir = l_general_test_settings[10]
global is_gui_test
is_gui_test = l_general_test_settings[11]
global country
country = l_general_test_settings[13]
global l_test_settings
l_test_settings = test_settings.tax_free_test_settings()

global l_test_aftersales_settings
#l_test_settings = test_settings.basic_sale_off_line_card_test_settings(locale)
l_test_aftersales_settings = test_settings.tax_free_aftersales_test_settings()

global receipt_meta_data_array
receipt_meta_data_array = general_functions.get_receipt_meta_data()


def issue_tax_form_basic_sale_any_tender():
    y = l_test_settings[0]

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case(
        'Issue tax form on basic sale paid with ' +
        str('card AMEX, paying exact amount.'))

    # fil basket and press total button
    wait(0.1)
    general_functions.fill_basket(y[0], y[1])
    #wait(0.1)
    general_buttons.main_page_key_pad_btns_click('TOTAL')
Ejemplo n.º 9
0
def gv_sale():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('gift voucher sale and redemption')

    wait(10)

    general_buttons.main_page_footer_menu_btns_click('ITEMS GV')

    general_buttons.main_page_items_gv_menu_btns_click('GIFT VOUCHER SALE')

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('sale_gift_voucher')

    type(l_test_settings[0])

    type(Key.ENTER)

    general_functions.extended_wait("payment_page_key_pad_TOTAL", 300)

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    general_functions.extended_wait("payment_page_key_pad", 300)

    # general_functions.pause_test_case_msg()

    receipt_meta_data_array = general_functions.get_receipt_meta_data()
    print('receipt_meta_data_array: ' + str(receipt_meta_data_array))

    r = Region(165, 183, 221, 21)
    r.highlight(2)
    evaluation_string = r.text()

    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("I", "1")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("O", "0")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("o", "0")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("|", "1")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("l", "1")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace(" ", "")
    print("evaluation str " + evaluation_string)
    evaluation_string = evaluation_string.replace("?", "9")
    print("evaluation str " + evaluation_string)

    gv_number = evaluation_string
    print("gv number " + gv_number)

    general_functions.writeTestResults("gift voucher number", "", gv_number,
                                       "", "", "", "", "")

    if brand == "CK":
        general_functions.general_message_with_subject(
            'Check the GV number', 'The GV number we found is ' + gv_number +
            '. If this not the correct number please write the correct nunmber down on a piece of paper'
        )

    general_functions.pay_transaction_with_multiple_tenders(
        [['CHINA UNION PAY', 'REST']])

    general_functions.fill_basket(l_test_settings[2], l_test_settings[3])

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    general_functions.pay_transaction_with_multiple_tenders(
        [['GIFT VOUCHER', gv_number, 'REST']])

    general_functions.end_of_test_case()
Ejemplo n.º 10
0
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()
Ejemplo n.º 11
0
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()