Exemple #1
0
        private static void fillDescription(IActivity activity)
        {
            foreach (object item in activity.Children)
            {
                Report.Log(ReportLevel.Info, item.GetType() + " ; " + activity.Children.Count);
                if (item.GetType().Name.Equals("TestModuleActivity"))
                {
                    fillDescription(item as IActivity);
                }
                else if (item.GetType().Name.Equals("ReportItem"))
                {
                    IList <JiraDescriptionItem> list = JiraConfiguration.Instance.JiraDescription;
                    JiraDescriptionItem         newItem;

                    string fileName = (item as ReportItem).ScreenshotFileName;
                    if (fileName != null && !fileName.Equals(""))
                    {
                        newItem = new JiraDescriptionItem((item as ReportItem).Message, fileName);
                    }
                    else
                    {
                        newItem = new JiraDescriptionItem((item as ReportItem).Message, null);
                    }

                    extractFilePathforInlineImage(newItem);

                    JiraConfiguration.Instance.JiraDescription.Add(newItem);
                }
            }
        }
Exemple #2
0
 private static void extractFilePathforInlineImage(JiraDescriptionItem item)
 {
     if (item.text.Contains("href=\""))
     {
         int startIndex = item.text.LastIndexOf("href=");
         item.filePath = (item.text.Substring(startIndex)).Split('\"')[1];
         item.text     = "";
     }
 }