public override Report GenerateTest() { var testResult = Math.Sqrt(this.VolumeCovered) >= Constants.MinCarVolume; var report = new Report(this.Manufacturer, this.Model, testResult); return report; }
public Report GenerateReport(Network net) { Optimization optimal = net.OptimizationResult; Report report = new Report(); report.ReportedNetwork = net; report.UnoptimizedReport = new UnoptimizedSection(); if(optimal != null) { var optimizedReport = new OptimizedSection() { TotalCost = optimal.TotalCost, LinkCosts = new Dictionary<Link, LinkCost>(), RawOptimization = optimal }; foreach(var olink in optimal.Links) { var link = olink.Link; LinkCost lcost = new LinkCost(); lcost.CarFlowCost = olink.Flow * link.Distance * net.CarCostPerMile; lcost.LocomotiveCost = olink.CurrentTrains * link.Distance * (net.FuelCostPerMile + net.NonFuelCostPerMile); optimizedReport.LinkCosts.Add(link, lcost); } report.OptimizedReport = optimizedReport; } return report; }
public static Report CompileGeneralStats() { Report report = new Report( "General Stats", "200" ); report.Columns.Add( "50%", "left" ); report.Columns.Add( "50%", "left" ); int npcs = 0, players = 0; foreach ( Mobile mob in World.Mobiles.Values ) { if ( mob.Player ) ++players; else ++npcs; } report.Items.Add( "NPCs", npcs, "N0" ); report.Items.Add( "Players", players, "N0" ); report.Items.Add( "Clients", NetState.Instances.Count, "N0" ); report.Items.Add( "Accounts", Accounts.Table.Count, "N0" ); report.Items.Add( "Items", World.Items.Count, "N0" ); return report; }
/// <summary> /// Run the code example. /// </summary> /// <param name="service">An initialized Dfa Reporting service object /// </param> public override void Run(DfareportingService service) { long profileId = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE")); string reportName = _T("INSERT_REPORT_NAME_HERE"); // Create a date range to report on. DateRange dateRange = new DateRange(); dateRange.RelativeDateRange = "YESTERDAY"; // Create a dimension to report on. SortedDimension dimension = new SortedDimension(); dimension.Name = "dfa:campaign"; // Create the criteria for the report. Report.CriteriaData criteria = new Report.CriteriaData(); criteria.DateRange = dateRange; criteria.Dimensions = new List<SortedDimension>() { dimension }; criteria.MetricNames = new List<string>() { "dfa:clicks" }; // Create the report. Report report = new Report(); report.Criteria = criteria; report.Name = reportName; report.Type = "STANDARD"; // Insert the report. Report result = service.Reports.Insert(report, profileId).Execute(); // Display the new report ID. Console.WriteLine("Standard report with ID {0} was created.", result.Id); }
public static void Run() { // 帳票定義ファイルを読み込みます Report report = new Report(Json.Read("report\\example2.rrpt")); // GlobalScopeに値を登録します report.GlobalScope.Add("startDate", DateTime.ParseExact("2013/02/01", "yyyy/MM/dd", null)); report.GlobalScope.Add("endDate", DateTime.ParseExact("2013/02/28", "yyyy/MM/dd", null)); report.GlobalScope.Add("printDate", DateTime.Today); report.GlobalScope.Add("kaisha", "株式会社 システムベース"); // 帳票にデータを渡します report.Fill(new ReportDataSource(getDataTable())); // PDF出力の実行時間を計測します Stopwatch sw = new Stopwatch(); sw.Start(); // ページ分割を行います ReportPages pages = report.GetPages(); // PDF出力 using (FileStream fs = new FileStream("output\\example2_huge.pdf", FileMode.Create)) { PdfRenderer renderer = new PdfRenderer(fs); // バックスラッシュ文字を円マーク文字に変換します renderer.Setting.ReplaceBackslashToYen = true; pages.Render(renderer); } // 計測結果を表示します System.Windows.Forms.MessageBox.Show("実行時間は" + sw.ElapsedMilliseconds + "ミリ秒です"); }
private void showReport(Report report) { txtName.Text = report.Name; txtReportUrl.Text = report.ReportUrl; if (report.ReportTablesSchemaId.HasValue) cboReportTablesSchemaId.SelectedValue = report.ReportTablesSchemaId.ToString(); }
private static void EnsureTypes() { if (reportsByCategory != null) return; var reportByKeyNew = new Dictionary<string, Report>(); var reportsByCategoryNew = new Dictionary<string, List<Report>>(); foreach (var assembly in ExtensibilityHelper.SelfAssemblies) foreach (var type in assembly.GetTypes()) { var attr = type.GetCustomAttribute<ReportAttribute>(false); if (attr != null) { var report = new Report(type); var key = report.Key.TrimToNull() ?? type.FullName; reportByKeyNew[key] = report; var category = report.Category.Key; List<Report> reports; if (!reportsByCategoryNew.TryGetValue(category, out reports)) { reports = new List<Report>(); reportsByCategoryNew[category] = reports; } reports.Add(report); } } reportsByCategory = reportsByCategoryNew; reportByKey = reportByKeyNew; }
public ReportTableRow(Village village, Report report) { _report = report; if (village == report.Defender.Village) { _village = report.Defender.Village; _villageOther = report.Attacker.Village; } else { _village = report.Attacker.Village; _villageOther = report.Defender.Village; } Cells.Add(new Cell(string.Empty, Report.GetCircleImage(report))); Cells.Add(new Cell(string.Empty, Report.GetInfoImage(report))); Cells.Add(new Cell(_village.LocationString)); if (_village.HasPlayer) { Cells.Add(new Cell(_village.Player.Name)); } else { Cells.Add(new Cell()); } Cells.Add(new Cell(report.Date)); }
private static void tokenizerTest() { var list = new List<TokenInfo>(); var report = new Report(); var tokenizer = new Tokenizer("Tests/helloworld.vb", report); TokenInfo token; while (!tokenizer.IsEOF) { token = tokenizer.GetNextToken(); list.Add(token); Console.WriteLine("{0,-20} {1, -30} {2}, {3}", token.GetString(), token.Token, token.Ln, token.Col); } token = tokenizer.PeekToken(); list.Add(token); Console.WriteLine(token); printErrors(report); }
/// <summary> /// Creates the report. /// </summary> /// <returns> /// A Report. /// </returns> public Report CreateReport() { var report = new Report (); _reportRepository.MakePersistent ( report ); return report; }
/// <summary> /// Initializes an instance of the ReportPrinter class. /// </summary> /// <param name="writer">The TextWriter to write to.</param> /// <param name="report">The Report to print.</param> public ReportPrinter(TextWriter writer, Report report) { Writer = writer; Report = report; Console.SetOut(writer); }
public PrintTemplateSetting() { InitializeComponent(); Report report = new Report(); //report.Design(); reportDesiger.Report = report; }
/// <summary> /// Inserts (creates) a simple standard report for a given advertiser. /// </summary> /// <param name="userProfileId">The ID number of the DFA user profile to run this request as.</param> /// <param name="advertiser">The advertiser who the report is about.</param> /// <param name="startDate">The starting date of the report.</param> /// <param name="endDate">The ending date of the report.</param> /// <returns>The newly created report</returns> public Report Insert(long userProfileId, DimensionValue advertiser, DateTime startDate, DateTime endDate) { Console.WriteLine("================================================================="); Console.WriteLine("Creating a new standard report for advertiser {0}%n", advertiser.Value); Console.WriteLine("================================================================="); // Create a report. var report = new Report(); report.Name = string.Format("API Report: Advertiser {0}", advertiser.Value); report.FileName = "api_report_files"; // Set the type of report you want to create. Available report types can be found in the description of // the type property: https://developers.google.com/doubleclick-advertisers/reporting/v1.1/reports report.Type = "FLOODLIGHT"; report.Type = "STANDARD"; // Create criteria. var criteria = new Report.CriteriaData(); criteria.DateRange = new DateRange { StartDate = DfaReportingDateConverterUtil.convert(startDate), EndDate = DfaReportingDateConverterUtil.convert(endDate) }; // Set the dimensions, metrics, and filters you want in the report. The available values can be found // here: https://developers.google.com/doubleclick-advertisers/reporting/v1.1/dimensions criteria.Dimensions = new List<SortedDimension> { new SortedDimension { Name = "dfa:advertiser" } }; criteria.MetricNames = new List<string> { "dfa:clicks", "dfa:impressions" }; criteria.DimensionFilters = new List<DimensionValue> { advertiser }; report.Criteria = criteria; Report result = service.Reports.Insert(report, userProfileId).Execute(); Console.WriteLine("Created report with ID \"{0}\" and display name \"{1}\"", result.Id, result.Name); Console.WriteLine(); return result; }
// // GET: /Platform/SysUserLog/ public ActionResult Index(string keyword, string ordering, int pageIndex = 1) { var model = _sysUserLogService.GetAll() .Select( a => new { a.SysUser.UserName, a.SysUser.DisplayName, a.SysControllerSysAction.SysController.SysArea.AreaDisplayName, a.SysControllerSysAction.SysController.ControllerDisplayName, a.SysControllerSysAction.SysAction.ActionDisplayName, a.RecordId, IP = a.Ip, a.CreatedDate }).Search(keyword); if (!string.IsNullOrEmpty(ordering)) { model = model.OrderBy(ordering, null); } if (!string.IsNullOrEmpty(Request["report"])) { //导出 var reportModel = new Report(model.ToReportSource()); return new ReportResult(reportModel); } return View(model.ToPagedList(pageIndex)); }
// // GET: /Platform/SysRole/ public ActionResult Index(int pageIndex = 1) { var model = _sysRoleService.GetAll() .Select( a => new { a.RoleName, a.SystemId, Population = a.SysRoleSysUsers.Count(), a.CreatedDate, a.Remark, a.Id }); ViewBag.PropertyInfo = model.ElementType.GetProperties(); model = model.Processing(Request.QueryString); if (!string.IsNullOrEmpty(Request["report"])) { //导出 var reportModel = new Report(model.ToReportSource()); return new ReportResult(reportModel); } return View(model.ToPagedList(pageIndex)); }
/// <summary>Requests the generation of a new report file from a given report.</summary> /// <param name="userProfileId"> /// The ID number of the DFA user profile to run this request as. /// </param> /// <param name="report">The report to request a new file for.</param> /// <returns>The generated report file.</returns> public File Run(long userProfileId, Report report, bool isSynchronous) { Console.WriteLine("================================================================="); Console.WriteLine("Generating a report file for report with ID {0}", report.Id); Console.WriteLine("================================================================="); ReportsResource.RunRequest request = service.Reports.Run(userProfileId, report.Id.Value); request.Synchronous = isSynchronous; File reportFile = request.Execute(); Console.WriteLine("Report execution initiated. Checking for completion..."); reportFile = WaitForReportRunCompletion(service, userProfileId, reportFile); if (!reportFile.Status.Equals("REPORT_AVAILABLE")) { Console.WriteLine("Report file generation failed to finish. Final status is: {0}", reportFile.Status); return null; } Console.WriteLine("Report file with ID \"{0}\" generated.", reportFile.Id); Console.WriteLine(); return reportFile; }
public static void ReportData() { int totalProducts = 0; int totalOrders = 0; // Get the data for the report (any IEnumerable or LINQ query will work) var query = ProductRepository.GetAll(); // Create the report and turn our query into a ReportSource var report = new Report(query.ToReportSource()); // Customize the Text Fields report.TextFields.Title = "Products Report"; report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works"; report.TextFields.Footer = "Copyright 2011 © The Doddle Project"; report.TextFields.Header = string.Format(@" Report Generated: {0} Total Products: {1} Total Orders: {2} Total Sales: {3:c}", DateTime.Now, totalProducts, totalOrders, totalProducts * totalOrders); // Render hints allow you to pass additional hints to the reports as they are being rendered report.RenderHints.BooleanCheckboxes = true; // Customize the data fields report.DataFields["Id"].Hidden = true; report.DataFields["Price"].DataFormatString = "{0:c}"; report.DataFields["LastPurchase"].DataFormatString = "{0:d}"; // Write now! var writer = new HtmlReportWriter(); writer.WriteReport(report, HttpContext.Response.OutputStream); }
/// <summary> /// Report a member /// </summary> /// <param name="report"></param> public void MemberReport(Report report) { var sb = new StringBuilder(); var email = new Email(); sb.AppendFormat("<p>{2}: <a href=\"{0}\">{1}</a></p>", string.Concat(_settingsService.GetSettings().ForumUrl.TrimEnd('/'), report.Reporter.NiceUrl), report.Reporter.UserName, _localizationService.GetResourceString("Report.Reporter")); sb.AppendFormat("<p>{2}: <a href=\"{0}\">{1}</a></p>", string.Concat(_settingsService.GetSettings().ForumUrl.TrimEnd('/'), report.ReportedMember.NiceUrl), report.ReportedMember.UserName, _localizationService.GetResourceString("Report.MemberReported")); sb.Append($"<p>{_localizationService.GetResourceString("Report.Reason")}:</p>"); sb.Append($"<p>{report.Reason}</p>"); email.EmailTo = _settingsService.GetSettings().AdminEmailAddress; email.Subject = _localizationService.GetResourceString("Report.MemberReport"); email.NameTo = _localizationService.GetResourceString("Report.Admin"); email.Body = _emailService.EmailTemplate(email.NameTo, sb.ToString()); _emailService.SendMail(email); }
static int Main (string [] args) { var r = new Report (new ConsoleReportPrinter ()); var cmd = new CommandLineParser (r); cmd.UnknownOptionHandler += HandleExtraArguments; var settings = cmd.ParseArguments (args); if (settings == null || r.Errors > 0) return 1; var startup_files = new string [settings.SourceFiles.Count]; int i = 0; foreach (var source in settings.SourceFiles) startup_files [i++] = source.FullPathName; settings.SourceFiles.Clear (); var eval = new Evaluator (settings, r); eval.InteractiveBaseClass = typeof (InteractiveBaseShell); eval.DescribeTypeExpressions = true; CSharpShell shell; #if !ON_DOTNET if (attach.HasValue) { shell = new ClientCSharpShell (eval, attach.Value); } else if (agent != null) { new CSharpAgent (eval, agent).Run (startup_files); return 0; } else #endif { shell = new CSharpShell (eval); } return shell.Run (startup_files); }
public void RegisterData(Report FReport) { DataSet FDataSet = new DataSet(); FDataSet.ReadXml(Request.PhysicalApplicationPath + "App_Data\\nwind.xml"); FReport.RegisterData(FDataSet, "NorthWind"); List<Category> list = new List<Category>(); Category category = new Category("Beverages", "Soft drinks, coffees, teas, beers"); category.Products.Add(new Product("Chai", 18m)); category.Products.Add(new Product("Chang", 19m)); category.Products.Add(new Product("Ipoh coffee", 46m)); list.Add(category); category = new Category("Confections", "Desserts, candies, and sweet breads"); category.Products.Add(new Product("Chocolade", 12.75m)); category.Products.Add(new Product("Scottish Longbreads", 12.5m)); category.Products.Add(new Product("Tarte au sucre", 49.3m)); list.Add(category); category = new Category("Seafood", "Seaweed and fish"); category.Products.Add(new Product("Boston Crab Meat", 18.4m)); category.Products.Add(new Product("Red caviar", 15m)); list.Add(category); FReport.RegisterData(list, "Categories BusinessObject", BOConverterFlags.AllowFields, 3); }
public override Report GenerateTest() { var testResult = false; switch (this.EnergyEffiencyRating) { case "A": testResult = this.PowerUsage < 1000; break; case "B": testResult = this.PowerUsage >= 1000 && this.PowerUsage <= 1250; break; case "C": testResult = this.PowerUsage > 1250 && this.PowerUsage <= 1500; break; case "D": testResult = this.PowerUsage > 1500 && this.PowerUsage <= 2000; break; case "E": testResult = this.PowerUsage > 2000; break; } var report = new Report(this.Manufacturer, this.Model, testResult); return report; }
public Prior(Report r, Procedure rp, ProcedureType pt, Order o) { this.Report = r; this.Procedure = rp; this.ProcedureType = pt; this.Order = o; }
List<Report> getReports() { if (reports == null) { reports = new List<Report>(); var dir = new DirectoryInfo(GraphPkgInfo.ReportsDir); foreach (var reportDir in dir.GetDirectories()) { // parse the ini and create the report object var parser = new FileIniDataParser(); var infoTxtPath = Path.Combine(reportDir.FullName, "info.txt"); if (File.Exists(infoTxtPath) == false) continue; var infoData = parser.LoadFile(infoTxtPath, relaxedIniRead: true); var report = new Report { Key = reportDir.Name, Name = getInfoData(infoData, "Name"), Description = getInfoData(infoData, "Description"), ReportDir = reportDir.FullName }; report.ThemeFile = getInfoData(infoData, "Theme", report.ThemeFile); report.TemplateFile = getInfoData(infoData, "Template", report.TemplateFile); report.ScriptFile = getInfoData(infoData, "Script", report.ScriptFile); report.TemplateLayoutFile = getInfoData(infoData, "TemplateLayout", report.TemplateLayoutFile); reports.Add(report); } } return reports; }
public ReportResult ChequeBookReport(int pgId = 1) { ReportGenerator reportGen = new ReportGenerator(); //string rname = userManager.getReportbyName(pgId); string rname = _repository.Fetch<ChequeReport>().Single(p => p.report_Id == pgId).reportName; ViewBag.msgTitle = rname; ViewBag.Title = rname; var query = reportGen.getCheckBookReportsexel(rname); //if (!column.Contains("")) //{ // if (!item.Contains("")) // { // // query = reportGen.getCheckBookReports(rname); // query = reportGen.getCheckBookReports(rname.Trim(), column.Trim(), item.Trim()); // } //} // var query = reportGen.getCheckBookReports(rname); var report = new Report(query.ToReportSource()); // Customize the Text Fields report.TextFields.Title = rname;//"User Menus Report"; // report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works"; report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi"; // Render hints allow you to pass additional hints to the reports as they are being rendered report.RenderHints.BooleanCheckboxes = true; report.RenderHints.BooleansAsYesNo = true; report.RenderHints.FreezeRows = 9; report.RenderHints.FreezeColumns = 5; return new ReportResult(report); }
// // GET: /Platform/SysUserLog/ public ActionResult Index(int pageIndex = 1) { var model = _sysUserLogService.GetAllEnt() .Select( a => new { a.SysUser.SysEnterprise.EnterpriseName, a.SysUser.UserName, a.SysUser.DisplayName, a.SysControllerSysAction.SysController.SysArea.AreaDisplayName, a.SysControllerSysAction.SysController.ControllerDisplayName, a.SysControllerSysAction.SysAction.ActionDisplayName, a.RecordId, a.CreatedDate }); ViewBag.PropertyInfo = model.ElementType.GetProperties(); model = model.Processing(Request.QueryString); if (!string.IsNullOrEmpty(Request["report"])) { //导出 var reportModel = new Report(model.ToReportSource()); return new ReportResult(reportModel); } return View(model.ToPagedList(pageIndex)); }
private void btSave_Click(object sender, EventArgs e) { Report r = new Report(); r.date = ((DateTime)reportDate.Value); if (tbHours.Text.Length > 0) { r.expenditure = Convert.ToInt16(tbHours.Text); } else { r.expenditure = 0; } r.setProject((Project)cbProject.SelectedItem); r.setTask((Task)cbTask.SelectedItem); r.setUser(Utils.currentUser); r.description = tbDecription.Text; if (report != null) { if (report.id != 0) { r.id = report.id; } } Simplifier.insertOrUpdate(r); ((Reports)this.parent).refreshView(); this.Close(); }
/// <summary>Requests the compatible fields for a specified report.</summary> /// <param name="userProfileId">The ID number of the DFA user profile to run this request as.</param> /// <param name="report">The report to request compatible fields for.</param> public void Run(long userProfileId, Report report) { Console.WriteLine("================================================================="); Console.WriteLine("Getting compatible fields for standard report with ID {0}", report.Id); Console.WriteLine("================================================================="); var compatibleFields = service.Reports.CompatibleFields.Query(report, userProfileId).Execute(); // Since this is a standard report, we check the "ReportCompatibleFields" propery. // For other reports, we would check that report type's specified property. var standardReportCompatibleFields = compatibleFields.ReportCompatibleFields; foreach (var compatibleDimension in standardReportCompatibleFields.Dimensions) { Console.WriteLine("Dimension \"{0}\" is compatible.", compatibleDimension.Name); } foreach (var compatibleMetric in standardReportCompatibleFields.Metrics) { Console.WriteLine("Metric \"{0}\" is compatible.", compatibleMetric.Name); } foreach (var compatibleDimensionFilter in standardReportCompatibleFields.DimensionFilters) { Console.WriteLine("Dimension Filter \"{0}\" is compatible.", compatibleDimensionFilter.Name); } foreach (var compatibleActivityMetric in standardReportCompatibleFields.PivotedActivityMetrics) { Console.WriteLine("Pivoted Activity Metric \"{0}\" is compatible.", compatibleActivityMetric.Name); } Console.WriteLine(); }
private static void WriteReportFieldsXml(XmlWriter writer, Report report) { writer.WriteStartElement("Fields"); foreach (var field in report.Fields.Where(field => field.FieldType != FieldType.SectionRepeater)) { writer.WriteStartElement("Field-" + field.FieldType); writer.WriteAttributeString("Label", field.Label); if (field.FieldType != FieldType.CheckList && field.FieldType != FieldType.Location) { writer.WriteString(field.Value); } else { foreach (var item in field.ChildItems) { writer.WriteElementString(item.Item, item.Value); } } writer.WriteEndElement(); } writer.WriteEndElement(); }
/// <summary> /// 导出报告 /// </summary> /// <param name="aReport">报表对象</param> protected void Export_Report(Report aReport) { // save file in stream Stream stream = new MemoryStream(); WebReport1.Report.Export(new PDFExport(), stream); stream.Position = 0; }
protected void btnSave_Click(object sender, EventArgs e) { reportsManager = new ReportsManager(this); Report original_report, report; original_report = new Report(); report = new Report(); if (Page.ViewState["ReportId"] != null) { original_report = reportsManager.GetReport((Int32)Page.ViewState["ReportId"]); report.CopyPropertiesFrom(original_report); } report.Name = txtName.Text; report.ReportUrl = txtReportUrl.Text; if (!String.IsNullOrEmpty(cboReportTablesSchemaId.SelectedValue)) report.ReportTablesSchemaId = Convert.ToInt32(cboReportTablesSchemaId.SelectedValue); if (original_report.ReportId != 0) reportsManager.UpdateReport(original_report, report); else reportsManager.InsertReport(report); Server.Transfer("reports.aspx"); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 20; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.FirstName' at Center.", repo.ApplicationUnderTest.FirstNameInfo, new RecordItemIndex(0)); repo.ApplicationUnderTest.FirstName.Click(); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence from variable '$varFirstName' with focus on 'ApplicationUnderTest.FirstName'.", repo.ApplicationUnderTest.FirstNameInfo, new RecordItemIndex(1)); repo.ApplicationUnderTest.FirstName.PressKeys(varFirstName); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.LastName' at Center.", repo.ApplicationUnderTest.LastNameInfo, new RecordItemIndex(2)); repo.ApplicationUnderTest.LastName.Click(); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence from variable '$varLastName' with focus on 'ApplicationUnderTest.LastName'.", repo.ApplicationUnderTest.LastNameInfo, new RecordItemIndex(3)); repo.ApplicationUnderTest.LastName.PressKeys(varLastName); Delay.Milliseconds(0); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SelfInfo, new RecordItemIndex(0)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SelfInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_BoardName'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_BoardNameInfo, new RecordItemIndex(1)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_BoardNameInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PBStationAdress'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PBStationAdressInfo, new RecordItemIndex(2)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PBStationAdressInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_PB_Baudrate'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_PB_BaudrateInfo, new RecordItemIndex(3)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Combobox_PB_BaudrateInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PB_HighestStationAdress'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PB_HighestStationAdressInfo, new RecordItemIndex(4)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_PB_HighestStationAdressInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_StartAdress'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_StartAdressInfo, new RecordItemIndex(5)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_StartAdressInfo, "Visible", "True"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Visible='True') on item 'DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_EndAdress'.", repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_EndAdressInfo, new RecordItemIndex(6)); Validate.Attribute(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SoftingPROFIDtm.Text_EndAdressInfo, "Visible", "True"); Delay.Milliseconds(0); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 20; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IncidentForm.mn_status' at Center.", repo.IncidentForm.mn_statusInfo, new RecordItemIndex(0)); repo.IncidentForm.mn_status.Click(); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Down}{Down}{Down}{Down}{Down}{Return}' with focus on 'IncidentForm.mn_status'.", repo.IncidentForm.mn_statusInfo, new RecordItemIndex(1)); repo.IncidentForm.mn_status.PressKeys("{Down}{Down}{Down}{Down}{Down}{Return}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IncidentForm.mn_statusReason' at Center.", repo.IncidentForm.mn_statusReasonInfo, new RecordItemIndex(2)); repo.IncidentForm.mn_statusReason.Click(); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Down}{Down}{Down}{Return}' with focus on 'IncidentForm.mn_statusReason'.", repo.IncidentForm.mn_statusReasonInfo, new RecordItemIndex(3)); repo.IncidentForm.mn_statusReason.PressKeys("{Down}{Down}{Down}{Return}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IncidentForm.txt_INC_Resolution' at Center.", repo.IncidentForm.txt_INC_ResolutionInfo, new RecordItemIndex(4)); repo.IncidentForm.txt_INC_Resolution.Click(); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ResolveOriginalIncident' with focus on 'IncidentForm.txt_INC_Resolution'.", repo.IncidentForm.txt_INC_ResolutionInfo, new RecordItemIndex(5)); repo.IncidentForm.txt_INC_Resolution.PressKeys("ResolveOriginalIncident"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IncidentForm.btn_save' at Center.", repo.IncidentForm.btn_saveInfo, new RecordItemIndex(6)); repo.IncidentForm.btn_save.Click(); Delay.Milliseconds(0); }
public void Mouse_Click_mn_relationshipType(RepoItemInfo divtagInfo) { Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'divtagInfo' at 119;10.", divtagInfo); divtagInfo.FindAdapter <DivTag>().Click("119;10"); }
private void Form1_Load(object sender, EventArgs e) { lblVersion.Text = "Version " + Config.Version; comboBox1.SelectedIndex = (int)Config.UIStyle; FindReportsFolder(); CreateDataSources(); FReport = new Report(); FReport.Preview = previewControl1; Config.ReportSettings.ShowPerformance = true; Config.ReportSettings.StartProgress += new EventHandler(ReportSettings_StartProgress); Config.ReportSettings.Progress += new ProgressEventHandler(ReportSettings_Progress); Config.ReportSettings.FinishProgress += new EventHandler(ReportSettings_FinishProgress); tvReports.ImageList = Res.GetImages(); XmlDocument reports = new XmlDocument(); reports.Load(FReportsFolder + "reports.xml"); for (int i = 0; i < reports.Root.Count; i++) { XmlItem folderItem = reports.Root[i]; if (folderItem.GetProp("WinDemo") == "false") { continue; } #if Basic if (folderItem.GetProp("Basic") == "false") { continue; } #endif string culture = System.Globalization.CultureInfo.CurrentCulture.Name; string text = folderItem.GetProp("Name-" + culture); if (String.IsNullOrEmpty(text)) { text = folderItem.GetProp("Name"); } TreeNode folderNode = tvReports.Nodes.Add(text + " "); folderNode.ImageIndex = 66; folderNode.SelectedImageIndex = folderNode.ImageIndex; folderNode.NodeFont = new Font(Font, FontStyle.Bold); for (int j = 0; j < folderItem.Count; j++) { XmlItem reportItem = folderItem[j]; if (reportItem.GetProp("WinDemo") == "false") { continue; } #if Basic if (reportItem.GetProp("Basic") == "false") { continue; } #endif string file = reportItem.GetProp("File"); string fileName = reportItem.GetProp("Name-" + culture); if (String.IsNullOrEmpty(fileName)) { fileName = Path.GetFileNameWithoutExtension(file); } TreeNode fileNode = folderNode.Nodes.Add(fileName); fileNode.ImageIndex = 134; fileNode.SelectedImageIndex = fileNode.ImageIndex; fileNode.Tag = FReportsFolder + file; } } if (tvReports.Nodes.Count > 0 && tvReports.Nodes[0].Nodes.Count > 0) { tvReports.SelectedNode = tvReports.Nodes[0].Nodes[0]; } tvReports.Focus(); }
/* public ActionResult Export(Report report) * { * if (report.ExportTo == "pdf") * { * return ExportToPdf(report); * } * * return ExportToWord(report); * }*/ public ActionResult Report(Report report) { Report jobSeekerReport = GenerateDataReport(report); return(View(jobSeekerReport)); }
public static void records7() { Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_20' at 6;7."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_20.MoveTo("6;7", 1000); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(0); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas' at 87;63."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas.MoveTo("87;63", 1000); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(350); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonParsers' at 49;7."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonParsers.Click("49;7", 1000); //Delay.Milliseconds(3600); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_6' at 9;10."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_6.MoveTo("9;10", 1000); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(120); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas' at 217;95."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas.MoveTo("217;95", 1000); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(560); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonFormatters' at 74;8."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonFormatters.Click("74;8", 1000); //Delay.Milliseconds(600); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_8' at 6;11."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_8.MoveTo("6;11", 1000); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(0); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas' at 341;143."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas.MoveTo("341;143", 1000); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(710); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonEndpoints' at 81;13."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonEndpoints.Click("81;13", 1000); //Delay.Milliseconds(730); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_1' at 8;16."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureIcon_1.MoveTo("8;16", 1000); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(290); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas' at 471;164."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas.MoveTo("471;164", 1000); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(280); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonRouters' at 52;10."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.ButtonRouters.Click("52;10", 1000); //Delay.Milliseconds(480); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine' at 10;5."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine.Click("10;5", 300); //Delay.Milliseconds(410); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_20_3824' at 19;26."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_20_3824.MoveTo("19;26", 300); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(510); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856' at 11;15."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856.MoveTo("11;15", 300); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(1040); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine' at 7;9."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine.Click("7;9", 300); //Delay.Milliseconds(590); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856' at 23;25."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856.MoveTo("23;25", 300); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(990); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104' at 4;9."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104.MoveTo("4;9", 300); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(1040); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine' at 13;7."); repo.WebDocumentLocalhost_8888.ContainerComponent_Palette.PictureLine.Click("13;7", 300); //Delay.Milliseconds(690); Report.Info("Mouse Left Down item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104' at 18;19."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104.MoveTo("18;19", 300); Mouse.ButtonDown(MouseButtons.Left); //Delay.Milliseconds(630); Report.Info("Mouse Left Up item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_1_422125' at 10;15."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_1_422125.MoveTo("10;15", 300); Mouse.ButtonUp(MouseButtons.Left); //Delay.Milliseconds(1900); Report.Info("Mouse Right Click item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_20_3824' at 22;20."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_20_3824.Click(MouseButtons.Right, "22;20", 300); //Delay.Milliseconds(690); Report.Info("Mouse Left Click item 'ContextMenuIexplore.MenuItemConfigure_Component' at 46;12."); repo.ContextMenuIexplore.MenuItemConfigure_Component.Click("46;12", 300); //Delay.Milliseconds(770); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___' at 89;5."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___.Click("89;5", 300); //Delay.Milliseconds(1180); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton' at 111;11."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton.Click("111;11", 300); //Delay.Milliseconds(1800); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextFtpsource' at 61;12."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextFtpsource.Click("61;12", 300); //Delay.Milliseconds(1520); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad' at 32;13."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad.Click("32;13", 300); //Delay.Milliseconds(3270); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId' at 92;9."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId.Click("92;9", 300); //Delay.Milliseconds(680); Report.Info("Key sequence 'source'."); Keyboard.Press("source", 100); //Delay.Milliseconds(2490); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave' at 37;8."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave.Click("37;8", 300); //Delay.Milliseconds(740); Report.Info("Mouse Right Click item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856' at 26;26."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_6_16856.Click(MouseButtons.Right, "26;26", 300); //Delay.Milliseconds(600); Report.Info("Mouse Left Click item 'ContextMenuIexplore.MenuItemConfigure_Component' at 26;10."); repo.ContextMenuIexplore.MenuItemConfigure_Component.Click("26;10", 300); //Delay.Milliseconds(930); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___' at 95;13."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___.Click("95;13", 300); //Delay.Milliseconds(930); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton' at 90;9."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton.Click("90;9", 300); //Delay.Milliseconds(910); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextParserfile' at 52;2."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextParserfile.Click("52;2", 300); //Delay.Milliseconds(1040); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad' at 30;12."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad.Click("30;12", 300); //Delay.Milliseconds(840); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId1' at 93;10."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId1.Click("93;10", 300); //Delay.Milliseconds(1400); Report.Info("Key sequence 'test'."); Keyboard.Press("test", 100); //Delay.Milliseconds(2990); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave' at 40;7."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave.Click("40;7", 300); //Delay.Milliseconds(800); Report.Info("Mouse Right Click item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104' at 23;24."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_8_292104.Click(MouseButtons.Right, "23;24", 300); //Delay.Milliseconds(570); Report.Info("Mouse Left Click item 'ContextMenuIexplore.MenuItemConfigure_Component' at 31;10."); repo.ContextMenuIexplore.MenuItemConfigure_Component.Click("31;10", 300); //Delay.Milliseconds(1040); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___' at 51;8."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___.Click("51;8", 300); //Delay.Milliseconds(940); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton' at 121;9."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton.Click("121;9", 300); //Delay.Milliseconds(1550); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextDbFormatter' at 78;10."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextDbFormatter.Click("78;10", 300); //Delay.Milliseconds(650); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad' at 27;10."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad.Click("27;10", 300); //Delay.Milliseconds(1090); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId2' at 90;11."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId2.Click("90;11", 300); //Delay.Milliseconds(460); Report.Info("Key sequence 'dbformat'."); Keyboard.Press("dbformat", 100); //Delay.Milliseconds(3340); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave' at 40;16."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave.Click("40;16", 300); //Delay.Milliseconds(910); Report.Info("Mouse Right Click item 'WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_1_422125' at 15;11."); repo.WebDocumentLocalhost_8888.ContainerGraphCanvas1.PictureIcon_1_422125.Click(MouseButtons.Right, "15;11", 300); //Delay.Milliseconds(540); Report.Info("Mouse Left Click item 'ContextMenuIexplore.MenuItemConfigure_Component' at 24;10."); repo.ContextMenuIexplore.MenuItemConfigure_Component.Click("24;10", 300); //Delay.Milliseconds(930); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId3' at 89;13."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextServiceId3.Click("89;13", 300); //Delay.Milliseconds(380); Report.Info("Key sequence 'dest'."); Keyboard.Press("dest", 100); //Delay.Milliseconds(2280); Report.Info("Key sequence 'db'."); Keyboard.Press("db", 100); //Delay.Milliseconds(2120); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___' at 48;16."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad_template___.Click("48;16", 300); //Delay.Milliseconds(870); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton' at 123;9.", repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButtonInfo, new RecordItemIndex(1)); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonButton.Click("123;9"); Delay.Milliseconds(840); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.TextDbDest' at 73;6.", repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextDbDestInfo, new RecordItemIndex(2)); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.TextDbDest.Click("73;6"); Delay.Milliseconds(1520); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad' at 47;11.", repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoadInfo, new RecordItemIndex(3)); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonLoad.Click("47;11"); Delay.Milliseconds(2510); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave' at 32;10.", repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSaveInfo, new RecordItemIndex(4)); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonSave.Click("32;10"); Delay.Milliseconds(870); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerVBox.TextNameText' at 89;10."); repo.WebDocumentLocalhost_8888.ContainerVBox.TextNameText.Click("89;10", 300); //Delay.Milliseconds(2820); Report.Info("Key sequence 'ftp{RShiftKey down}_{RShiftKey up}to'."); Keyboard.Press("ftp{RShiftKey down}_{RShiftKey up}to", 100); //Delay.Milliseconds(1980); Report.Info("Key sequence '{RShiftKey down}_{RShiftKey up}db'."); Keyboard.Press("{RShiftKey down}_{RShiftKey up}db", 100); //Delay.Milliseconds(1680); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerVBox.TextUITextField' at 83;19."); repo.WebDocumentLocalhost_8888.ContainerVBox.TextUITextField.Click("83;19", 300); //Delay.Milliseconds(70); Report.Info("Key sequence 'test'."); Keyboard.Press("test", 100); //Delay.Milliseconds(1020); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FormForm.CheckBoxRecovery' at 5;7."); repo.WebDocumentLocalhost_8888.FormForm.CheckBoxRecovery.Click("5;7", 300); //Delay.Milliseconds(600); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FormForm.CheckBoxPrcsEvntLog' at 5;7."); repo.WebDocumentLocalhost_8888.FormForm.CheckBoxPrcsEvntLog.Click("5;7", 300); //Delay.Milliseconds(730); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FormForm.CheckBoxMsgEvntLog' at 5;7."); repo.WebDocumentLocalhost_8888.FormForm.CheckBoxMsgEvntLog.Click("5;7", 300); //Delay.Milliseconds(850); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerVBox.ButtonSave1' at 18;14."); repo.WebDocumentLocalhost_8888.ContainerVBox.ButtonSave1.Click("18;14", 300); //Delay.Milliseconds(1260); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonOK' at 42;18."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonOK.Click("42;18", 300); //Delay.Milliseconds(880); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.ContainerVBox.ButtonPublish' at 13;16."); repo.WebDocumentLocalhost_8888.ContainerVBox.ButtonPublish.Click("13;16", 300); //Delay.Milliseconds(1760); Report.Info("Mouse Left Click item 'WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonOK1' at 31;10."); repo.WebDocumentLocalhost_8888.FlexObjectIceFish.ButtonOK1.Click("31;10", 300); //Delay.Milliseconds(900); }
/// <summary> /// This method gets called right after the recording has been started. /// It can be used to execute recording specific initialization code. /// </summary> private void Init() { while (!Objects.Internet.IsConnectToInternetOKWithOutConfig()) { MessageBox.Show(new WinForms.Form { TopMost = true }, "The SUT does not connect to the internet. Please connect to the internect and click OK when you are done."); } Report.Log(ReportLevel.Info, "Website", "Opening web site 'http://dell.com/support' with browser 'IE' in maximized mode."); Host.Local.OpenBrowser("http://dell.com/support", "IE", "", false, true, false, false, false); Delay.Milliseconds(500); // if IE11 runs at first time, the FirstRunWizard must be closed firstRun fr = new firstRun(); fr.checkIEForm(); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Detect Product'."); repo.DellSupport.ProductSupportDellUS.BtnDetectmyProductInfo.WaitForExists(120000); repo.DellSupport.ProductSupportDellUS.BtnDetectmyProduct.Click(); Delay.Seconds(5); int i = 0; while (true) { if (repo.DellSupport.ProductSupportDellUS.BtnDetectmyProductInfo.Exists(5000)) { repo.DellSupport.ProductSupportDellUS.BtnDetectmyProduct.Click(); i++; if (i >= 50) { break; } } else { break; } Delay.Seconds(5); } repo.DellSupport.ProductSupportDellUS.ProductNameInfo.WaitForExists(120000); if (repo.DellSupport.ProductSupportDellUS.ProductNameInfo.Exists(5000)) { Report.Info("Check Infomation is ready or not."); repo.DellSupport.ProductSupportDellUS.ProductName.Click(); //=> continue getinfo } else { //start setup for getinfo repo.DHS_HaiNT21_Page.AgreeTerm.Click(); Delay.Seconds(3); repo.DHS_HaiNT21_Page.Continue.Click(); Delay.Seconds(30); Keyboard.Press(System.Windows.Forms.Keys.W | System.Windows.Forms.Keys.Control, 17, Keyboard.DefaultKeyPressTime, 1, true); //Keyboard.Press(System.Windows.Forms.Keys.W | System.Windows.Forms.Keys.Control, 17, Keyboard.DefaultKeyPressTime, 1, true); Report.Log(ReportLevel.Info, "Website", "Opening web site 'http://dell.com/support' with browser 'IE' in maximized mode."); Host.Local.OpenBrowser("http://dell.com/support", "IE", "", false, true, false, false, false); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Detect Product'."); while (repo.DellSupport.ProductSupportDellUS.BtnDetectmyProductInfo.Exists(1000)) { repo.DellSupport.ProductSupportDellUS.BtnDetectmyProduct.Click(); Delay.Seconds(5); } } GetDellSystemInfo(); Delay.Milliseconds(0); Delay.Duration(3000, false); // Close browser window Report.Log(ReportLevel.Info, "Keyboard", "Close browser window\r\nKey 'Ctrl+W' Press."); Keyboard.Press(System.Windows.Forms.Keys.W | System.Windows.Forms.Keys.Control, 17, Keyboard.DefaultKeyPressTime, 1, true); Delay.Milliseconds(0); }
public void DeleteReport(Report report) { _ctx.Reports.Remove(report); _ctx.SaveChanges(); }
public SyncReport(OrderManager orderManager) { this.orderManager = orderManager; for (var i = 0; i < NumSyncReports; i++) syncReports[i] = new Report(); }
protected override bool CheckBase(ResolveContext rc) { if (!base.CheckBase(rc)) { return(false); } CheckForDuplications(); if (IsExplicitInterfaceImplementation) { return(true); } // For Std.Object only if (Parent.ResolvedBaseType.IsKnownType(KnownTypeCode.Object)) { return(true); } // override checking IMember candidate; bool overrides = false; var base_member = FindBaseMember(rc); if (IsOverride) { if (base_member == null) { if (this is MethodDeclaration && ((MethodDeclaration)this).ParameterInfo.IsEmpty && MemberName.Name == DestructorDeclaration.MetadataName && MemberName.Arity == 0) { Report.Error(227, Location, "Do not override `{0}'. Use destructor syntax instead", "object.Finalize()"); } else { Report.Error(228, Location, "`{0}' is marked as an override but no suitable {1} found to override", GetSignatureForError(), SimpleName.GetMemberType(this)); } return(false); } if (!CheckOverride(rc, base_member)) { return(false); } } if (base_member == null) { if ((mod_flags & Modifiers.NEW) != 0) { if (base_member == null) { Report.Warning(229, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError()); } } } else { if ((ModFlags & Modifiers.NEW) == 0) { ModFlags |= Modifiers.NEW; if (!IsCompilerGenerated) { if (!IsInterfaceMember && base_member.IsOverridable) { Report.Warning(230, 2, Location, "`{0}' hides inherited member `{1}'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword", GetSignatureForError(), base_member.ToString()); } else { Report.Warning(231, 2, Location, "`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended", GetSignatureForError(), base_member.ToString()); } } } if (!IsInterfaceMember && base_member.IsAbstract && !IsOverride && !IsStatic) { switch (base_member.SymbolKind) { case SymbolKind.Event: case SymbolKind.Indexer: case SymbolKind.Method: case SymbolKind.Property: Report.Error(232, Location, "`{0}' hides inherited abstract member `{1}'", GetSignatureForError(), base_member.ToString()); break; } } } return(true); }
public static int[] ComputeIndexArray(V2i size, IEnumerable <int> invalidPoints) { var indexArray = new int[(size.X - 1) * (size.Y - 1) * 6]; int k = 0; bool hasInvalids = invalidPoints != null; #region no invalids if (!hasInvalids) { for (int y = 0; y < size.Y - 1; y++) { for (int x = 0; x < size.X - 1; x++) { indexArray[k] = y * size.X + x; indexArray[k + 1] = (y + 1) * size.X + x; indexArray[k + 2] = y * size.X + x + 1; indexArray[k + 3] = y * size.X + x + 1; indexArray[k + 4] = (y + 1) * size.X + x; indexArray[k + 5] = (y + 1) * size.X + x + 1; k += 6; } } return(indexArray.ToArray()); } #endregion #region has invalids else { var invalidDict = invalidPoints.ToDictionary(n => n); int a1, b1, c1; int a2, b2, c2; var indices = new List <int>(); bool invalidFace = false; int counter = 0; for (int y = 0; y < size.Y - 1; y++) { for (int x = 0; x < size.X - 1; x++) { a1 = y * size.X + x; b1 = (y + 1) * size.X + x; c1 = y * size.X + x + 1; a2 = y * size.X + x + 1; b2 = (y + 1) * size.X + x; c2 = (y + 1) * size.X + x + 1; indices.Clear(); indices.Add(a1); indices.Add(b1); indices.Add(c1); indices.Add(a2); indices.Add(b2); indices.Add(c2); invalidFace = indices.Select(n => n).Where(m => invalidDict.ContainsKey(m)).ToList().Count() > 0; if (invalidFace) { //Console.WriteLine("Invalid Face Found"); counter++; k += 6; continue; } indexArray[k] = a1; indexArray[k + 1] = b1; indexArray[k + 2] = c1; indexArray[k + 3] = a2; indexArray[k + 4] = b2; indexArray[k + 5] = c2; k += 6; } } if (counter > 0) { Report.Line(5, "Invalid faces found: " + counter); } return(indexArray.ToArray()); } #endregion }
public static int[] ComputeIndices(V2i size, IEnumerable <int> invalidPoints, V3f[] points, float maxTriangleSize) { var indexArray = new int[(size.X - 1) * (size.Y - 1) * 6]; int k = 0; var invalidDict = invalidPoints.ToDictionary(n => n); int a1, b1, c1; int a2, b2, c2; var indices = new List <int>(); bool invalidFace = false; int counter = 0; int oversized_counter = 0; for (int y = 0; y < size.Y - 1; y++) { for (int x = 0; x < size.X - 1; x++) { a1 = y * size.X + x; b1 = (y + 1) * size.X + x; c1 = y * size.X + x + 1; a2 = y * size.X + x + 1; b2 = (y + 1) * size.X + x; c2 = (y + 1) * size.X + x + 1; indices.Clear(); indices.Add(a1); indices.Add(b1); indices.Add(c1); indices.Add(a2); indices.Add(b2); indices.Add(c2); invalidFace = indices.Select(n => n).Where(m => invalidDict.ContainsKey(m)).ToList().Count() > 0; if (invalidFace) { //Console.WriteLine("Invalid Face Found"); counter++; k += 6; continue; } if (!IsOversizedTriangle(points, a1, b1, c1, maxTriangleSize)) //if (!IsOversizedTriangleSideRatio(points, a1, b1, c1, maxTriangleSize)) { indexArray[k] = a1; indexArray[k + 1] = b1; indexArray[k + 2] = c1; } else { oversized_counter++; } if (!IsOversizedTriangle(points, a2, b2, c2, maxTriangleSize)) //if (!IsOversizedTriangleSideRatio(points, a2, b2, c2, maxTriangleSize)) { indexArray[k + 3] = a2; indexArray[k + 4] = b2; indexArray[k + 5] = c2; } else { oversized_counter++; } k += 6; } } if (counter > 0) { Report.Line(5, "Invalid faces found: " + counter); } return(indexArray.ToArray()); }
static void Run(CodeGeneratorOptions options, DirectoryAssemblyResolver resolver) { string assemblyQN = options.AssemblyQualifiedName; string api_level = options.ApiLevel; int product_version = options.ProductVersion; bool preserve_enums = options.PreserveEnums; string csdir = options.ManagedCallableWrapperSourceOutputDirectory ?? "cs"; string javadir = "java"; string enumdir = options.EnumOutputDirectory ?? "enum"; string enum_metadata = options.EnumMetadataOutputFile ?? "enummetadata"; var references = options.AssemblyReferences; string enum_fields_map = options.EnumFieldsMapFile; string enum_flags = options.EnumFlagsFile; string enum_methods_map = options.EnumMethodsMapFile; var fixups = options.FixupFiles; var annotations_zips = options.AnnotationsZipFiles; string filename = options.ApiDescriptionFile; string mapping_file = options.MappingReportFile; bool only_xml_adjuster = options.OnlyRunApiXmlAdjuster; string api_xml_adjuster_output = options.ApiXmlAdjusterOutput; var apiSource = ""; var opt = new CodeGenerationOptions() { CodeGenerationTarget = options.CodeGenerationTarget, UseGlobal = options.GlobalTypeNames, IgnoreNonPublicType = true, UseShortFileNames = options.UseShortFileNames, ProductVersion = options.ProductVersion, SupportInterfaceConstants = options.SupportInterfaceConstants, SupportDefaultInterfaceMethods = options.SupportDefaultInterfaceMethods, SupportNestedInterfaceTypes = options.SupportNestedInterfaceTypes, SupportNullableReferenceTypes = options.SupportNullableReferenceTypes, }; var resolverCache = new TypeDefinitionCache(); // Load reference libraries foreach (var lib in options.LibraryPaths) { resolver.SearchDirectories.Add(lib); } foreach (var reference in references) { resolver.SearchDirectories.Add(Path.GetDirectoryName(reference)); } // Figure out if this is class-parse string apiXmlFile = filename; string apiSourceAttr = null; using (var xr = XmlReader.Create(filename)) { xr.MoveToContent(); apiSourceAttr = xr.GetAttribute("api-source"); } // We don't use shallow referenced types with class-parse because the Adjuster process // enumerates every ctor/method/property/field to build its model, so we will need // every type to be fully populated. opt.UseShallowReferencedTypes = apiSourceAttr != "class-parse"; foreach (var reference in references.Distinct()) { try { Report.Verbose(0, "resolving assembly {0}.", reference); var assembly = resolver.Load(reference); foreach (var md in assembly.Modules) { foreach (var td in md.Types) { // FIXME: at some stage we want to import generic types. // For now generator fails to load generic types that have conflicting type e.g. // AdapterView`1 and AdapterView cannot co-exist. // It is mostly because generator primarily targets jar (no real generics land). var nonGenericOverload = td.HasGenericParameters ? md.GetType(td.FullName.Substring(0, td.FullName.IndexOf('`'))) : null; if (BindSameType(td, nonGenericOverload, resolverCache)) { continue; } ProcessReferencedType(td, opt); } } } catch (Exception ex) { Report.Warning(0, Report.WarningCodeGenerator + 0, ex, "failed to parse assembly {0}: {1}", reference, ex.Message); } } // For class-parse API description, transform it to jar2xml style. if (apiSourceAttr == "class-parse") { apiXmlFile = api_xml_adjuster_output ?? Path.Combine(Path.GetDirectoryName(filename), Path.GetFileName(filename) + ".adjusted"); new Adjuster().Process(filename, opt, opt.SymbolTable.AllRegisteredSymbols(opt).OfType <GenBase> ().ToArray(), apiXmlFile, Report.Verbosity ?? 0); } if (only_xml_adjuster) { return; } // load XML API definition with fixups. Dictionary <string, EnumMappings.EnumDescription> enums = null; EnumMappings enummap = null; if (enum_fields_map != null || enum_methods_map != null) { enummap = new EnumMappings(enumdir, enum_metadata, api_level, preserve_enums); enums = enummap.Process(enum_fields_map, enum_flags, enum_methods_map); fixups.Add(enum_metadata); } Parser p = new Parser(opt); List <GenBase> gens = p.Parse(apiXmlFile, fixups, api_level, product_version); if (gens == null) { return; } apiSource = p.ApiSource; // disable interface default methods here, especially before validation. gens = gens.Where(g => !g.IsObfuscated && g.Visibility != "private").ToList(); foreach (var gen in gens) { gen.StripNonBindables(opt); if (gen.IsGeneratable) { AddTypeToTable(opt, gen); } } // Apply fixups KotlinFixups.Fixup(gens); Validate(gens, opt, new CodeGeneratorContext()); foreach (var api_versions_xml in options.ApiVersionsXmlFiles) { ApiVersionsSupport.AssignApiLevels(gens, api_versions_xml); } foreach (GenBase gen in gens) { gen.FillProperties(); } var cache = new AncestorDescendantCache(gens); foreach (var gen in gens) { gen.UpdateEnums(opt, cache); } foreach (GenBase gen in gens) { gen.FixupMethodOverrides(opt); } foreach (GenBase gen in gens) { gen.FixupExplicitImplementation(); } SealedProtectedFixups.Fixup(gens); GenerateAnnotationAttributes(gens, annotations_zips); //SymbolTable.Dump (); GenerationInfo gen_info = new GenerationInfo(csdir, javadir, assemblyQN); opt.AssemblyName = gen_info.Assembly; if (mapping_file != null) { GenerateMappingReportFile(gens, mapping_file); } foreach (IGeneratable gen in gens) { if (gen.IsGeneratable) { gen.Generate(opt, gen_info); } } new NamespaceMapping(gens).Generate(opt, gen_info); ClassGen.GenerateTypeRegistrations(opt, gen_info); ClassGen.GenerateEnumList(gen_info); // Create the .cs files for the enums var enumFiles = enums == null ? null : enummap.WriteEnumerations(enumdir, enums, FlattenNestedTypes(gens).ToArray(), opt.UseShortFileNames); gen_info.GenerateLibraryProjectFile(options, enumFiles); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_FirmName' with focus on 'ApplicationUnderTest.ID_AI_FirmName'.", repo.ApplicationUnderTest.ID_AI_FirmNameInfo, new RecordItemIndex(0)); repo.ApplicationUnderTest.ID_AI_FirmName.PressKeys("ID_AI_FirmName"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_FirstName' with focus on 'ApplicationUnderTest.ID_AI_FirstName'.", repo.ApplicationUnderTest.ID_AI_FirstNameInfo, new RecordItemIndex(1)); repo.ApplicationUnderTest.ID_AI_FirstName.PressKeys("ID_AI_FirstName"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_LastName' with focus on 'ApplicationUnderTest.ID_AI_LastName'.", repo.ApplicationUnderTest.ID_AI_LastNameInfo, new RecordItemIndex(2)); repo.ApplicationUnderTest.ID_AI_LastName.PressKeys("ID_AI_LastName"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_Address1' with focus on 'ApplicationUnderTest.ID_AI_Address1'.", repo.ApplicationUnderTest.ID_AI_Address1Info, new RecordItemIndex(3)); repo.ApplicationUnderTest.ID_AI_Address1.PressKeys("ID_AI_Address1"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_Address2' with focus on 'ApplicationUnderTest.ID_AI_Address2'.", repo.ApplicationUnderTest.ID_AI_Address2Info, new RecordItemIndex(4)); repo.ApplicationUnderTest.ID_AI_Address2.PressKeys("ID_AI_Address2"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'ID_AI_City' with focus on 'ApplicationUnderTest.ID_AI_City'.", repo.ApplicationUnderTest.ID_AI_CityInfo, new RecordItemIndex(5)); repo.ApplicationUnderTest.ID_AI_City.PressKeys("ID_AI_City"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Set value", "Setting attribute TagValue to 'CT' on item 'ApplicationUnderTest.ID_AI_State'.", repo.ApplicationUnderTest.ID_AI_StateInfo, new RecordItemIndex(6)); repo.ApplicationUnderTest.ID_AI_State.Element.SetAttributeValue("TagValue", "CT"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Delay", "Waiting for 500ms.", new RecordItemIndex(7)); Delay.Duration(500, false); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '32132' with focus on 'ApplicationUnderTest.ID_AI_Zipcode'.", repo.ApplicationUnderTest.ID_AI_ZipcodeInfo, new RecordItemIndex(8)); repo.ApplicationUnderTest.ID_AI_Zipcode.PressKeys("32132"); Delay.Milliseconds(0); Report.Screenshot(ReportLevel.Info, "User", "", repo.PegaCaseManagerPortalGoogleChrome.Screenshot_Window, false, new RecordItemIndex(9)); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '*****@*****.**' with focus on 'ApplicationUnderTest.ID_AI_Email'.", repo.ApplicationUnderTest.ID_AI_EmailInfo, new RecordItemIndex(10)); repo.ApplicationUnderTest.ID_AI_Email.PressKeys("*****@*****.**"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Set value", "Setting attribute TagValue to '06/04/2019' on item 'ApplicationUnderTest.ID_AI_RepresentationDate'.", repo.ApplicationUnderTest.ID_AI_RepresentationDateInfo, new RecordItemIndex(11)); repo.ApplicationUnderTest.ID_AI_RepresentationDate.Element.SetAttributeValue("TagValue", "06/04/2019"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Tab}'.", new RecordItemIndex(12)); Keyboard.Press("{Tab}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Tab}'.", new RecordItemIndex(13)); Keyboard.Press("{Tab}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Return}'.", new RecordItemIndex(14)); Keyboard.Press("{Return}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Set value", "Setting attribute TagValue to 'Personal' on item 'ApplicationUnderTest.ID_AI_UseType'.", repo.ApplicationUnderTest.ID_AI_UseTypeInfo, new RecordItemIndex(15)); repo.ApplicationUnderTest.ID_AI_UseType.Element.SetAttributeValue("TagValue", "Personal"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Set value", "Setting attribute TagValue to 'Cell' on item 'ApplicationUnderTest.ID_AI_PhoneType'.", repo.ApplicationUnderTest.ID_AI_PhoneTypeInfo, new RecordItemIndex(16)); repo.ApplicationUnderTest.ID_AI_PhoneType.Element.SetAttributeValue("TagValue", "Cell"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Set value", "Setting attribute TagValue to 'Caller ID' on item 'ApplicationUnderTest.ID_AI_Source'.", repo.ApplicationUnderTest.ID_AI_SourceInfo, new RecordItemIndex(17)); repo.ApplicationUnderTest.ID_AI_Source.Element.SetAttributeValue("TagValue", "Caller ID"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '9500095012' with focus on 'ApplicationUnderTest.ID_AI_Phone'.", repo.ApplicationUnderTest.ID_AI_PhoneInfo, new RecordItemIndex(18)); repo.ApplicationUnderTest.ID_AI_Phone.PressKeys("9500095012"); Delay.Milliseconds(0); Report.Screenshot(ReportLevel.Info, "User", "", repo.PegaCaseManagerPortalGoogleChrome.Screenshot_Window, false, new RecordItemIndex(19)); try { Report.Log(ReportLevel.Info, "Keyboard", "(Optional Action)\r\nKey sequence '{Tab}'.", new RecordItemIndex(20)); Keyboard.Press("{Tab}"); Delay.Milliseconds(0); } catch(Exception ex) { Report.Log(ReportLevel.Warn, "Module", "(Optional Action) " + ex.Message, new RecordItemIndex(20)); } Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.SubmitButton1' at 46;15.", repo.ApplicationUnderTest.SubmitButton1Info, new RecordItemIndex(21)); repo.ApplicationUnderTest.SubmitButton1.Click("46;15"); Delay.Milliseconds(0); }
public bool AddReport(Report report) { return(dal.AddReport(report)); }
public async Task <IEnumerable <ReportViewModel> > Approve(IEnumerable <string> ids) { List <Report> dataToApprove = new List <Report>(); foreach (string item in ids) { Report rp = await reportRepository.GetByIdAsync(ObjectId.Parse(item)); if (rp != null) { dataToApprove.Add(rp); } } User currentUser = Feature.CurrentUser(httpContextAccessor, userRepository); foreach (Report item in dataToApprove) { #region Find the same object var reportBuilders = Builders <Report> .Filter; var reportFilter = reportBuilders.Eq("object_id", item.ObjectId); var sameObjects = (await reportRepository.FindListAsync(reportFilter)).ToList(); sameObjects.ForEach(async x => { x.IsApproved = true; x.ModifiedDate = DateTime.Now; x.ApprovedBy = currentUser.OId; x.ApproveDate = DateTime.Now; await reportRepository.UpdateAsync(x, x.Id); }); #endregion if (item.ObjectType.Contains("Post")) { Post post = await postRepository.GetByIdAsync(ObjectId.Parse(item.ObjectId)); post.Status = ItemStatus.Deleted; post.ModifiedDate = DateTime.Now; await postRepository.UpdateAsync(post, post.Id); var user = await userRepository.GetByIdAsync(ObjectId.Parse(post.AuthorId)); if (user == null) { throw new Exception("Không tìm thấy người dùng. "); } var notificationDetail = new Noftication() { AuthorId = currentUser.OId, OwnerId = currentUser.OId, ObjectId = post.OId, ObjectThumbnail = post.Title }; await fcmRepository.PushNotify(post.AuthorId, notificationDetail, NotificationContent.ApprovePostReportNotification, $"Bài viết của bạn đã bị xóa bởi quản trị viên. "); //Báo cáo của bạn đã được duyệt. await fcmRepository.PushNotify(item.AuthorId, notificationDetail, NotificationContent.ApprovePostReportNotification, $"Báo cáo của bạn về bài viết của{user.FirstName} {user.LastName} đã được xem xét. "); } else if (item.ObjectType.Contains("ReplyComment")) { ReplyComment replyComment = await replyCommentRepository.GetByIdAsync(ObjectId.Parse(item.ObjectId)); replyComment.Status = ItemStatus.Deleted; replyComment.ModifiedDate = DateTime.Now; await replyCommentRepository.UpdateAsync(replyComment, replyComment.Id); var user = await userRepository.GetByIdAsync(ObjectId.Parse(replyComment.AuthorId)); if (user == null) { throw new Exception("Không tìm thấy người dùng. "); } var notificationDetail = new Noftication() { AuthorId = currentUser.OId, OwnerId = currentUser.OId, ObjectId = replyComment.OId, ObjectThumbnail = replyComment.Content }; //Báo cáo của bạn đã được duyệt. await fcmRepository.PushNotify(item.AuthorId, notificationDetail, NotificationContent.ApproveReplyReportNotification, $"Báo cáo của bạn về phản hồi của {user.FirstName} {user.LastName} đã được xem xét. "); await fcmRepository.PushNotify(replyComment.AuthorId, notificationDetail, NotificationContent.ApproveReplyReportNotification, $"Phản hồi của bạn đã bị xóa bởi quản trị viên. "); } else if (item.ObjectType.Contains("Comment")) { Comment comment = await commentRepository.GetByIdAsync(ObjectId.Parse(item.ObjectId)); comment.Status = ItemStatus.Deleted; comment.ModifiedDate = DateTime.Now; await commentRepository.UpdateAsync(comment, comment.Id); var user = await userRepository.GetByIdAsync(ObjectId.Parse(comment.AuthorId)); if (user == null) { throw new Exception("Không tìm thấy người dùng. "); } var notificationDetail = new Noftication() { AuthorId = currentUser.OId, OwnerId = currentUser.OId, ObjectId = comment.OId, ObjectThumbnail = comment.Content }; //Báo cáo của bạn đã được duyệt. await fcmRepository.PushNotify(item.AuthorId, notificationDetail, NotificationContent.ApproveCommentReportNotification, $"Báo cáo của bạn về bình luận của {user.FirstName} {user.LastName} đã được xem xét."); await fcmRepository.PushNotify(comment.AuthorId, notificationDetail, NotificationContent.ApproveCommentReportNotification, $"Bình luận của bạn đã bị xóa bởi quản trị viên. "); } } return(mapper.Map <IEnumerable <ReportViewModel> >(dataToApprove)); }
protected override void GetDelSql(int rowIndex, ref List <string> sql) { string ret = Pub.GetSQL(DBCode.DB_000300, new string[] { "401", Report.FieldByName("PassTimeID").AsString }); sql.Add(ret); }
public Compiler(MachineInfo mi, Report report) : this(new EmitContext(mi, report)) { }
protected override string GetDelMsg(int rowIndex) { string ret = Pub.GetResText(formCode, "PassTimeID", "") + "=" + Report.FieldByName("PassTimeID").AsString; return(ret); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.Save_Button' at 6;8.", repo.ApplicationUnderTest.Save_ButtonInfo, new RecordItemIndex(0)); repo.ApplicationUnderTest.Save_Button.Click("6;8"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Delay", "Waiting for 5s.", new RecordItemIndex(1)); Delay.Duration(5000, false); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_FirmName) on item 'ApplicationUnderTest.AO1_Attorney_FirmName'.", repo.ApplicationUnderTest.AO1_Attorney_FirmNameInfo, new RecordItemIndex(2)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_FirmNameInfo, "TagValue", AO1_Attorney_FirmName); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_FirmName, new RecordItemIndex(3)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_FirstName) on item 'ApplicationUnderTest.AO1_Attorney_FirstName'.", repo.ApplicationUnderTest.AO1_Attorney_FirstNameInfo, new RecordItemIndex(4)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_FirstNameInfo, "TagValue", AO1_Attorney_FirstName); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_FirstName, new RecordItemIndex(5)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_LastName) on item 'ApplicationUnderTest.AO1_Attorney_LastName'.", repo.ApplicationUnderTest.AO1_Attorney_LastNameInfo, new RecordItemIndex(6)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_LastNameInfo, "TagValue", AO1_Attorney_LastName); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_LastName, new RecordItemIndex(7)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_Address1) on item 'ApplicationUnderTest.AO1_Attorney_Address1'.", repo.ApplicationUnderTest.AO1_Attorney_Address1Info, new RecordItemIndex(8)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_Address1Info, "TagValue", AO1_Attorney_Address1); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_Address1, new RecordItemIndex(9)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_Address2) on item 'ApplicationUnderTest.AO1_Attorney_Address2'.", repo.ApplicationUnderTest.AO1_Attorney_Address2Info, new RecordItemIndex(10)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_Address2Info, "TagValue", AO1_Attorney_Address2); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_Address2, new RecordItemIndex(11)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_City) on item 'ApplicationUnderTest.AO1_Attorney_City'.", repo.ApplicationUnderTest.AO1_Attorney_CityInfo, new RecordItemIndex(12)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_CityInfo, "TagValue", AO1_Attorney_City); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_City, new RecordItemIndex(13)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_State) on item 'ApplicationUnderTest.AO1_Attorney_State'.", repo.ApplicationUnderTest.AO1_Attorney_StateInfo, new RecordItemIndex(14)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_StateInfo, "TagValue", AO1_Attorney_State); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_State, new RecordItemIndex(15)); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO1_Attorney_Zip' and assigning its value to variable 'AO1_Attorney_Zip'.", repo.ApplicationUnderTest.AO1_Attorney_ZipInfo, new RecordItemIndex(16)); AO1_Attorney_Zip = repo.ApplicationUnderTest.AO1_Attorney_Zip.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_Zip) on item 'ApplicationUnderTest.AO1_Attorney_Zip'.", repo.ApplicationUnderTest.AO1_Attorney_ZipInfo, new RecordItemIndex(17)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_ZipInfo, "TagValue", AO1_Attorney_Zip); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "User", AO1_Attorney_Zip, new RecordItemIndex(18)); Report.Screenshot(ReportLevel.Info, "User", "", repo.PegaCaseManagerPortalGoogleChrome.Screenshot_Window, false, new RecordItemIndex(19)); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.AO_AD_EmailId' at Center.", repo.ApplicationUnderTest.AO_AD_EmailIdInfo, new RecordItemIndex(20)); repo.ApplicationUnderTest.AO_AD_EmailId.Click(); Delay.Milliseconds(200); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO1_Attorney_RepDate' and assigning its value to variable 'AO1_Attorney_RepDate'.", repo.ApplicationUnderTest.AO1_Attorney_RepDateInfo, new RecordItemIndex(21)); AO1_Attorney_RepDate = repo.ApplicationUnderTest.AO1_Attorney_RepDate.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_RepDate, new RecordItemIndex(22)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_RepDate) on item 'ApplicationUnderTest.AO1_Attorney_RepDate'.", repo.ApplicationUnderTest.AO1_Attorney_RepDateInfo, new RecordItemIndex(23)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO1_Attorney_RepDateInfo, "TagValue", AO1_Attorney_RepDate); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_UseType' and assigning its value to variable 'AO1_Attorney_UseType'.", repo.ApplicationUnderTest.AO_AD_UseTypeInfo, new RecordItemIndex(24)); AO1_Attorney_UseType = repo.ApplicationUnderTest.AO_AD_UseType.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_UseType, new RecordItemIndex(25)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_UseType) on item 'ApplicationUnderTest.AO_AD_UseType'.", repo.ApplicationUnderTest.AO_AD_UseTypeInfo, new RecordItemIndex(26)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_UseTypeInfo, "TagValue", AO1_Attorney_UseType); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_PhoneType' and assigning its value to variable 'AO1_Attorney_PhoneType'.", repo.ApplicationUnderTest.AO_AD_PhoneTypeInfo, new RecordItemIndex(27)); AO1_Attorney_PhoneType = repo.ApplicationUnderTest.AO_AD_PhoneType.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_PhoneType, new RecordItemIndex(28)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_PhoneType) on item 'ApplicationUnderTest.AO_AD_PhoneType'.", repo.ApplicationUnderTest.AO_AD_PhoneTypeInfo, new RecordItemIndex(29)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_PhoneTypeInfo, "TagValue", AO1_Attorney_PhoneType); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_Source' and assigning its value to variable 'AO1_Attorney_Source'.", repo.ApplicationUnderTest.AO_AD_SourceInfo, new RecordItemIndex(30)); AO1_Attorney_Source = repo.ApplicationUnderTest.AO_AD_Source.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_Source, new RecordItemIndex(31)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_Source) on item 'ApplicationUnderTest.AO_AD_Source'.", repo.ApplicationUnderTest.AO_AD_SourceInfo, new RecordItemIndex(32)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_SourceInfo, "TagValue", AO1_Attorney_Source); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_PhoneNumber' and assigning its value to variable 'AO1_Attorney_PhoneNumber'.", repo.ApplicationUnderTest.AO_AD_PhoneNumberInfo, new RecordItemIndex(33)); AO1_Attorney_PhoneNumber = repo.ApplicationUnderTest.AO_AD_PhoneNumber.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_PhoneNumber, new RecordItemIndex(34)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_PhoneNumber) on item 'ApplicationUnderTest.AO_AD_PhoneNumber'.", repo.ApplicationUnderTest.AO_AD_PhoneNumberInfo, new RecordItemIndex(35)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_PhoneNumberInfo, "TagValue", AO1_Attorney_PhoneNumber); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_EmailUseType' and assigning its value to variable 'AO1_Attorney_EmailUseType'.", repo.ApplicationUnderTest.AO_AD_EmailUseTypeInfo, new RecordItemIndex(36)); AO1_Attorney_EmailUseType = repo.ApplicationUnderTest.AO_AD_EmailUseType.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_EmailUseType, new RecordItemIndex(37)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_EmailUseType) on item 'ApplicationUnderTest.AO_AD_EmailUseType'.", repo.ApplicationUnderTest.AO_AD_EmailUseTypeInfo, new RecordItemIndex(38)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_EmailUseTypeInfo, "TagValue", AO1_Attorney_EmailUseType); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_EmailSource' and assigning its value to variable 'AO1_Attorney_EmailSource'.", repo.ApplicationUnderTest.AO_AD_EmailSourceInfo, new RecordItemIndex(39)); AO1_Attorney_EmailSource = repo.ApplicationUnderTest.AO_AD_EmailSource.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_EmailSource, new RecordItemIndex(40)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_EmailSource) on item 'ApplicationUnderTest.AO_AD_EmailSource'.", repo.ApplicationUnderTest.AO_AD_EmailSourceInfo, new RecordItemIndex(41)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_EmailSourceInfo, "TagValue", AO1_Attorney_EmailSource); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'TagValue' from item 'ApplicationUnderTest.AO_AD_EmailId' and assigning its value to variable 'AO1_Attorney_Email'.", repo.ApplicationUnderTest.AO_AD_EmailIdInfo, new RecordItemIndex(42)); AO1_Attorney_Email = repo.ApplicationUnderTest.AO_AD_EmailId.Element.GetAttributeValueText("TagValue"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "User", AO1_Attorney_Email, new RecordItemIndex(43)); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue=$AO1_Attorney_Email) on item 'ApplicationUnderTest.AO_AD_EmailId'.", repo.ApplicationUnderTest.AO_AD_EmailIdInfo, new RecordItemIndex(44)); Validate.AttributeEqual(repo.ApplicationUnderTest.AO_AD_EmailIdInfo, "TagValue", AO1_Attorney_Email); Delay.Milliseconds(0); Report.Screenshot(ReportLevel.Info, "User", "", repo.PegaCaseManagerPortalGoogleChrome.Screenshot_Window, false, new RecordItemIndex(45)); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.SubmitButton1' at 46;15.", repo.ApplicationUnderTest.SubmitButton1Info, new RecordItemIndex(46)); repo.ApplicationUnderTest.SubmitButton1.Click("46;15"); Delay.Milliseconds(0); }
/// <summary> /// Check that the report result has been saved and set information /// </summary> public override void Process(Report report) { var script = string.IsNullOrEmpty(ProcessingScript) ? ProcessingScriptTemplate : ProcessingScript; RazorHelper.CompileExecute(script, report); }
public Report CreateReport(Report report) { _ctx.Reports.Add(report); _ctx.SaveChanges(); return(report); }
public void Setup() { _dbContextFacade = new Mock <IDBContextFacade>(MockBehavior.Loose); _dataConverter = new Mock <IDataConverter>(MockBehavior.Strict); _postFactory = new Mock <IPostFactory>(MockBehavior.Strict); _databaseImitation = new Mock <ApplicationDbContext>(MockBehavior.Loose); _dbsetMockPost = new Mock <DbSet <Post> >(MockBehavior.Strict); _dbsetMockUser = new Mock <DbSet <ApplicationUser> >(MockBehavior.Strict); _dbsetMockComment = new Mock <DbSet <Comment> >(MockBehavior.Strict); _dbsetMockLike = new Mock <DbSet <Like> >(MockBehavior.Strict); _dbsetMockReport = new Mock <DbSet <Report> >(MockBehavior.Strict); User = new ApplicationUser() { Id = "randomId", UserPosts = new List <Post>() }; post1 = new Post() { Id = 0, Author = "Shrekko", AuthorId = "randomId", Title = "MockPost", Content = "RandomContent", SubTitle = "Shrej", User = User, Likes = new List <Like>() }; post2 = new Post() { Id = 1, Author = "Shrekkoko", AuthorId = "randomId2", Title = "MockPost2", Content = "RandomContent2", SubTitle = "rORKA", User = User, Likes = new List <Like>() }; postList = new List <Post>(); postList.Add(post1); postList.Add(post2); comment1 = new Comment() { Id = 1, Author = "Shrekko", AuthorId = "randomId1", Content = "RandomContent1", User = User, Post = post1, Reports = new List <Report>() }; comment2 = new Comment() { Id = 2, Author = "Shrekkoko", AuthorId = "randomId2", Content = "RandomContent2", User = User, Post = post2, Reports = new List <Report>() }; positiveLike = new Like() { Id = 1, RatingType = RatingType.Positive, User = User, UserID = User.Id }; negativeLike = new Like() { Id = 2, RatingType = RatingType.Negative, User = User, UserID = User.Id }; likeList = new List <Like>(); likeList.Add(positiveLike); likeList.Add(negativeLike); report1 = new Report() { Id = 1, Comment = comment1, ReportText = "UMMAYAD", SenderName = User.UserName, CommentId = comment1.Id }; report2 = new Report() { Id = 2, Comment = comment2, ReportText = "BAD comment, indeed aga", SenderName = User.UserName, CommentId = comment2.Id }; reportList = new List <Report>(); reportList.Add(report1); reportList.Add(report2); userList = new List <ApplicationUser>(); userList.Add(User); commentList = new List <Comment>(); commentList.Add(comment1); commentList.Add(comment2); User.UserPosts = postList; _dbContextFacade.Setup(x => x.GetDBContext()).Returns(_databaseImitation.Object); _databaseImitation.Setup(x => x.Set <Post>()).Returns(_dbsetMockPost.Object); _dbsetMockPost.As <IQueryable <Post> >().Setup(m => m.Provider).Returns(postList.AsQueryable().Provider); _dbsetMockPost.As <IQueryable <Post> >().Setup(m => m.Expression).Returns(postList.AsQueryable().Expression); _dbsetMockPost.As <IQueryable <Post> >().Setup(m => m.ElementType).Returns(postList.AsQueryable().ElementType); _dbsetMockPost.As <IQueryable <Post> >().Setup(m => m.GetEnumerator()).Returns(postList.AsQueryable().GetEnumerator()); _dbsetMockPost.As <IEnumerable <Post> >().Setup(m => m.GetEnumerator()).Returns(postList.AsQueryable().GetEnumerator()); _dbsetMockComment.As <IQueryable <Comment> >().Setup(m => m.Provider).Returns(commentList.AsQueryable().Provider); _dbsetMockComment.As <IQueryable <Comment> >().Setup(m => m.Expression).Returns(commentList.AsQueryable().Expression); _dbsetMockComment.As <IQueryable <Comment> >().Setup(m => m.ElementType).Returns(commentList.AsQueryable().ElementType); _dbsetMockComment.As <IQueryable <Comment> >().Setup(m => m.GetEnumerator()).Returns(commentList.AsQueryable().GetEnumerator()); _dbsetMockComment.As <IEnumerable <Comment> >().Setup(m => m.GetEnumerator()).Returns(commentList.AsQueryable().GetEnumerator()); _dbsetMockReport.As <IQueryable <Report> >().Setup(m => m.Provider).Returns(reportList.AsQueryable().Provider); _dbsetMockReport.As <IQueryable <Report> >().Setup(m => m.Expression).Returns(reportList.AsQueryable().Expression); _dbsetMockReport.As <IQueryable <Report> >().Setup(m => m.ElementType).Returns(reportList.AsQueryable().ElementType); _dbsetMockReport.As <IQueryable <Report> >().Setup(m => m.GetEnumerator()).Returns(reportList.AsQueryable().GetEnumerator()); _dbsetMockReport.As <IEnumerable <Report> >().Setup(m => m.GetEnumerator()).Returns(reportList.AsQueryable().GetEnumerator()); _dbsetMockLike.As <IQueryable <Like> >().Setup(m => m.Provider).Returns(likeList.AsQueryable().Provider); _dbsetMockLike.As <IQueryable <Like> >().Setup(m => m.Expression).Returns(likeList.AsQueryable().Expression); _dbsetMockLike.As <IQueryable <Like> >().Setup(m => m.ElementType).Returns(likeList.AsQueryable().ElementType); _dbsetMockLike.As <IQueryable <Like> >().Setup(m => m.GetEnumerator()).Returns(likeList.AsQueryable().GetEnumerator()); _dbsetMockLike.As <IEnumerable <Like> >().Setup(m => m.GetEnumerator()).Returns(likeList.AsQueryable().GetEnumerator()); _dbsetMockUser.As <IQueryable <ApplicationUser> >().Setup(m => m.Provider).Returns(userList.AsQueryable().Provider); _dbsetMockUser.As <IQueryable <ApplicationUser> >().Setup(m => m.Expression).Returns(userList.AsQueryable().Expression); _dbsetMockUser.As <IQueryable <ApplicationUser> >().Setup(m => m.ElementType).Returns(userList.AsQueryable().ElementType); _dbsetMockUser.As <IQueryable <ApplicationUser> >().Setup(m => m.GetEnumerator()).Returns(userList.AsQueryable().GetEnumerator()); _dbsetMockUser.As <IEnumerable <ApplicationUser> >().Setup(m => m.GetEnumerator()).Returns(userList.AsQueryable().GetEnumerator()); _dbsetMockPost.Setup(m => m.Find(It.IsAny <object[]>())).Returns <object[]>(ids => postList.AsQueryable().FirstOrDefault(d => d.Id == (int)ids[0])); _dbsetMockComment.Setup(m => m.Find(It.IsAny <object[]>())).Returns <object[]>(ids => commentList.AsQueryable().FirstOrDefault(d => d.Id == (int)ids[0])); _dbsetMockReport.Setup(m => m.Find(It.IsAny <object[]>())).Returns <object[]>(ids => reportList.AsQueryable().FirstOrDefault(d => d.Id == (int)ids[0])); _dbsetMockLike.Setup(x => x.Remove(negativeLike)).Callback <Like>((entity) => likeList.Remove(entity)); _dbsetMockLike.Setup(x => x.Remove(positiveLike)).Callback <Like>((entity) => likeList.Remove(entity)); _dbsetMockPost.Setup(m => m.Remove(It.IsAny <Post>())).Callback <Post>((entity) => postList.Remove(entity)); _databaseImitation.Setup(x => x.Posts.Remove(It.IsAny <Post>())).Callback <Post>((entity) => postList.Remove(entity)); _databaseImitation.Setup(x => x.Posts).Returns(_dbsetMockPost.Object); _databaseImitation.Setup(x => x.Users).Returns(_dbsetMockUser.Object); _databaseImitation.Setup(x => x.Comments).Returns(_dbsetMockComment.Object); _databaseImitation.Setup(x => x.PostLikes).Returns(_dbsetMockLike.Object); _databaseImitation.Setup(x => x.Reports).Returns(_dbsetMockReport.Object); _postFactory.Setup(x => x.CreateLike(It.IsAny <int>(), It.IsAny <string>(), RatingType.Positive)).Returns(positiveLike); _postFactory.Setup(x => x.CreateLike(It.IsAny <int>(), It.IsAny <string>(), RatingType.Negative)) .Returns(negativeLike); _databaseImitation.Setup(x => x.PostLikes.Remove(negativeLike)).Callback <Like>((entity) => likeList.Remove(entity)); _databaseImitation.Setup(x => x.PostLikes.Remove(positiveLike)).Callback <Like>((entity) => likeList.Remove(entity)); _databaseImitation.Setup(x => x.SaveChanges()); _blogRepository = new BlogRepository(_dbContextFacade.Object, _dataConverter.Object, _postFactory.Object); }
void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.00; Init(); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Id='MaxUsers') on item 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(0)); Validate.Attribute(repo.WebDocument19216801.MaxUsersInfo, "Id", "MaxUsers"); Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue='155') on item 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(1)); //Validate.Attribute(repo.WebDocument19216801.MaxUsersInfo, "TagValue", "155"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Value='155') on item 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(2)); //Validate.Attribute(repo.WebDocument19216801.MaxUsersInfo, "Value", "155"); //Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.MaxUsers' at 15;14.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(3)); repo.WebDocument19216801.MaxUsers.Click("15;14"); Delay.Milliseconds(200); Report.Log(ReportLevel.Info, "Keyboard", "Key 'Ctrl+A' Press with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(4)); Keyboard.PrepareFocus(repo.WebDocument19216801.MaxUsers); Keyboard.Press(System.Windows.Forms.Keys.A | System.Windows.Forms.Keys.Control, 30, Keyboard.DefaultKeyPressTime, 1, true); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '277' with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(5)); repo.WebDocument19216801.MaxUsers.PressKeys("277"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Tab}' with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(6)); repo.WebDocument19216801.MaxUsers.PressKeys("{Tab}"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.DHCPv4' at 58;24.", repo.WebDocument19216801.DHCPv4Info, new RecordItemIndex(7)); repo.WebDocument19216801.DHCPv4.Click("58;24"); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Class='errTipClose') on item 'WebDocument19216801.ErrCloseMaxUsers'.", repo.WebDocument19216801.ErrCloseMaxUsersInfo, new RecordItemIndex(8)); Validate.Attribute(repo.WebDocument19216801.ErrCloseMaxUsersInfo, "Class", "errTipClose"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Id='errClose-MaxUsers') on item 'WebDocument19216801.ErrCloseMaxUsers'.", repo.WebDocument19216801.ErrCloseMaxUsersInfo, new RecordItemIndex(9)); Validate.Attribute(repo.WebDocument19216801.ErrCloseMaxUsersInfo, "Id", "errClose-MaxUsers"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Class='settings-updates-success settings-updates-error') on item 'WebDocument19216801.SettingsUpdatesSuccessSettingsUpdate'.", repo.WebDocument19216801.SettingsUpdatesSuccessSettingsUpdateInfo, new RecordItemIndex(10)); Validate.Attribute(repo.WebDocument19216801.SettingsUpdatesSuccessSettingsUpdateInfo, "Class", "settings-updates-success settings-updates-error"); Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating ContainsImage (Screenshot: 'Screenshot1' with region {X=0,Y=0,Width=712,Height=61}) on item 'WebDocument19216801.SettingsUpdatesSuccessSettingsUpdate'.", repo.WebDocument19216801.SettingsUpdatesSuccessSettingsUpdateInfo, new RecordItemIndex(11)); //Validate.ContainsImage(repo.WebDocument19216801.SettingsUpdatesSuccessSettingsUpdateInfo, SettingsUpdatesSuccessSettingsUpdate_Screenshot1, SettingsUpdatesSuccessSettingsUpdate_Screenshot1_Options); //Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Class='confirm-wizard-text') on item 'WebDocumentIE.SorryThereWasAnErrorWhileUpdating'.", repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo, new RecordItemIndex(12)); Validate.Attribute(repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo, "Class", "confirm-wizard-text"); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (InnerText='Sorry! There was an error while updating your settings. Please try again a bit later.') on item 'WebDocumentIE.SorryThereWasAnErrorWhileUpdating'.", repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo, new RecordItemIndex(13)); Validate.Attribute(repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo, "InnerText", "Sorry! There was an error while updating your settings. Please try again a bit later."); Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.MaxUsers' at 49;14.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(14)); //repo.WebDocument19216801.MaxUsers.Click("49;14"); //Delay.Milliseconds(200); //Report.Log(ReportLevel.Info, "Keyboard", "Key 'Ctrl+A' Press with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(15)); //Keyboard.PrepareFocus(repo.WebDocument19216801.MaxUsers); //Keyboard.Press(System.Windows.Forms.Keys.A | System.Windows.Forms.Keys.Control, 30, Keyboard.DefaultKeyPressTime, 1, true); //Delay.Milliseconds(0); //Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Delete}' with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(16)); //repo.WebDocument19216801.MaxUsers.PressKeys("{Delete}"); //Delay.Milliseconds(0); //Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'abb' with focus on 'WebDocument19216801.MaxUsers'.", repo.WebDocument19216801.MaxUsersInfo, new RecordItemIndex(17)); //repo.WebDocument19216801.MaxUsers.PressKeys("abb"); //Delay.Milliseconds(0); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.DHCPv4' at 58;24.", repo.WebDocument19216801.DHCPv4Info, new RecordItemIndex(18)); //repo.WebDocument19216801.DHCPv4.Click("58;24"); //Delay.Milliseconds(200); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.DHCPv4' at 73;20.", repo.WebDocument19216801.DHCPv4Info, new RecordItemIndex(19)); //repo.WebDocument19216801.DHCPv4.Click("73;20"); //Delay.Milliseconds(200); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Id='confirm-wizard') on item 'WebDocumentIE.ConfirmWizard1.ConfirmWizard'.", repo.WebDocumentIE.ConfirmWizard1.ConfirmWizardInfo, new RecordItemIndex(20)); //Validate.Attribute(repo.WebDocumentIE.ConfirmWizard1.ConfirmWizardInfo, "Id", "confirm-wizard"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Class='confirm-wizard-text') on item 'WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdated'.", repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, new RecordItemIndex(21)); //Validate.Attribute(repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, "Class", "confirm-wizard-text"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (InnerText='Your settings have been updated.') on item 'WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdated'.", repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, new RecordItemIndex(22)); //Validate.Attribute(repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, "InnerText", "Your settings have been updated."); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating ContainsImage (Screenshot: 'Screenshot2' with region {X=0,Y=0,Width=237,Height=48}) on item 'WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdated'.", repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, new RecordItemIndex(23)); //Validate.ContainsImage(repo.WebDocumentIE.ConfirmWizard1.YourSettingsHaveBeenUpdatedInfo, YourSettingsHaveBeenUpdated_Screenshot2, YourSettingsHaveBeenUpdated_Screenshot2_Options); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Id='LeaseTime') on item 'WebDocument19216801.LeaseTime'.", repo.WebDocument19216801.LeaseTimeInfo, new RecordItemIndex(24)); //Validate.Attribute(repo.WebDocument19216801.LeaseTimeInfo, "Id", "LeaseTime"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (TagValue='86400') on item 'WebDocument19216801.LeaseTime'.", repo.WebDocument19216801.LeaseTimeInfo, new RecordItemIndex(25)); //Validate.Attribute(repo.WebDocument19216801.LeaseTimeInfo, "TagValue", "86400"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Tabindex='7') on item 'WebDocument19216801.LeaseTime'.", repo.WebDocument19216801.LeaseTimeInfo, new RecordItemIndex(26)); //Validate.Attribute(repo.WebDocument19216801.LeaseTimeInfo, "Tabindex", "7"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Value='86400') on item 'WebDocument19216801.LeaseTime'.", repo.WebDocument19216801.LeaseTimeInfo, new RecordItemIndex(27)); //Validate.Attribute(repo.WebDocument19216801.LeaseTimeInfo, "Value", "86400"); //Delay.Milliseconds(100); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Down item 'WebDocument19216801.WebDocument19216801' at 1908;175.", repo.WebDocument19216801.WebDocument19216801Info, new RecordItemIndex(28)); //repo.WebDocument19216801.WebDocument19216801.MoveTo("1908;175"); //Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left); //Delay.Milliseconds(200); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Up item 'WebDocument19216801.WebDocument19216801' at 1918;884.", repo.WebDocument19216801.WebDocument19216801Info, new RecordItemIndex(29)); //repo.WebDocument19216801.WebDocument19216801.MoveTo("1918;884"); //Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left); //Delay.Milliseconds(200); //Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocument19216801.IPDelete' at 90;27.", repo.WebDocument19216801.IPDeleteInfo, new RecordItemIndex(30)); //repo.WebDocument19216801.IPDelete.Click("90;27"); //Delay.Milliseconds(200); }
/// <summary> /// Initializes a new instance of the ReportBuilderTemplate class. /// </summary> /// <param name="entityType"></param> public ReportTemplateBuilder(Type entityType) { _Report = new Report(); _Report.EntityTypeId = EntityTypeCache.GetId(entityType); }
public override bool Send(string fileName, Stream file, Report report, SerializableException exception) { if (string.IsNullOrEmpty(Username) || Username.Trim().Length == 0) { throw new ArgumentNullException("Username"); } if (string.IsNullOrEmpty(Password) || Password.Trim().Length == 0) { throw new ArgumentNullException("Password"); } if (string.IsNullOrEmpty(Url) || Url.Trim().Length == 0) { throw new ArgumentNullException("Url"); } if (ProjectId <= 0) { throw new ArgumentNullException("ProjectId"); } if (string.IsNullOrEmpty(Category) || Category.Trim().Length == 0) { throw new ArgumentNullException("Category"); } if (string.IsNullOrEmpty(Description) || Description.Trim().Length == 0) { Description = exception.ToString(); } if (string.IsNullOrEmpty(Summary) || Summary.Trim().Length == 0) { Summary = report.GeneralInfo.ExceptionMessage + " @ " + report.GeneralInfo.TargetSite; } if (string.IsNullOrEmpty(AdditionalInformation) || AdditionalInformation.Trim().Length == 0) { AdditionalInformation = report.ToString(); } var service = new MantisConnectService(new BasicHttpBinding(), new EndpointAddress(Url)); var user = service.mc_login(Username, Password); Logger.Info(String.Format("Successfully logged in to Mantis bug tracker as {0}", user.account_data.real_name)); var issue = new IssueData(); issue.date_submitted = DateTime.Now; issue.date_submittedSpecified = true; issue.version = report.GeneralInfo.HostApplicationVersion; issue.os = Environment.OSVersion.ToString(); issue.os_build = Environment.OSVersion.Version.ToString(); issue.platform = Environment.OSVersion.Platform.ToString(); issue.reporter = user.account_data; issue.project = new ObjectRef() { id = ProjectId.ToString(CultureInfo.InvariantCulture), name = String.Empty }; issue.category = Category; issue.summary = Summary; issue.description = Description; issue.additional_information = AdditionalInformation; issue.steps_to_reproduce = StepsToReproduce; issue.severity = new ObjectRef() { id = Severity.ToString(CultureInfo.InvariantCulture), name = Severity.ToString(CultureInfo.InvariantCulture) }; issue.status = new ObjectRef() { id = Status.ToString(CultureInfo.InvariantCulture), name = Status.ToString(CultureInfo.InvariantCulture) }; bool success = false; if (AddVersionIfNotExists) { var versions = service.mc_project_get_versions(Username, Password, ProjectId.ToString(CultureInfo.InvariantCulture)); if (versions.Count() == 0 || !versions.Any(x => x.name == report.GeneralInfo.HostApplicationVersion.ToString(CultureInfo.InvariantCulture))) { var version = new ProjectVersionData { name = report.GeneralInfo.HostApplicationVersion.ToString(CultureInfo.InvariantCulture), project_id = ProjectId.ToString(CultureInfo.InvariantCulture), released = true, releasedSpecified = true, date_order = DateTime.Now, date_orderSpecified = true, description = "Added by NBug" }; var versionId = service.mc_project_version_add(Username, Password, version); Logger.Info(String.Format("Successfully added new version id {0} to Mantis bug tracker", versionId)); } } int bugId; Int32.TryParse(service.mc_issue_add(Username, Password, issue), out bugId); if (bugId > 0) { Logger.Info(String.Format("Successfully added new issue id {0} to Mantis bug tracker", bugId)); success = true; if (SendAttachment) { if (file != null && file.Length > 0) { if (!SuccessIfAttachmentFails) { success = false; } try { var attachment = new byte[file.Length]; file.Position = 0; file.Read(attachment, 0, Convert.ToInt32(file.Length)); var attachmentId = service.mc_issue_attachment_add(Username, Password, bugId.ToString(CultureInfo.InvariantCulture), fileName, "application/zip", attachment); Logger.Info(String.Format("Successfully added attachment id {0} for isssue id {1} to Mantis bug tracker", attachmentId, bugId)); success = true; } catch (Exception ex) { Logger.Error(String.Format("Failed to upload attachment with issue id {0} to Mantis bug tracker{1}{2}", bugId, Environment.NewLine, ex.Message)); if (!SuccessIfAttachmentFails) { throw; } } } } } return(success); }
protected abstract bool ValidateInternal(INode focusNode, IEnumerable <INode> valueNodes, Report report, SparqlQuery query);
public void Install() { string[] exeList = Directory.GetFiles(@"./Resources/", "DellUpdate*"); if (repo.DHSForm.DellUpdateText1Info.Exists(15000) && repo.DHSForm.DellUpdateText2Info.Exists(15000) && repo.DHSForm.INSTALLInfo.Exists(15000)) { Report.Success("Dell update text displayed correctly"); } if (exeList.Length != 0) { File.Delete(exeList[0]); Delay.Seconds(15); } repo.DHSForm.INSTALL.Click(); Delay.Seconds(2); Keyboard.Press("{ENTER}"); Delay.Seconds(2); Keyboard.Press("{TAB 2}"); Delay.Seconds(1); Keyboard.Press("{ENTER}"); Delay.Seconds(2); repo.SaveAs.Item202.Click(); Delay.Seconds(2); Keyboard.Press(Directory.GetCurrentDirectory() + "\\Resources\\"); Delay.Seconds(2); Keyboard.Press("{ENTER}"); Delay.Seconds(2); repo.SaveAs.Save.Click(); Delay.Seconds(20); repo.MicrosoftEdge.Self.As <Ranorex.Form>().Close(); exeList = Directory.GetFiles(@"./Resources/", "DellUpdate*"); if (exeList.Length > 0) { Report.Success("Dell Update download successfull"); } else { Report.Failure("Dell Update download failure"); } exeList = Directory.GetFiles(@"./Resources/Installer", "DellUpdate*"); Process.Start(Directory.GetCurrentDirectory() + exeList[0]); Delay.Seconds(5); if (repo.DellUpdate17Setup.SelfInfo.Exists(15000)) { repo.DellUpdate17Setup.ButtonInstall.Click(); Delay.Seconds(30); repo.DellUpdate17Setup.ButtonClose.Click(); Delay.Seconds(2); } // repo.DellUpdateSetup.Next.Click(); // Delay.Seconds(2); // repo.DellUpdateSetup.CheckNext.Click(); // Delay.Seconds(2); // repo.DellUpdateSetup.Next.Click(); // Delay.Seconds(2); // repo.DellUpdateSetup.ButtonInstall.Click(); // Delay.Seconds(20); // repo.DellUpdateSetup.ButtonFinish.Click(); // Delay.Seconds(2); if (File.Exists(@"C:\Program Files (x86)\Dell Update\DellUpService.exe")) { Report.Success("Dell Update install successfull"); } else { Report.Failure("Dell update install failure"); } }
internal override bool Validate(INode focusNode, IEnumerable <INode> valueNodes, Report report) { var queryString = new SparqlParameterizedString(Query); foreach (var item in Prefixes) { queryString.Namespaces.AddNamespace(item.Prefix, item.Namespace); } var query = new SparqlQueryParser().ParseFromString(queryString); Validate(query.RootGraphPattern); BindFocusNode(query.RootGraphPattern, focusNode); query.RootGraphPattern.TriplePatterns.Insert(0, new BindPattern("currentShape", new ConstantTerm(Shape))); query.RootGraphPattern.TriplePatterns.Insert(0, new BindPattern("shapesGraph", new ConstantTerm(Shape.Graph.CreateUriNode(Shape.GraphUri)))); foreach (var parameter in Parameters) { query.RootGraphPattern.TriplePatterns.Insert(0, new BindPattern(parameter.Key, new ConstantTerm(parameter.Value))); } return(ValidateInternal(focusNode, valueNodes, report, query)); }