def test_acceptance_simple_open_mysky(): """Open MySky app and navigate Automates: https://interactiveqa.testrail.net/index.php?/cases/view/20 Automates: https://interactiveqa.testrail.net/index.php?/cases/view/22 """ itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) mysky_frame_objects.open_and_check_mysky() # Navigate menus: stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.MANAGE_YOUR_ACCOUNT), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.MANAGE_YOUR_ACCOUNT) stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.FIX_A_PROBLEM), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.FIX_A_PROBLEM) stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.YOUR_FORECAST), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.YOUR_FORECAST) stbt.press('KEY_UP') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.FIX_A_PROBLEM), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.FIX_A_PROBLEM) stbt.press('KEY_UP') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.MANAGE_YOUR_ACCOUNT), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.MANAGE_YOUR_ACCOUNT) stbt.press('KEY_UP') assert stbt.wait_until(lambda: MySkyMainMenu().message == sky_plus_strings.EXPLORE_MORE), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.EXPLORE_MORE) finally: itu.clear_test()
def test_smoke_open_mysky(): """Open MySky app""" itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) mysky_frame_objects.open_and_basic_check_mysky() finally: itu.clear_test()
def button_exits_test(button): """Open MySky app and close it with the given button""" itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) open_and_basic_check_mysky() # Press the button: stbt.press(button) assert stbt.wait_until(lambda: not MySkyMainMenu().is_visible), \ '[MySky] MySky menu did not close'
def open_developer_mode(): """Open Developer mode""" itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) mysky_frame_objects.open_and_basic_check_mysky() sleep(0.5) itu.open_secret_scene() itu.enter_menu(SecretSceneMainMenu, sky_plus_strings.SS_DEVELOPER_MODE) dev_mode_menu = stbt.wait_until(DeveloperModeMenu) assert dev_mode_menu.title == sky_plus_strings.SS_VCN, \ '[Developer Mode] Selected item is not [{0}]'.format(sky_plus_strings.SS_VCN)
def test_acceptance_simple_my_account_yellow_button(): """Open My Account menu and go back to MySky main menu Automates: https://interactiveqa.testrail.net/index.php?/cases/view/27 """ itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) mysky_frame_objects.open_and_basic_check_manage_your_account() stbt.press('KEY_YELLOW') sleep(1) mysky_frame_objects.basic_check_mysky() finally: itu.clear_test()
def test_smoke_open_my_account(): """Open MySky app""" itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) itu.open_and_basic_check_interactive_menu() itu.enter_menu(InteractiveMainMenu, sky_plus_strings.MY_ACCOUNT, timeout_secs=20) menu = stbt.wait_until(MyAccountMenu, timeout_secs=20) assert menu.is_visible, '[My Account] Menu is not visible' finally: itu.clear_test()
def test_smoke_trigger_open(): """Open MySky app""" itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) match_result = wait_for_match(TRIGGER_IMAGE, timeout_secs=15, region=TRIGGER_REGION) assert match_result.match, '[Trigger] Could not find trigger icon' stbt.press('KEY_GREEN') sleep(5) for i in range(10): frame = stbt.get_frame() # Save image for testing manually later cv2.imwrite('trigger_screen_{0}.jpg'.format(i), frame) finally: itu.clear_test()
def test_acceptance_simple_my_account_navigation(): """Open My Account menu and navigate Automates: https://interactiveqa.testrail.net/index.php?/cases/view/26 """ itu.clear_test() try: itu.go_to_channel(interactive_constants.CHANNEL_SKY_ONE_HD) menu = mysky_frame_objects.open_and_basic_check_manage_your_account() # Navigate menus: stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.PACKAGE_AND_SETTINGS), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.PACKAGE_AND_SETTINGS) stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.DETAILS_AND_MESSAGES), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.DETAILS_AND_MESSAGES) stbt.press('KEY_DOWN') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.EXPLORE_MORE), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.EXPLORE_MORE) stbt.press('KEY_UP') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.DETAILS_AND_MESSAGES), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.DETAILS_AND_MESSAGES) stbt.press('KEY_UP') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.PACKAGE_AND_SETTINGS), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.PACKAGE_AND_SETTINGS) stbt.press('KEY_UP') assert stbt.wait_until(lambda: ManageYourAccountMenu().message == sky_plus_strings.BILLS_AND_PAYMENTS), \ '[MySky] Selected item is not [{0}]'.format(sky_plus_strings.BILLS_AND_PAYMENTS) # Check images: menu_items = menu.menu_items item = [ x for x in menu_items if x.text == sky_plus_strings.BILLS_AND_PAYMENTS ][0] match_result = match(MYA_BILLS_PAYMENTS, frame=menu._frame, region=item.region) debug('match_result: {0}{1}'.format(match_result.match, match_result.first_pass_result)) item = [ x for x in menu_items if x.text == sky_plus_strings.PACKAGE_AND_SETTINGS ][0] match_result = match(MYA_PACKAGE_SETTINGS, frame=menu._frame, region=item.region) debug('match_result: {0}{1}'.format(match_result.match, match_result.first_pass_result)) item = [ x for x in menu_items if x.text == sky_plus_strings.DETAILS_AND_MESSAGES ][0] match_result = match(MYA_DETAILS_MESSAGES, frame=menu._frame, region=item.region) debug('match_result: {0}{1}'.format(match_result.match, match_result.first_pass_result)) item = [ x for x in menu_items if x.text == sky_plus_strings.EXPLORE_MORE ][0] match_result = match(MYA_MY_OFFERS, frame=menu._frame, region=item.region) debug('match_result: {0}{1}'.format(match_result.match, match_result.first_pass_result)) finally: itu.clear_test()