Esempio n. 1
0
        public int ClickOnTabs()
        {
            LaunchAppPage myRepo = new LaunchAppPage();
            bool          returned_value;

            //LaunchAppPage myRepo = LaunchAppPage.Instance;
            //myRepo.TempusSimulatorDemoTest1.LaunchAppPageElements.Events.click();
            //TempusSimulatorDemoTest1.LaunchAppPage myrepo = new LaunchAppPage();
            TempusSimulatorDemoTest1.LaunchAppPage myrepo = LaunchAppPage.Instance;

            ConfigFileReader obj    = new ConfigFileReader();
            string           config = obj.ConfigFileReaderGeneric();

            new LaunchAndCloseApp().OpenApp(obj.appName);


            myRepo.LaunchAppPageElements.New_Patient_Defaults.Click();
            string elementStringVal1 = myrepo.LaunchAppPageElements.New_Patient_Defaults.Title.ToString();

            returned_value = new CompareAttributes().CompareValidation(elementStringVal1, "New patient defaults");
            if (returned_value == true)
            {
                Report.Log(ReportLevel.Success, "Clicked on New patient defaults Tab");
            }


            myRepo.LaunchAppPageElements.Events.Click();
            string elementStringVal2 = myrepo.LaunchAppPageElements.Events.Title.ToString();

            returned_value = new CompareAttributes().CompareValidation(elementStringVal2, "Events");
            if (returned_value == true)
            {
                Report.Log(ReportLevel.Success, "Clicked on Events Tab");
            }

            myRepo.LaunchAppPageElements.Communications.Click();
            string elementStringVal3 = myrepo.LaunchAppPageElements.Communications.Caption.ToString();

            returned_value = new CompareAttributes().CompareValidation(elementStringVal3, "Communications");
            if (returned_value == true)
            {
                Report.Log(ReportLevel.Success, "Clicked on Communications Tab");
            }

            myRepo.LaunchAppPageElements.Codes_Other.Click();
            string elementStringVal4 = myrepo.LaunchAppPageElements.Codes_Other.Caption.ToString();

            returned_value = new CompareAttributes().CompareValidation(elementStringVal4, "Codes / Other");
            if (returned_value == true)
            {
                Report.Log(ReportLevel.Success, "Clicked on Codes / Other Tab");
            }
            Thread.Sleep(10000);

            int i = new LaunchAndCloseApp().CloseApp();

            return(i);
        }
Esempio n. 2
0
        public void LoadConfiguration()
        {
            ConfigFileReader obj    = new ConfigFileReader();
            string           config = obj.ConfigFileReaderGeneric();

            new LaunchAndCloseApp().OpenApp(obj.appName);

            LoadConfiguration myRepo1 = new LoadConfiguration();

            TempusSimulatorDemoTest1.LoadConfiguration myrepo1 = new LoadConfiguration();
            myrepo1.LoadConfigWebElements.TempusProConfigurationUtility.File1.Click();
            myrepo1.LoadConfigWebElements.TempusProConfigurationUtility1.Load.Click();
            myrepo1.LoadConfigWebElements.BrowseForFolder.TreeItem601033TempusProConfig.Click();
            myrepo1.LoadConfigWebElements.BrowseForFolder.ButtonOK.Click();
            Report.Log(ReportLevel.Success, "Configuration is loaded");
        }
Esempio n. 3
0
        public void TCRunner()
        {
            String    filepath = @"C:\Users\Renorex.Kolkata\Documents\Ranorex\RanorexStudio Projects\TempusProConfigUtility\TempusProConfigUtility\TempusProConfigUtility\RunManager.xls";
            IWorkbook workbook = null;
            ISheet    sheet    = null;
            int       rowCount = 0;
            string    Run_Flag;

            using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                workbook = new HSSFWorkbook(fs);
                sheet    = workbook.GetSheet("Sheet1");
            }



            rowCount = sheet.LastRowNum;
            System.Diagnostics.Debug.WriteLine(rowCount);
            for (r = 2; r <= rowCount; r++)
            {
                String action = sheet.GetRow(r).GetCell(0).StringCellValue;

                switch (action)
                {
                case "TC_001":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        ConfigFileReader obj    = new ConfigFileReader();
                        string           config = obj.ConfigFileReaderGeneric();
                        new LaunchAndCloseApp().OpenApp(obj.appName);
                        int i = new LaunchAndCloseApp().CloseApp();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 001 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_002":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        int i = new TabClicks().ClickOnTabs();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 002 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_003":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new LoadConfig().LoadConfiguration();
                        Thread.Sleep(5000);
                        int i = new LaunchAndCloseApp().CloseApp();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 003 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_004":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Event_Operations().AssessmentOption_CheckGroupEnd();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 004 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_005":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Adding_Events_To_General_Tab().Adding_Events_To_GeneralTab();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();

                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 005 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_006":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Event_Operations().Add_New_Event();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 006 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_007":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Event_Operations().Add_LabelAndBlank_Event();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 007 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_008":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Event_Operations().Delete_Event();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 008 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;

                case "TC_009":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        new Event_Operations().Edit_Event();
                        int i = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 009 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;


                case "TC_010":
                    Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString();
                    if (Run_Flag.Equals("Y"))
                    {
                        int i = new Event_Operations().Clear_All_Standard_Events();
                        Thread.Sleep(10000);
                        int j = new LaunchAndCloseApp().CloseAppWithoutSaving();
                        if (i == 1 && j == 1)
                        {
                            TotalTestCasesPassed++;
                            Report.Log(ReportLevel.Info, "TC 010 passed");
                        }
                        TotalTestCasesExecuted++;
                    }
                    break;
                }
            }

            r = r - 2;
        }
Esempio n. 4
0
//public void MailReport(string mailfrom1,string mailto1,string mailsubject1,string mailbody1)
        public void MailReport()
        {
            //ConfigFileReader obj = new ConfigFileReader();

            try
            {
                ConfigFileReader mailReader = new ConfigFileReader();
                string           c          = mailReader.ConfigFileReaderGeneric();
                MailMessage      mail       = new MailMessage();

                //mail.From = new MailAddress("*****@*****.**");
                //MailAddress address = new MailAddress("*****@*****.**");

                MailAddress address = new MailAddress(mailReader.mailFrom);
                mail.From = address;

                mail.To.Add(mailReader.mailTo);
                mail.CC.Add(mailReader.mailToCC);
                //mail.Bcc.Add(mailReader.mailToBCC);
                mail.Subject = mailReader.mailSubject;
                mail.Body    = mailReader.mailBody;

                SmtpClient SmtpServer = new SmtpClient("mail.mindteck.com");
                //SmtpClient SmtpServer = new SmtpClient();
                //SmtpServer.Host = "mail.mindteck.com";
                SmtpServer.Port = 587;
                SmtpServer.UseDefaultCredentials = false;
                SmtpServer.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "6Gby0R");
                SmtpServer.EnableSsl             = true;
                SmtpServer.Timeout = 100000;

                //String zipFilePath = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportZipFilePath;
                String FilePath = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportFileDirectory;
                System.Diagnostics.Debug.WriteLine(FilePath);
                String zipFileName = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportName;
                System.Diagnostics.Debug.WriteLine(zipFileName);

                while (!System.IO.File.Exists(zipFileName + ".rxlog"))
                {
                    Thread.Sleep(50000);
                }



                if (System.IO.File.Exists(zipFileName + ".rxlog"))
                {
                    Thread.Sleep(100000);


                    string FileToCopy     = null;
                    string NewCopy        = null;
                    string DataFileToCopy = null;
                    string NewDataFile    = null;

                    FileToCopy     = FilePath + "\\" + zipFileName + ".rxlog";
                    NewCopy        = FilePath + "\\" + zipFileName + ".html";
                    DataFileToCopy = "C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\" + zipFileName + ".rxlog.data";
                    NewDataFile    = "C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\" + zipFileName + ".html.data";
                    Thread.Sleep(5000);



                    System.IO.File.Copy(FileToCopy, NewCopy);
                    Thread.Sleep(10000);
                    System.IO.File.Copy(DataFileToCopy, NewDataFile);
                    Thread.Sleep(10000);
                    Report.Log(ReportLevel.Always, "FileCopied");
                    System.Diagnostics.Debug.WriteLine("FileCopied");
                    Thread.Sleep(5000);



                    System.Net.Mail.Attachment MyReport       = new System.Net.Mail.Attachment(FilePath + "\\" + zipFileName + ".html", "text/plain");
                    System.Net.Mail.Attachment ReportDataFile = new System.Net.Mail.Attachment("C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\" + zipFileName + ".html.data", "text/plain");
                    System.Net.Mail.Attachment ReportXLSFile  = new System.Net.Mail.Attachment("C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\RanorexReport.xsl");
                    System.Net.Mail.Attachment ReportPNGFile  = new System.Net.Mail.Attachment("C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\RanorexReport.png");
                    System.Net.Mail.Attachment ReportCSSFile  = new System.Net.Mail.Attachment("C:\\Users\\Renorex.Kolkata\\Documents\\Ranorex\\RanorexStudio Projects\\TempusProConfigUtility\\TempusProConfigUtility\\TempusProConfigUtility\\bin\\Debug\\RanorexReport.css");

                    //System.Net.Mail.Attachment MyReport = new System.Net.Mail.Attachment(zipFileName);
                    mail.Attachments.Add(MyReport);
                    mail.Attachments.Add(ReportDataFile);
                    mail.Attachments.Add(ReportXLSFile);
                    mail.Attachments.Add(ReportPNGFile);
                    mail.Attachments.Add(ReportCSSFile);
                    System.Diagnostics.Debug.WriteLine("Test");
                    SmtpServer.Send(mail);
                    Report.Info("Email sent");
                }

                //SmtpServer.Send(mail);
                //SmtpServer.SendAsync(mail, mail);                                                         .
                //SmtpServer.SendMailAsync(mail);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
                Report.Error(ex.StackTrace);
            }
        }