def setUp(self): try: TestCase_Base.setUp(self) log("Start to verify if RT is signed in or not") if self.RT.is_sign_in: log("RT has been signed in already, start to sign out") self.RT.sign_out() op.launch_RT_before_running_case() self.RT.remove_all_from_cloud_view() # test clip self.test_name = "Download.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) assert os.path.isfile( self.test_case_path), "The media file doesn't exist in '" + self.test_case_path + "'" # upload clip to cloud assert helper.upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" assert_step(self.RT.switch_to_all_view()) # share the clip to account_username2 assert_step(self.RT.share_media_in_library_view(["Download"])) op.switch_to_account() log("after sign in") except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name = "Download.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) self.test_album = "TestAlbum" # upload clip to cloud assert upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" # create an album assert create_collection_via_API(self.test_album), "Fail to create album '" + self.test_album + "'' via API" # add medias into album assert add_to_collection(self.test_album, get_title_of_file(self.test_name)), "Fail to add media files into album '" + self.test_album + "' via API" log("Start to verify if RT is signed in or not") if self.RT.is_sign_in: log("RT has been signed in already, start to sign out") self.RT.sign_out() op.launch_RT_before_running_case() except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) log("launch RT") op.launch_RT_before_running_case() # test clip test_name = "Download.mp4" test_case_path = os.path.join( test_content_path, "original", test_name) assert os.path.isfile(test_case_path), "Fail to find media file '" + test_case_path + "'" # upload clip to cloud assert helper.upload_video_via_API( test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" time.sleep(2) # go to cloud tab assert_step(self.RT.switch_to_cloud_view()) assert self.RT.does_exist_in_library( download_video_item, 'Download', default_wait_time), \ "Fail to find test clip '" + download_video_item + "' in cloud view" except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) op.launch_RT_before_running_case() except: TestCase_Base.tearDown(self) raise
def test_upload_notification(self): # test clip self.test_name_video = "Upload_WebAPI.AVI" self.test_case_path = prepare_content( "1805", False, self.test_name_video) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) # add test clip into local library log("Add test clip into local library") assert_step(self.RT.add_to_my_library(self.test_case_path)) # upload video to cloud log("Upload a video to cloud") assert self.RT.does_exist_in_library(upload_video_item, 'Upload', default_wait_long_time) self.RT.upload_video(upload_video_item, 'Upload') if osx_version == "10.10": region.onAppear(upload_complete_notification_10_10, handler) elif osx_version == "10.9": region.onAppear(upload_complete_notification_10_9, handler) region.observe(default_wait_long_time) assert TestCase_1805.got_notification, "'Upload Complete' notification doesn't show up" # verify upload by calling cloud API log("Verify upload by calling cloud API") assert wait_for_upload_complete( get_title_of_file(self.test_name_video)), "Fail to find test clip '" + self.test_name_video + "' from cloud side after uploading it in library"
def test_CreateAlbum(self): log("test_CreateAlbum: Start...") try: log("test_CreateAlbum: Start Sign in process.") op.launch_RT_before_running_case() log("test_CreateAlbum: Sign in successfully.") log("test_CreateAlbum: Create Album.") op.create_album() log("test_CreateAlbum: Create Album and add item to Album successfully.") log("test_CreateAlbum: Verify the Album from CloudAPI.") wait_for_upload_complete("test") log("test_CreateAlbum: The Album is created successfully.") except Exception as ex: log("test_CreateAlbum: failed with exception: %s" % __builtin__.type(ex).__name__) log(traceback.format_exc()) raise except: log("test_CreateAlbum: Unknown exception occur, Details:.") log(traceback.format_exc()) raise else: log("test_CreateAlbum: ends successfully without exception occur.")
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name_video = "Upload.AVI" self.test_case_path = prepare_content("1828", False, self.test_name_video) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # prepare test content self.test_name = "Play_local.mp4" self.test_case_path = prepare_content( "1824", False, self.test_name) self.player = Player(region) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name_video1 = "Upload_transfer_1.mp4" self.test_name_video2 = "Upload_transfer_2.mp4" self.test_case_path = prepare_content( "1792", True, self.test_name_video1, self.test_name_video2) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # prepare test content self.test_image_name = "MediaScan.JPG" self.test_image_full_path = os.path.join(test_content_path, "original", self.test_image_name) if os.path.exists(os.path.join(picture_root_folder, self.test_image_name)): os.remove(os.path.join(picture_root_folder, self.test_image_name)) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) self.test_files = ["Playback_1_1.mp4", "Playback_2_1.mp4", "Playback_3_1.mp4"] # test clip self.test_case_path = prepare_content( "1826", False, *self.test_files) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # prepare test content self.test_name = "Upload_transfer_1.mp4" self.test_case_path = prepare_content( "1799_step2", False, self.test_name) self.player = Player(region) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: capture_screen(self.screenshot) raise
def setUp(self): try: TestCase_Base.setUp(self) log("Start to verify if RT is signed in or not") if self.RT.is_sign_in: log("RT has been signed in already, start to sign out") self.RT.sign_out() op.launch_RT_before_running_case() self.RT.remove_all_from_cloud_view() op.create_album() assert_step(self.RT.share_album(test_album_item, "test")) op.switch_to_account2() except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name = "Download.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) # upload clip to cloud assert upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" op.launch_RT_before_running_case() except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_files = ["share_video_1.mp4", "share_video_2.mp4"] # upload test files to cloud upload_video_files_via_API(*self.test_files) log("Start to verify if RT is signed in or not") if self.RT.is_sign_in: log("RT has been signed in already, start to sign out") self.RT.sign_out() op.launch_RT_before_running_case() except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # prepare test content self.test_name = "Upload.AVI" self.test_image_name = "MediaScan.JPG" self.test_case_path = prepare_content( "1789", False, self.test_name) op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) # add test clip into local library log("Add test clip into local library, in order to add path '" + self.test_case_path + "' into 'Media Library'") assert_step(self.RT.add_to_my_library(self.test_case_path)) except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name = "Download.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) # upload clip to cloud assert upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" log("Start to verify if RT is signed in or not") if self.RT.is_sign_in: log("RT has been signed in already, start to sign out") self.RT.sign_out() op.launch_RT_before_running_case() except: TestCase_Base.tearDown(self) raise
def setUp(self): try: TestCase_Base.setUp(self) # test clip self.test_name = "Upload_transfer_1.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) self.player = Player(region) # upload clip to cloud log("Start to upload media file to cloud") assert upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_name + "' via API" op.launch_RT_before_running_case() assert_step(self.RT.remove_all_from_mymac_view()) except: TestCase_Base.tearDown(self) raise
def test_download_notification(self): log("test_DownloadNotification: Start...") try: log("test_DownloadNotification: upload a video via API") self.test_name = "Download.mp4" self.test_case_path = os.path.join( test_content_path, "original", self.test_name) assert upload_video_via_API( self.test_case_path), "Fail to upload test clip '" + self.test_case_path + "' via API" log("test_DownloadNotification: Start Sign in process.") op.launch_RT_before_running_case() log("test_DownloadNotification: Sign in successfully.") log("Verify the video have been uploaded.") assert self.RT.does_exist_in_library( download_video_item, 'Download', default_wait_time), \ "Fail to find thumbnail of test clip '" + self.test_name + "' in library" log("Download the video.") time.sleep(5) assert_step(self.RT.download_video(download_video_item, 'Download')) log("Wait the Download complete notification appear.") if osx_version == "10.10": assert region.exists(download_complete_notification_10_10, default_wait_long_time), "'Download video complete' notification doesn't show up" elif osx_version == "10.9": assert region.exists(download_complete_notification_10_9, default_wait_long_time), "'Download video complete' notification doesn't show up" except Exception as ex: log("test_DownloadNotification: failed with exception: %s" % __builtin__.type(ex).__name__) log(traceback.format_exc()) raise except: log("test_DownloadNotification: Unknown exception occur, Details:.") log(traceback.format_exc()) raise else: log("test_DownloadNotification: ends successfully without exception occur.")
def _create_story(self): op.launch_RT_before_running_case() log("Remove all items first") assert_step(self.RT.remove_all()) # test clip self.test_files = ["Playback_1_1.mp4", "Playback_1_2.mp4", "Playback_2_1.mp4", "Playback_2_2.mp4", "Playback_3_1.mp4", "Playback_3_2.mp4"] # upload test files to cloud upload_video_files_via_API(*self.test_files) # switch to cloud view assert_step(self.RT.switch_to_cloud_view()) # verify upload self._check_items_exists() log("Switch to 'Stories -> Suggested' view") self.RT.switch_to_stories_suggested_view() log("Verify whether suggested story exists or not") assert region.exists(suggested_story_icon, default_wait_time), "Fail to find 'Suggested story icon' in 'Stories -> Suggested' view"