Exemple #1
0
        //[Test]
        public void SmokeTest()
        {
            Reporting.ReportHeader("Engage Smoke Test");
            // Login
            Reporting.TestName("Login");
            _itcActions.ITC_Login(_startUp.driver);

            // Enrol Subject
            Reporting.TestName("Enrol");
            int subject1 = _itcActions.ITC_EnrolSubject(_startUp.driver);

            //check last event date
            Reporting.TestName("Check last event date");
            var LastEvent = DateTime.Today.AddDays(4).ToString("dd MMMM yyyy");

            _itcActions.ITC_CheckLastEventDate(subject1, LastEvent, _startUp.driver);

            // View Subject
            Reporting.TestName("View Subject");
            _itcActions.ITC_ViewSubject(subject1, _startUp.driver);

            // Check the Help Text
            //_itcActions.ITC_CheckHelpText(driver); //currently there is no help text displayed on the site so need to run test

            // Edit Subject
            Reporting.TestName("Edit Subject");
            _itcActions.ITC_EditSubject(subject1, _startUp.driver);

            //Add a test to view scheduled messages

            // Withdraw
            Reporting.TestName("Withdraw");
            _itcActions.ITC_Withdraw(subject1, _startUp.driver);

            Reporting.ReportFooter();

            //Delete all JPEGS in folder
            string      sourcePath = AppDomain.CurrentDomain.BaseDirectory.ToString();
            string      htmlLink   = "file:///" + sourcePath + _startUp.resultsFileName; //locate the file
            string      fileName   = "_TestReport" + _startUp.resultsFileName + ".pdf";
            HtmlToPdf   conver     = new HtmlToPdf();                                    //Initialisethe object
            PdfDocument doc        = conver.ConvertUrl(htmlLink);                        // convert the link, you can convert raw HTML if you wish

            doc.Save(fileName);                                                          //save the file
            doc.Close();                                                                 //close

            Dropbox.uploadFile(fileName);                                                //upolad to dropbox


            _startUp.Teardown(_startUp.driver);
        }