def do_break():
    errorhandling("")
    writeTestResults("def dobreak", "GUI", "", "", "", "", "", "")

    # click the button for the BREAK menu
    general_buttons.click_element('main_page', -470, -280, 'hamburger btn')
    # click the BRWAK button
    general_buttons.click_element('hamburger_menu', 0, -40, 'BREAK btn')
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 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 returns_with_out_receipt_add_return_items():

    x = 0
    while x < 3:

        general_functions.extended_wait('main_page_key_pad', 30)

        general_buttons.main_page_items_gv_menu_btns_click('RETURNS NO RECEIPT')

        wait(2)

        general_buttons.main_page_items_gv_menu_returns_no_receipt_btns_click('ITEM NOT FOUND')

        general_buttons.main_page_items_gv_menu_item_not_found_btns_click('DIV ' + str(x + 1))

        type('1234567890')

        type(Key.ENTER)

        price = (x + 1) * 11

        type(str(price) + ',' + str(price))

        type(Key.ENTER)

        # this is different in italy

        type('1234-1234')

        #END RETURNS
		general_buttons.returns_page_key_pad_btns_click('END RETURNS')

        general_buttons.main_page_key_pad_btns_click('TOTAL')

        general_functions.extended_wait('return_reasons', 30)

        general_buttons.click_element('return_reasons', -70, -30 + (45 * x), 'select return reason')
        type(Key.ENTER)

        x += 1
Exemple #5
0
def void_line_item():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('void line item')

    wait(1)

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

    time.sleep(5)

    print("VOID LINE ITEM")
    # void line item
    general_buttons.click_element('add_or_substract_product', -100, 0,
                                  'PLUS or MINUS btn')
    time.sleep(5)

    #test_cases.void_line_item_tc_0010('is the line item voided ')

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

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    general_functions.extended_wait('payment_page_key_pad', 30)

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

    general_functions.pay_transaction_with_multiple_tenders(l_test_settings[2])

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

    general_functions.end_of_test_case()
def fill_basket(article, number_of_articles):
    errorhandling("ABORT")

    extended_wait('main_page_key_pad', 30)

    # click SEARCH ITEM button
    general_buttons.main_page_key_pad_btns_click('ITEM SEARCH')

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

    # move to next line on search form
    type(Key.ENTER)

    # article number
    type(str(article))

    # click SEARCH button
    general_buttons.article_search_form_btns_click('SEARCH')

    wait(3)

    # add product(s)
    z = 0
    print('number of products: ' + str(number_of_articles))
    while z < number_of_articles - 1:

        general_buttons.click_element('add_or_substract_product', 100, 0,
                                      'PLUS btn')
        z += 1
        print('z: ' + str(z))

    # TEST CASE
    if is_gui_test == 'YES':
        gui_screens.check_gui_element('basket_with_5_products')
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