Example #1
0
        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();
        }
Example #2
0
        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();
        }