def run_check(json_metadata, browser, add_food_item_idx=2): TEST_ERR_MSG = 'test failed at TID_016' food_menu_po = food_menu.Main(browser) cart_page_po = cart_page.Main(browser) item_add_page_po = item_add_page.Main(browser) # escape from cart list page from 015 # todo: remove me # cart_page_po.tapTopLeftCloseButton() # assertCheckPoint(browser, 'TID_016_1', TEST_ERR_MSG) # add another food cart_page_po.tapBottomBarMenuButton() food_menu_po.tapFoodItemByIdx(add_food_item_idx) assertCheckPoint(browser, 'TID_016_2', TEST_ERR_MSG) item_add_page_po.addFood() assertCheckPoint(browser, 'TID_016_3', TEST_ERR_MSG) item_add_page_po.tapAddIntoCartButton() sleep(5) assertCheckPoint(browser, 'TID_016_4', TEST_ERR_MSG, 0.055) food_menu_po.tapCartButton() assertCheckPoint(browser, 'TID_016_5', TEST_ERR_MSG) cart_page_po.tapRemoveButton(1) assertCheckPoint(browser, 'TID_016_6', TEST_ERR_MSG) json_metadata['TID_016'] = 'passed'
def run_check(json_metadata, browser, number_of_people_to_split): TEST_ERR_MSG='test failed at TID_025' food_menu_po=food_menu.Main(browser) cart_page_po = cart_page.Main(browser) item_add_page_po=item_add_page.Main(browser) # please_take_seat_first_dialogue_po=please_take_seat_first_dialogue.Main(browser) # item_add_page_po=item_add_page.Main(browser) assertCheckPoint(browser, 'TID_025_1', TEST_ERR_MSG) sleep(0.5) order_history_with_order_po = order_history_page.WithOrder(browser) for i in range(1,number_of_people_to_split+1): order_history_with_order_po.updateNumberOfPeople(i) assertCheckPoint(browser, 'TID_025_2_{}'.format(i), TEST_ERR_MSG) # [Question] when the bill split more than 2 people, the "price per people" rounded down # tap ok to dismiss dialogue # please_take_seat_first_dialogue_po.tapOkButtonOnDialogue() assertCheckPoint(browser, 'TID_025_2', TEST_ERR_MSG) json_metadata['TID_025'] = 'passed'
def user_had_placed_few_orders(self, food_item_idx=1, food_item_qty=1): self.tapFoodMenuIcon() self.tapFoodItemByIdx(food_item_idx) item_add_page_po = item_add_page.Main(self.driver) for i in range(0, food_item_qty + 1): item_add_page_po.addFood() item_add_page_po.tapAddIntoCartButton()
def run_check(json_metadata, browser): TEST_ERR_MSG = 'It should increase the quantity of the food item' # line_up_po = line_up_page.Main(browser) # dialogue_po= line_up_confirmation_dialogue.Main(browser) item_add_page_po = item_add_page.Main(browser) assertCheckPoint(browser, 'TID_011_1', TEST_ERR_MSG) item_add_page_po.removeFood() assertCheckPoint(browser, 'TID_011_2', TEST_ERR_MSG) json_metadata['TID_011'] = 'passed'
def run_check(json_metadata, browser, food_idx=1): TEST_ERR_MSG = 'It should increase the quantity of the food item' # line_up_po = line_up_page.Main(browser) # dialogue_po= line_up_confirmation_dialogue.Main(browser) item_add_page_po = item_add_page.Main(browser) assertCheckPoint(browser, 'TID_012_1_{}'.format(food_idx), TEST_ERR_MSG) item_add_page_po.tapAddIntoCartButton() # sleep to let dialogue gone sleep(3) assertCheckPoint(browser, 'TID_012_2_{}'.format(food_idx), TEST_ERR_MSG, 0.06) json_metadata['TID_012'] = 'passed'
def run_check(json_metadata, browser): TEST_ERR_MSG='test failed at TID_024' food_menu_po=food_menu.Main(browser) cart_page_po = cart_page.Main(browser) item_add_page_po=item_add_page.Main(browser) # please_take_seat_first_dialogue_po=please_take_seat_first_dialogue.Main(browser) # item_add_page_po=item_add_page.Main(browser) assertCheckPoint(browser, 'TID_024_1', TEST_ERR_MSG) sleep(0.5) # tap ok to dismiss dialogue # please_take_seat_first_dialogue_po.tapOkButtonOnDialogue() assertCheckPoint(browser, 'TID_024_2', TEST_ERR_MSG) json_metadata['TID_024'] = 'passed'
def run_check(json_metadata, browser, number_of_people=1): TEST_ERR_MSG='test failed at TID_023' food_menu_po=food_menu.Main(browser) cart_page_po = cart_page.Main(browser) item_add_page_po=item_add_page.Main(browser) # please_take_seat_first_dialogue_po=please_take_seat_first_dialogue.Main(browser) # item_add_page_po=item_add_page.Main(browser) assertCheckPoint(browser, 'TID_023_1', TEST_ERR_MSG) sleep(0.5) order_history_with_order_po = order_history_page.WithOrder(browser) order_history_with_order_po.updateNumberOfPeople(number_of_people) # tap ok to dismiss dialogue # please_take_seat_first_dialogue_po.tapOkButtonOnDialogue() assertCheckPoint(browser, 'TID_023_2', TEST_ERR_MSG) json_metadata['TID_023'] = 'passed'