def returns_with_out_receipt_item_not_found_and_exchange():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('returns without receipt item not found and exchange')
    # add items to be returned
    returns_with_out_receipt_add_return_items()

    # 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
    general_buttons.article_search_form_btns_click('SEARCH')

    general_functions.extended_wait('basket_page_key_pad', 30)

    # finish returns
    returns_with_receipt.finish_returns()

    # general end of test case
    general_functions.end_of_test_case()
示例#2
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()
def local_employee_discount_line_item(settings_index):

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('employee discount on line item')
    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)

    general_buttons.basket_page_employee_discounts_menu_btns_click(
        'EMPLOYEE ITEM DISCOUNT')

    general_buttons.basket_page_employee_percentage_discounts_menu_btns_click(
        settings_for_this_test[4])

    # click TOTAL button
    general_buttons.main_page_key_pad_btns_click('TOTAL')
    wait(3)
    general_functions.extended_wait('four_eyes_form', 60)

    general_functions.extended_wait('payment_page_key_pad', 30)
    # general_functions.four_eyes(l_general_test_settings[4], l_general_test_settings[5])
    general_functions.pay_transaction_with_tender([['tender', 'DINERS']])

    general_functions.end_of_test_case()
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 bonus_buys():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('bonus buys')

    l_test_settings = test_settings.bonus_buys()

    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])
        general_buttons.main_page_key_pad_btns_click('TOTAL')
        general_functions.pay_transaction_with_multiple_tenders([['ALIPAY', 'REST']])

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

        wait(1)

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


        x += 1

    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']])
示例#7
0
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()
示例#8
0
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 basic_sale_chf_to_eur():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('convert CHF to EUR basic sale')

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

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    general_buttons.payment_page_footer_menu_btns_click('OTHER TENDERS')
    
    general_buttons.payment_page_other_tenders_menu_btns_click('ZALANDO')

    general_functions.extended_wait('payment_page_key_pad', 1)

    general_functions.pay_transaction_with_multiple_tenders([['CASH', 'REST']])
    
    # general end of test case
    general_functions.end_of_test_case()
示例#10
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()
示例#11
0
def bonus_buys():

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('bonus buys')

    l_test_settings = test_settings.bonus_buys(locale)

    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])
        general_buttons.main_page_key_pad_btns_click('TOTAL')
        general_functions.pay_transaction_with_multiple_tenders([['MAESTRO', 'REST']])

        x += 1

    general_functions.end_of_test_case()
示例#12
0
def add():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('TC add loyalty number')

    print(str(l_test_settings))

    for test_data in l_test_settings:
        general_functions.start_of_test_case('TC add loyalty number ' +
                                             test_data[5])

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

        general_buttons.main_page_footer_menu_btns_click('CUSTOMER')

        # click ENTER LOYALTY NUMBER button
        general_buttons.main_page_customer_menu_btns_click(
            'ENTER LOYALTY NUMBER')

        type(test_data[2])
        type(Key.ENTER)
        wait(1)
        type(Key.ENTER)
        wait(2)

        # click ENTER VOUCHER NUMBER button

        general_buttons.main_page_customer_menu_btns_click(
            'ENTER VOUCHER NUMBER')
        type(test_data[3])
        type(Key.ENTER)
        wait(1)
        type(Key.ENTER)
        wait(2)

        general_functions.extended_wait('payment_page_key_pad_TOTAL', 30)

        general_buttons.main_page_key_pad_btns_click('TOTAL')
        general_functions.extended_wait('payment_page_key_pad', 30)
        general_functions.pay_transaction_with_multiple_tenders(test_data[4])

        # 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()
示例#14
0
def remove():
    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('TC remove loyalty number')

    y = l_test_settings[0]
    general_functions.fill_basket(str(y[0]), y[1])

    general_buttons.main_page_footer_menu_btns_click('CUSTOMER')

    # click ENTER LOYALTY NUMBER button
    general_buttons.main_page_customer_menu_btns_click('ENTER LOYALTY NUMBER')

    type(y[2])
    type(Key.ENTER)
    wait(1)
    type(Key.ENTER)
    wait(2)

    # click ENTER VOUCHER NUMBER button

    general_buttons.main_page_customer_menu_btns_click('ENTER VOUCHER NUMBER')
    type(y[3])
    type(Key.ENTER)
    wait(1)
    type(Key.ENTER)
    wait(2)

    general_functions.extended_wait('payment_page_key_pad_TOTAL', 30)
    general_buttons.main_page_key_pad_btns_click('TOTAL')
    type(Key.ENTER)
    wait(2)

    # remove loyalty
    general_buttons.main_page_footer_menu_btns_click('CUSTOMER')

    general_buttons.main_page_customer_menu_btns_click('REMOVE LOYALTY')
    type(Key.ENTER)

    general_functions.pay_transaction_with_multiple_tenders(y[4])

    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
示例#16
0
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()
示例#17
0
def basic_sale_off_line_card():
    general_functions.errorhandling("ABORT")

    l_general_test_settings = test_settings.general_test_settings()
    locale = l_general_test_settings[8]
    l_test_settings = test_settings.global_blue_transactions(locale)

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('basic sale paid with ' + y[2])

    wait(1)

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

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    general_buttons.payment_page_other_menu_btns_click('ISSUE TAX FREE')

    type(Key.ENTER)

    general_functions.extended_wait('payment_page_key_pad', 30)
    general_functions.pay_transaction_with_multiple_tenders([y[2], 'REST']])
示例#18
0
def make_test_receipts(article, number_of_articles):

    valid_receipt = False
    while not valid_receipt:
        fill_basket(article, number_of_articles)
        receipt_meta_data_array = get_receipt_meta_data()
        receipt_number = receipt_meta_data_array[0]
        print('invalid receipt_number: ' + receipt_number)
        valid_receipt = receipt_number.isnumeric()
        if valid_receipt:
            # show_value__msg('Is this indeed a valid receipt number:', receipt_meta_data_array) #was marked out before in the 4.0 version of 20190306 JP put on yesterday afternoon #marked again as issue is due to basic sales are ran yesterday
            break
        general_buttons.main_page_key_pad_btns_click('CANCEL')
        four_eyes(l_general_test_settings[4], l_general_test_settings[5])
        type(Key.ENTER)
        type(Key.ENTER)
        extended_wait('main_page_key_pad', 30)

    general_buttons.main_page_key_pad_btns_click('TOTAL')

    pay_transaction_with_multiple_tenders([['VISA', 'REST']])
    return receipt_number
def local_employee_discount_remove_transaction_discount(settings_index):

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case(
        'employee discount remove transaction discount')
    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

    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])

    general_buttons.basket_page_footer_menu_btns_click('DISCOUNTS')

    general_buttons.basket_page_employee_discounts_menu_btns_click(
        'REMOVE TRANSACTION DISCOUNT')

    type(Key.ENTER)
    # type(Key.ENTER)

    # test_cases.does_part_of_screen_exist('discount_is_removed_but_the_employee_isnt', 0.7, 'is the line item discount removed and is the employee still there')

    # click TOTAL button
    general_buttons.main_page_key_pad_btns_click('TOTAL')
    wait(5)
    general_functions.extended_wait('payment_page_key_pad', 30)
    general_functions.pay_transaction_with_tender([['tender', 'MAESTRO']])
    type(Key.ENTER)
    general_functions.end_of_test_case()
示例#20
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 local_employee_discount_remove_employee(settings_index):

    general_functions.errorhandling("ABORT")
    general_functions.start_of_test_case('employee discount remove employee')
    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

    general_buttons.basket_page_employee_discounts_menu_btns_click(
        'EMPLOYEE ITEM DISCOUNT')

    general_buttons.basket_page_employee_percentage_discounts_menu_btns_click(
        settings_for_this_test[5])

    general_buttons.basket_page_footer_menu_btns_click('DISCOUNTS')

    general_buttons.basket_page_employee_discounts_menu_btns_click(
        'REMOVE EMPLOYEE')

    type(Key.ENTER)

    # test_cases.does_part_of_screen_exist('employee_and_discount_are_removed', 0.7, 'are employee and discount removed')

    # click TOTAL button
    general_buttons.main_page_key_pad_btns_click('TOTAL')
    wait(5)
    general_functions.extended_wait('payment_page_key_pad', 30)
    general_functions.pay_transaction_with_multiple_tenders(
        [['WECHAT', '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()
示例#23
0
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')
示例#24
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()
示例#25
0
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()
示例#26
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()
示例#27
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()
示例#28
0
def cancel_receipt():
    general_buttons.main_page_key_pad_btns_click('CANCEL')
    four_eyes(l_general_test_settings[4], l_general_test_settings[5])
    type(Key.ENTER)
    type(Key.ENTER)
    extended_wait('main_page_key_pad', 30)
示例#29
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()