Example #1
0
        private static string GetReportCss()
        {
            StringBuilder css = new StringBuilder();

            css.Append("<style>");

            //Temporararily removing the usage of inline png's.

            /*for(int f = 0; f < AutomationMaster.TestRunContext.Failed.tests.Count; f++) {
             * string testName = AutomationMaster.TestRunContext.Failed.tests[f].Key;
             * bool saveInline = !AutomationMaster.ConfigReader.GetBool("EDITOR_IS_DOT_NET_SUBSET");
             * string inlinePngString = saveInline ? GetScreenShotAsInlinePng(testName) : string.Empty;
             * if(!string.IsNullOrEmpty(inlinePngString)) {
             * css.AppendLine(string.Format(".fail_test_image_{0} {{ background-repeat: no-repeat; width: 1240px; height: 600px; background-image:url('data:image/png;base64,{1}'); }}", testName, inlinePngString));
             * } else {
             * if(saveInline) {
             * imageCaptureFailures.Append(string.Format("<div id='fail_test_no_image_{0}' style='display: none;'></div>", testName));
             * }
             * }
             * }*/

            css.Append(FileBroker.GetTextResource(FileResource.ReportCss));
            css.Append("</style>");

            return(css.ToString());
        }
Example #2
0
        private static void Set()
        {
            _config = FileBroker.GetTextResource(FileResource.TrilleonConfig);
            string[] rawKeys = _config.Split(new string[] { "\n", "\r" }, System.StringSplitOptions.RemoveEmptyEntries);
            _requiredConfigs  = new List <KeyValuePair <string, string> >();
            _customConfigs    = new List <KeyValuePair <string, string> >();
            isRequiredSection = true;

            for (int i = 0; i < rawKeys.Length; i++)
            {
                if (i != 0)
                {
                    if (rawKeys[i].StartsWith("**"))
                    {
                        isRequiredSection = false;
                        continue;
                    }

                    string[] thisKey = rawKeys[i].Split('=');

                    if (isRequiredSection)
                    {
                        _requiredConfigs.Add(new KeyValuePair <string, string>(thisKey[0], thisKey[1]));
                    }
                    else
                    {
                        _customConfigs.Add(new KeyValuePair <string, string>(thisKey[0], thisKey[1]));
                    }
                }
            }
        }
Example #3
0
        private static string GetReportScripts()
        {
            StringBuilder scripts = new StringBuilder();

            scripts.Append("<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>");
            scripts.Append("<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'></script>");
            scripts.Append("<script type='text/javascript' src='https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js'></script>");
            scripts.Append("<script type='text/javascript' src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script>");
            scripts.Append("<script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>");
            scripts.Append(string.Format("<script>{0}</script>", FileBroker.GetTextResource(FileResource.ReportJavascript)));

            return(scripts.ToString());
        }
Example #4
0
        void GetConfig()
        {
            settings      = new List <KeyValuePair <string, string> >();
            settingsSaved = new List <KeyValuePair <string, string> >();
            string[] instructions = FileBroker.GetTextResource(FileResource.TrilleonConfig).Split('\n');
            bool     customKey    = false;

            for (int i = 0; i < instructions.Length; i++)
            {
                if (string.IsNullOrEmpty(instructions[i]))
                {
                    continue;
                }

                if (!instructions[i].StartsWith("**"))
                {
                    string[] keyValPair = instructions[i].Split('=');
                    if (keyValPair[0].StartsWith("!"))
                    {
                        criticalFields.Add(true);
                        keyValPair[0] = keyValPair[0].Substring(1, keyValPair[0].Length - 1);
                    }
                    else
                    {
                        criticalFields.Add(false);
                    }
                    KeyValuePair <string, string> pair = new KeyValuePair <string, string>(keyValPair[0], keyValPair[1]);
                    settings.Add(pair);
                    settingsSaved.Add(pair);
                }
                else
                {
                    KeyValuePair <string, string> pair = new KeyValuePair <string, string>(string.Empty, !customKey ? "**** TRILLEON CONFIGS REQUIRED ****" : "**** CUSTOM CONFIGS ****");
                    settings.Add(pair);
                    settingsSaved.Add(pair);
                    criticalFields.Add(false);
                    customKey = !customKey;
                }
            }
        }