public void CopyDeleteFileTest() { string path = Path.Combine(folder, "testfile3.txt"); File.Create(path).Close(); path = Path.Combine(folder, "testfile4.txt"); File.Create(path).Close(); FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "testfile3.txt", "testfile4.txt", folder); }
public void CopyDeleteFileTest() { string path = Path.Combine(TestContext.CurrentContext.TestDirectory, "testfile3.txt"); File.Create(path).Close(); path = Path.Combine(TestContext.CurrentContext.TestDirectory, "testfile4.txt"); File.Create(path).Close(); FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "testfile3.txt", "testfile4.txt", TestContext.CurrentContext.TestDirectory); }
/// <summary> /// Methods for this Page. /// </summary> /// <param name="newName">The file new name.</param> /// <returns>Returns this.</returns> public FileUploadPage UploadFile(string newName) { { FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "file-to-upload.txt", newName, this.DriverContext.DownloadFolder + "\\TestFilesToUpload\\", this.DriverContext.DownloadFolder + "\\TestFilesUploaded\\"); this.Driver.GetElement(this.chooseFileButton).SendKeys(this.DriverContext.DownloadFolder + "\\TestFilesUploaded\\" + newName); this.Driver.GetElement(this.uploadFileButton).Click(); this.Driver.IsElementPresent(this.fileUploadedPageHeader, BaseConfiguration.ShortTimeout); } return(this); }
public UploadPage UploadFile(string newName) { if (BaseConfiguration.TestBrowser == BrowserType.Firefox || BaseConfiguration.TestBrowser == BrowserType.Chrome || BaseConfiguration.TestBrowser == BrowserType.RemoteWebDriver) { newName = FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "filetocompare_branch.txt", newName, this.DriverContext.DownloadFolder); this.Driver.GetElement(this.fileUpload).SendKeys(this.DriverContext.DownloadFolder + FilesHelper.Separator + newName); this.Driver.GetElement(this.fileSumbit).Click(); this.Driver.IsElementPresent(this.fileUploadedPageHeader, BaseConfiguration.ShortTimeout); } else { Logger.Info(CultureInfo.CurrentCulture, "Uploading files in browser {0} is not supported", BaseConfiguration.TestBrowser); } return(this); }
} //根据语音音量变化判断是否在录音中 /// <summary> /// 加载会议 /// </summary> public void Loading(string code = null, MeetingDTO meeting = null) { //meeting if (!meeting.IsNull()) { Meeting = meeting; } else if (!code.IsEmpty()) { var result = PlugCoreHelper.ApiUrl.Meeting.MeetingGetCode.GetResult <MeetingDTO, MeetingEditInput>(new MeetingEditInput() { Num = code }); if (result.Code == EnumCode.成功) { Meeting = meeting; } } else if (Meeting.IsNull()) { //else if(Meeting.IsNull()) 全局会议保持 var result = PlugCoreHelper.ApiUrl.Meeting.MeetingInsert.GetResult <MeetingDTO, MeetingEditInput>(new MeetingEditInput() { Id = Guid.Empty, Name = culture.Lang.metName, Descript = culture.Lang.metDescript, Setting = JsonHelper.Serialize(Setting) }); if (result.Code == EnumCode.成功) { Meeting = result.Obj; } } if (Meeting.IsNull() || (!Meeting.IsNull() && (Meeting.Id.IsEmpty() || Meeting.Num.IsEmpty()))) { throw new DbxException(EnumCode.初始失败); } //device Microphones = RecordingHelper.Microphones(); Microphone = Microphones.FirstOrDefault(); //二维码 var codeBitmap = QrCodeHelper.GetCode(string.Format(EngineHelper.Configuration.Settings.GetValue("meetingViewUrl"), Meeting.Id)); MeetingCode = WpfHelper.BitmapToSource(codeBitmap); //本地数据库 var meetingDatabasePath = MeetingHelper.GetMeetingDatabaseFile(Meeting.Id); if (!File.Exists(meetingDatabasePath)) { FilesHelper.CopyFile(MeetingHelper.TemplateDatabaseFilePath, meetingDatabasePath); } //记录字体 RecordFontSize = Setting.FontSize; //同步任务 SyncTask(); //同步状态 SyncUI(EnumTaskStatus.Default); SyncUI(EnumTaskStatus.Init); //远程服务同步任务 AppHelper.ServerObj.MeetingSyncTask(); }