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) 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): # launch rt for switch cloud env helper.log("TestCase_Base setUp starts.") helper.log("Current test is *** " + self._testMethodName + " ***") self.screenshot = self._testMethodName + "_" + helper.get_time_stamp() + ".png" try: helper.log("Cleanup diagnostic report files") helper.cleanup_diagnostic_report_folders() helper.log("region: %s" % region) self.RT = RT(region) self.RT.launch() # handle warning dialog helper.log("TestCase_Base setUp: %s" % "Handle warning dialog, only appear when first launch") op.first_launch_RT() helper.log("set cloud env to " + str(env)) self.SysTray = SystemTray(top_menu_bar_region) self.SysTray.switch_cloud_env(env) time.sleep(5) helper.kill_RT() helper.kill_rpds() self.RT.launch() # clean up all content in cloud helper.log("Clean up all content in cloud.") assert helper.cleanup_cloud_content_via_API( ), "Fail to cleanup all test content via cloud API" # clean up download folder helper.log("Clean up 'Download' folder") helper.cleanup_cloud_download_folder() # upload init.mp4 for cloud helper.log("Upload 'init.mp4' to cloud") assert helper.upload_video_via_API( os.path.join(test_content_path, "original", "init.mp4")), \ "Fail to upload 'init.mp4' to cloud" except Exception, ex: helper.log("TestCase_Base setUp failed with exception:") helper.log("Exception occur: %s" % ex.message) raise