コード例 #1
0
        public void TC06_ImportDashboardReport()
        {
            HomeObject      homeObj      = new HomeObject(driver);
            HomeAction      homePageAct  = new HomeAction(driver);
            DashboardAction dashboardAct = new DashboardAction(driver);
            ReportingAction reportAct    = new ReportingAction(driver);
            string          fileName     = string.Empty;

            try
            {
                Console.WriteLine("Test Started");

                WaitForMoment(5);
                homePageAct.ClickOnDashboardLink();
                dashboardAct.SelectTheDashboardReport11(driver, out fileName);
                dashboardAct.ClickOnExportButton();
                dashboardAct.CreateCopyFile(fileName + ".dashboard", @"C:\Users\z003uutr\Downloads");
                dashboardAct.ClickOnImportButton();
                dashboardAct.ClickOnSelectFileAndEnterPath(@"C:\Users\z003uutr\Downloads" + "\\" + "Copy_" + fileName + ".dashboard");
                reportAct.ClickOnSaveReportButton();
                dashboardAct.SelectTheDashboardReport(driver, fileName);
                dashboardAct.ClickOnDeleteButton();
                reportAct.ClickOnYesButton();
                dashboardAct.DeleteFiles(@"C:\Users\z003uutr\Downloads");

                Console.WriteLine("Test Finished");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
        public void TC06_CreateReportForDashboard_UsingChartWidget()
        {
            HomeObject      homeObj             = new HomeObject(driver);
            HomeAction      homePageAct         = new HomeAction(driver);
            DashboardAction dashboardAct        = new DashboardAction(driver);
            ReportingAction reportAct           = new ReportingAction(driver);
            Random          random              = new Random();
            string          dashboardReportName = "Test_DashboardChartName_" + random.Next(0, 400);

            try
            {
                Console.WriteLine("Test Started");

                WaitForMoment(4);
                homePageAct.ClickOnDashboardLink();
                WaitForMoment(4);
                dashboardAct.ClickOnCreate();
                WaitForMoment(4);
                dashboardAct.SelectChart(driver);
                WaitForMoment(4);
                dashboardAct.ClickOnAddTimeFilterButton();
                WaitForMoment(4);
                reportAct.ExpandALL();
                WaitForMoment(4);
                dashboardAct.ClickOnAlaramItem();
                WaitForMoment(4);
                dashboardAct.ClickOnTotalAlaramCountButton();
                WaitForMoment(4);
                dashboardAct.ClickOnSaveTimeFilterButton();
                WaitForMoment(4);
                reportAct.ClickOnSaveReportButton();
                WaitForMoment(4);
                //dashboardAct.HandleException();
                WaitForMoment(4);
                dashboardAct.ClickOnSaveOneReportButton();
                WaitForMoment(4);
                dashboardAct.EnterDashboardReportName(dashboardReportName);
                WaitForMoment(4);
                dashboardAct.ClickOnAddTimeFilterButton();
                WaitForMoment(4);
                dashboardAct.EnterTimefilterName("Timefilter_Name_" + random.Next(400, 800));
                WaitForMoment(4);
                dashboardAct.ClickOnSaveTimeFilterButton();
                WaitForMoment(4);
                reportAct.ClickOnSaveReportButton();
                WaitForMoment(4);
                dashboardAct.SelectTheDashboardReport(driver, dashboardReportName);
                WaitForMoment(4);
                dashboardAct.ClickOnDeleteButton();
                WaitForMoment(4);
                reportAct.ClickOnYesButton();
                WaitForMoment(10);

                Console.WriteLine("Test Finished");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #3
0
        public void TC05_CreateReportForMessageTemplate()
        {
            HomeObject      homeObj     = new HomeObject(driver);
            HomeAction      homePageAct = new HomeAction(driver);
            ReportingAction reportAct   = new ReportingAction(driver);

            try
            {
                Console.WriteLine("Test Started");

                WaitForMoment(4);
                homePageAct.ClickOnReportsLink();
                WaitForMoment(4);
                reportAct.ExpandALL();
                reportAct.ExpandALL();
                reportAct.ExpandALL();
                reportAct.ExpandALL();
                reportAct.ClickOnDurationUntilAcknowledgementReport();
                WaitForMoment(4);
                reportAct.ClickOnCreateReportButton();
                WaitForMoment(4);
                reportAct.EnterStartDateTime("11/19/2017 4:37:10 PM");
                WaitForMoment(4);
                reportAct.ClickOnShowPreviewButton();
                WaitForMoment(15);
                reportAct.ClickOnCreateReportButtonAfterPreview();
                WaitForMoment(4);
                reportAct.EnterReportName("IS_Report_" + DateTime.Now.Millisecond);
                WaitForMoment(4);
                reportAct.ClickOnSaveReportButton();
                WaitForMoment(10);

                // Deletes the Created Report
                reportAct.SelectFirstReport();
                WaitForMoment(4);
                reportAct.ClickOnRemoveButton();
                WaitForMoment(4);
                reportAct.ClickOnYesButton();
                WaitForMoment(4);

                Console.WriteLine("Test Finished");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #4
0
ファイル: LogFile.cs プロジェクト: WilsonTucker/ZipformSimply
        public static void writeToLog(string message, ReportingAction action)
        {
            string fileName;
            string fileUploadTime;
            string errorEvent = string.Empty;
            StringBuilder strBuild = new StringBuilder();
            try
            {
                FileInfo objCopiedFile = new FileInfo(LogFilePath);
                fileName = objCopiedFile.Name;
                fileUploadTime = objCopiedFile.CreationTime.ToString();
            }
            catch (Exception ex)
            {
                fileName = Path.GetFileName(LogFilePath);
                fileUploadTime = "N/A";
                errorEvent = "cannot access file";
                HelperClass objHelper = new HelperClass();
                objHelper.WriteEventLog(String.Format("Cannot write to text log: Error: {0}", ex.Message), EventLogEntryType.Warning);
            }

            switch (action)
            {

                case ReportingAction.newFile:
                    strBuild.AppendLine("** File uploaded ***");
                    strBuild.AppendLine(String.Format("Name: {0}", fileName));
                    strBuild.AppendLine(String.Format("Time copied: {0}", fileUploadTime));
                    strBuild.AppendLine(String.Format("Start process time: {0}", DateTime.Now));
                    break;
                case ReportingAction.lineNumber:

                    break;
                case ReportingAction.error:
                     strBuild.AppendLine("** Error ***");
                     strBuild.AppendLine(String.Format("Encoutered error at: {0}", DateTime.Now));
                     strBuild.AppendLine(String.Format("{0}", message));
                    break;
                case ReportingAction.processStep:
                    strBuild.AppendLine("Processing---");
                    break;
                case ReportingAction.warning:
                    HelperClass objHelper = new HelperClass();
                    strBuild.AppendLine(String.Format("** WARNING: {0}", message));
                    objHelper.WriteEventLog(String.Format("WARNING: {0}", message), EventLogEntryType.Warning);
                    break;
            }

                // Output formatted string to logFile
            try
            {
                FileStream objFileStream = new FileStream(LogFilePath, FileMode.Open, FileAccess.Write);
                StreamWriter objStreamWriter = new StreamWriter(objFileStream);
                objFileStream.Seek(0, SeekOrigin.End);
                objStreamWriter.Write(strBuild);
                objStreamWriter.Close();
            }
            catch (Exception ex)
            {
                HelperClass objHelper = new HelperClass();
                objHelper.WriteEventLog(String.Format("Cannot write to text log: Error: {0}", ex.Message), EventLogEntryType.Warning);
            }
        }
コード例 #5
0
        public void TC06_CreateReportForDashboard_UsingReportWidget()
        {
            HomeObject      homeObj             = new HomeObject(driver);
            HomeAction      homePageAct         = new HomeAction(driver);
            DashboardAction dashboardAct        = new DashboardAction(driver);
            ReportingAction reportAct           = new ReportingAction(driver);
            Random          random              = new Random();
            string          dashboardReportName = "Test_DashboardChartName_" + random.Next(0, 400);

            try
            {
                Console.WriteLine("Test Started");

                WaitForMoment(4);
                homePageAct.ClickOnDashboardLink();
                WaitForMoment(4);
                dashboardAct.ClickOnCreate();
                WaitForMoment(4);
                dashboardAct.SelectReport(driver);
                WaitForMoment(4);
                dashboardAct.EnterTitle("DashBoardTesting_" + random.Next(800, 1000));
                WaitForMoment(4);
                reportAct.ExpandALL();
                reportAct.ClickOnDurationUntilAcknowledgementReport();
                WaitForMoment(4);
                dashboardAct.ClickOnSetReportParamaeterButton();
                WaitForMoment(4);
                reportAct.EnterStartDateTime("11/19/2017 4:37:10 PM");
                WaitForMoment(4);
                reportAct.ClickOnShowPreviewButton();
                WaitForMoment(15);
                dashboardAct.ClickOnSaveReportButton();
                WaitForMoment(4);
                reportAct.ClickOnSaveReportButton();
                WaitForMoment(20);
                dashboardAct.ClickOnSaveOneReportButton();
                WaitForMoment(4);
                dashboardAct.EnterDashboardReportName(dashboardReportName);
                WaitForMoment(4);
                dashboardAct.ClickOnAddTimeFilterButton();
                WaitForMoment(4);
                dashboardAct.EnterTimefilterName("Timefilter_Name_" + random.Next(400, 800));
                WaitForMoment(4);
                dashboardAct.ClickOnSaveTimeFilterButton();
                WaitForMoment(4);
                reportAct.ClickOnSaveReportButton();
                WaitForMoment(4);
                dashboardAct.SelectTheDashboardReport(driver, dashboardReportName);
                WaitForMoment(4);
                dashboardAct.ClickOnDeleteButton();
                WaitForMoment(4);
                reportAct.ClickOnYesButton();
                WaitForMoment(10);

                Console.WriteLine("Test Finished");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }