def test_acceptance_simple_yellow_button_exits():
    """Open MySky app and close it with the yellow button"""
    itu.clear_test()
    try:
        mysky_frame_objects.button_exits_test('KEY_YELLOW')
    finally:
        itu.clear_test()
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 test_acceptance_simple_backup_button_exits():
    """Open MySky app and close it with the back up button
    Automates: https://interactiveqa.testrail.net/index.php?/cases/view/23
    """
    itu.clear_test()
    try:
        mysky_frame_objects.button_exits_test('KEY_BACKUP')
    finally:
        itu.clear_test()
def setup_backend(env_code):
    """Open Developer mode"""
    itu.clear_test()
    try:
        open_developer_mode()
        stbt.press(env_code)
        sleep(2)
    finally:
        itu.clear_test()
def test_setup_enable_hd():
    """Enable HD"""
    itu.clear_test()
    try:
        open_developer_mode()
        itu.enter_menu(DeveloperModeMenu,
                       sky_plus_strings.SSD_ENABLE_HD,
                       timeout_secs=20)
        sleep(2)
    finally:
        itu.clear_test()
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()
示例#8
0
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 setup_vcn(vcn):
    """Set fake VCN"""
    itu.clear_test()
    try:
        debug('[SETTING VCN]: {0}'.format(vcn))
        open_developer_mode()
        stbt.press('KEY_UP')
        sleep(5)
        # pylint: disable=unused-variable
        for i in range(0, 9):
            stbt.press('KEY_LEFT')
            sleep(0.1)
        itu.press_digits(vcn)
        sleep(5)
        stbt.press('KEY_DOWN')
        # pylint: disable=stbt-unused-return-value
        stbt.wait_until(SecretSceneMainMenu)
    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()