예제 #1
0
파일: Test_TBot.cs 프로젝트: sarvaje/Master
        public void Script_Run_AllScripts()
        {
            SetUpNGit();
            var tbotBrain = new TBot_Brain(TmRest);

            foreach (var scriptName in tbotBrain.scriptsNames())
            {
                "================= Executing TBot script: {0}".info(scriptName);
                var html = tbotBrain.ExecuteRazorPage(scriptName); //"View_Emails_Sent");
                Assert.IsNotNull(html, "for :{0}".format(scriptName));
                var compileError = html.contains("Unable to compile template");
                if (compileError)
                {
                    html.info();
                    Assert.Fail("Failed to compile: {0}".format(scriptName));
                }
                var executionError = html.contains("Opps: Something went wrong:");
                if (executionError)
                {
                    html.info();
                    Assert.Fail("Execution error: on  {0}".format(scriptName));
                }
            }

            //"test webBrowser".popupWindow().add_WebBrowser().set_Html(html).waitForClose();
        }
예제 #2
0
파일: Test_TBot.cs 프로젝트: sarvaje/Master
        public void Script_ViewEmailsSent()
        {
            //tests one script to make sure core engine is working
            // (run CheckThatAllTBotPagesLoad to test all scripts)
            var tbotBrain = new TBot_Brain(TmRest);
            var html      = tbotBrain.ExecuteRazorPage("View_Emails_Sent");

            Assert.IsNotNull(html, "html was null");
        }
예제 #3
0
파일: Test_TBot.cs 프로젝트: rbg13/Master
        [Test] public void Script_ViewEmailsSent()
        {
            TBot_Brain.AvailableScripts = TBot_Brain.SetAvailableScripts();
            //tests one script to make sure core engine is working
            // (run CheckThatAllTBotPagesLoad to test all scripts)
            var tbotBrain = new TBot_Brain(TmRest);
            var html      = tbotBrain.ExecuteRazorPage("Current_Users");

            Assert.IsNotNull(html, "html was null");
        }
예제 #4
0
        //[Ignore("trigger manually since it takes a while to compile all Tbot scripts")]
        public void Script_Run_AllScripts()
        {
            UserGroup.Admin.assert();

            TmRest.TBot_Run("Git");                 // trigger unpack of NGit and Sharpen dlls
            var fluentSharpGit = new API_NGit();

            Assert.NotNull(fluentSharpGit, "fluentSharpGit was null");


            // Load dlls as required by some TBot pages:
            "System.Xml.Linq".assembly().assert_Not_Null();   // Import Legacy Users
            "FluentSharp.Xml".assembly().assert_Not_Null();   // Import Legacy Users
            "TeamMentor.AspNet".assembly().assert_Not_Null(); // DebugInfo
            //"System.Web"     .assembly().assert_Not_Null(); // IIS Sessions

            var tbotBrain = new TBot_Brain(TmRest);

            foreach (var scriptName in tbotBrain.scriptsNames())
            {
                if (scriptName.equals("GitDiff_UserData_Commit", "GitDiff_UserData_File"))        // there is a prob is this Tbot page (currently not exposed to users)
                {
                    continue;
                }
                //if (scriptName != "Json_UserTags") continue;
                "================= Executing TBot script: {0}".info(scriptName);
                var html = tbotBrain.ExecuteRazorPage(scriptName); //"View_Emails_Sent");
                Assert.IsNotNull(html, "for :{0}".format(scriptName));
                var compileError = html.contains("Unable to compile template");
                if (compileError)
                {
                    html.info();
                    Assert.Fail("Failed to compile: {0}".format(scriptName));
                }
                var executionError = html.contains("Opps: Something went wrong:");
                if (executionError)
                {
                    html.info();
                    Assert.Fail("Execution error: on  {0}".format(scriptName));
                }
            }

            //"test webBrowser".popupWindow().add_WebBrowser().set_Html(html).waitForClose();
        }