Example #1
0
    def test_download_to_device_smoke(self, set_capabilities, setup_logging):
        """
        Verify the following senarios:
        check if download to device toggel off
        click on toggle
        if allow/deny permission popup appears
        check allow, deny and permission elements
        click on allow button
        check and click on progress wheel
        """

        global_contents = Globals(setup_logging)
        android_video_dashboard = AndroidVideoDasboard(set_capabilities,
                                                       setup_logging)
        assert android_video_dashboard.check_videos_status(
            set_capabilities, strings.VIDEO_ICON_ONLINE_STATUS)

        if global_contents.get_element_by_id(
                set_capabilities,
                android_elements.video_dashboard_bulk_download_toggle).text \
                == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_OFF:

            global_contents.get_element_by_id(
                set_capabilities,
                android_elements.video_dashboard_bulk_download_toggle).click()

            if global_contents.get_by_class_from_elements(
                    set_capabilities,
                    android_elements.video_download_permission_buttons,
                    global_contents.first_existence):

                assert global_contents.get_by_class_from_elements(
                    set_capabilities, android_elements.video_download_permission_buttons,
                    global_contents.first_existence).text \
                        == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON

                assert global_contents.get_by_class_from_elements(
                    set_capabilities,
                    android_elements.video_download_permission_message,
                    global_contents.first_existence)

                assert global_contents.get_by_class_from_elements(
                    set_capabilities,
                    android_elements.video_download_permission_buttons,
                    global_contents.second_existence
                ).text == strings.VIDEO_DOWNLOAD_PERMISSION_DENY_BUTTON

                global_contents.get_by_class_from_elements(
                    set_capabilities,
                    android_elements.video_download_permission_buttons,
                    global_contents.first_existence).click()

        global_contents.wait_and_get_element(
            set_capabilities, android_elements.video_dahboard_video_icon)

        assert global_contents.get_element_by_id(
            set_capabilities, android_elements.video_dahboard_video_icon)
    def test_video_download_smoke(self, set_capabilities, setup_logging):
        """
        Verify the following scenario:
        check all videos are downloading
        wait for all videos to download
        check all videos are downloaded
        turn off toggel and check all video are deleted
        Check single subsection video is downloaded
        """

        global_contents = Globals(setup_logging)
        android_video_dashboard = AndroidVideoDasboard(set_capabilities,
                                                       setup_logging)
        # commenting this case until get the updated ID's from Dev team
        # assert android_video_dashboard.check_videos_status(set_capabilities,
        #                                                    strings.VIDEO_ICON_DOWNLOADING_STATUS)
        assert android_video_dashboard.wait_for_all_videos_to_download(set_capabilities) \
            == strings.VIDEO_DASHBOARD_ALL_VIDEOS_DOWNLOADED
        assert android_video_dashboard.check_videos_status(
            set_capabilities, strings.VIDEO_ICON_DOWNLOADED_STATUS)
        assert global_contents.get_element_by_id(
            set_capabilities,
            android_elements.video_dashboard_bulk_download_toggle).text \
            == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_ON

        global_contents.get_element_by_id(
            set_capabilities,
            android_elements.video_dashboard_bulk_download_toggle).click()

        assert global_contents.get_element_by_id(
            set_capabilities,
            android_elements.video_dashboard_bulk_download_toggle).text \
            == strings.VIDEO_DASHBOARD_DOWNLOAD_TOGGEL_OFF

        assert android_video_dashboard.wait_for_all_videos_to_delete(set_capabilities) \
            == strings.VIDEO_DASHBOARD_TV_TITLE
        assert android_video_dashboard.check_videos_status(
            set_capabilities, strings.VIDEO_ICON_ONLINE_STATUS)

        global_contents.wait_and_get_element(
            set_capabilities,
            android_elements.video_dashboard_download_section).click()
        # commenting this case until get the updated ID's from Dev team
        # assert android_video_dashboard.check_videos_status(set_capabilities,
        #                                                    strings.VIDEO_ICON_DOWNLOADING_STATUS)
        assert android_video_dashboard.wait_for_all_videos_to_download(set_capabilities) \
            == strings.VIDEO_DASHBOARD_ALL_VIDEOS_DOWNLOADED
        assert android_video_dashboard.check_videos_status(
            set_capabilities, strings.VIDEO_ICON_DOWNLOADED_STATUS)