コード例 #1
0
        private void Rename_Click(object sender, RoutedEventArgs e)
        {
            string oldName = mDSTableDetails.Name;

            InputBoxWindow.OpenDialog("Rename", "Table Name:", mDSTableDetails, DataSourceBase.Fields.Name);
            mDSTableDetails.DSC.RenameTable(oldName, mDSTableDetails.Name);
        }
コード例 #2
0
        private void AddActivity()
        {
            Activity activity = new Activity();
            bool     b        = InputBoxWindow.OpenDialog("Add new Activity", "Activity Name", activity, nameof(Activity.ActivityName));

            if (b)
            {
                mBusinessFlow.Activities.Add(activity);
            }
        }
コード例 #3
0
        public static RunSetConfig CreateNewRunset(string runSetName = "", RepositoryFolder <RunSetConfig> runSetsFolder = null)
        {
            if (string.IsNullOrEmpty(runSetName))
            {
                do
                {
                    if (!string.IsNullOrEmpty(runSetName.Trim()))
                    {
                        Reporter.ToUser(eUserMsgKey.DuplicateRunsetName, runSetName);
                    }

                    bool returnWindow = InputBoxWindow.OpenDialog(string.Format("Add New {0}", GingerDicser.GetTermResValue(eTermResKey.RunSet)),
                                                                  string.Format("{0} Name:", GingerDicser.GetTermResValue(eTermResKey.RunSet)),
                                                                  ref runSetName);

                    if (returnWindow)
                    {
                        if (string.IsNullOrEmpty(runSetName.Trim()))
                        {
                            Reporter.ToUser(eUserMsgKey.ValueIssue, "Value cannot be empty");
                        }
                    }
                    else
                    {
                        return(null);
                    }
                }while (string.IsNullOrEmpty(runSetName.Trim()) || WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <RunSetConfig>().Where(r => r.ItemName.ToLower() == runSetName.ToLower()).FirstOrDefault() != null);
            }

            RunSetConfig runSetConfig = new RunSetConfig();

            runSetConfig.Name = runSetName;

            GingerRunner gingerRunner = new GingerRunner {
                Name = "Runner 1"
            };
            GingerExecutionEngine gingerExecutionEngine = new GingerExecutionEngine(gingerRunner);

            gingerRunner.Executor = gingerExecutionEngine;

            runSetConfig.GingerRunners.Add(gingerRunner);
            runSetConfig.AddCategories();

            if (runSetsFolder == null)
            {
                WorkSpace.Instance.SolutionRepository.AddRepositoryItem(runSetConfig);
            }
            else
            {
                runSetsFolder.AddRepositoryItem(runSetConfig);
            }

            return(runSetConfig);
        }
コード例 #4
0
 public bool RenameItem(string Title, Object obj, string Property)
 {
     // hard coded biz flow name... Check me
     if (InputBoxWindow.OpenDialog("Rename", Title, obj, Property))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
        private void Rename_Click(object sender, RoutedEventArgs e)
        {
            if (Reporter.ToUser(eUserMsgKey.SaveLocalChanges) == Amdocs.Ginger.Common.eUserMsgSelection.No)
            {
                return;
            }
            string oldName = mDSTableDetails.Name;

            InputBoxWindow.OpenDialog("Rename", "Table Name:", mDSTableDetails, DataSourceBase.Fields.Name);
            mDSTableDetails.DSC.RenameTable(oldName, mDSTableDetails.Name);
            RefreshGrid();
            mDSTableDetails.DirtyStatus = Amdocs.Ginger.Common.Enums.eDirtyStatus.NoChange;
        }
コード例 #6
0
        private void Rename_Click(object sender, RoutedEventArgs e)
        {
            if (Reporter.ToUser(eUserMsgKey.SaveLocalChanges) == Amdocs.Ginger.Common.eUserMsgSelection.No)
            {
                return;
            }

            string newName = mDSTableDetails.Name;

            InputBoxWindow.OpenDialog("Rename", "Table Name:", ref newName);

            ValidateAndUpdateDBTableName(newName);

            mDSTableDetails.DirtyStatus = Amdocs.Ginger.Common.Enums.eDirtyStatus.NoChange;
        }
コード例 #7
0
        private void RenameTable(object sender, RoutedEventArgs e)
        {
            if (grdTableList.Grid.SelectedItems.Count == 0)
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectItem);
                return;
            }
            List <object> SelectedItemsList = grdTableList.Grid.SelectedItems.Cast <object>().ToList();

            foreach (object o in SelectedItemsList)
            {
                if (Reporter.ToUser(eUserMsgKey.RenameRepositoryItemAreYouSure, ((DataSourceTable)o).GetNameForFileName()) == Amdocs.Ginger.Common.eUserMsgSelection.Yes)
                {
                    string oldName = ((DataSourceTable)o).Name;
                    InputBoxWindow.OpenDialog("Rename", "Table Name:", ((DataSourceTable)o), DataSourceBase.Fields.Name);
                    ((DataSourceTable)o).DSC.RenameTable(oldName, ((DataSourceTable)o).Name);
                }
            }
            SetGridData();
        }
コード例 #8
0
        public static BusinessFlow ConvertSeleniumScript(string FileName)
        {
            //TODO: move code from here to converter/import class
            var      doc    = new HtmlDocument();
            Activity result = new Activity()
            {
                Active = true
            };

            BusinessFlow  bf = new BusinessFlow("");
            ePlatformType actionsPlatform = ePlatformType.Web;

            try
            {
                //get the required platform for actions
                string selectedPlatform = "";
                if (InputBoxWindow.OpenDialog("Required Platform", "Required platform (set 'Web' or 'Mobile'):", ref selectedPlatform))
                {
                    if (selectedPlatform.Trim().ToUpper() == "MOBILE")
                    {
                        actionsPlatform = ePlatformType.Mobile;
                    }
                }

                doc.Load(FileName);

                result.ActivityName = doc.DocumentNode.Descendants("title").FirstOrDefault().InnerText;
                bf.Name             = doc.DocumentNode.Descendants("title").FirstOrDefault().InnerText;

                List <HtmlNode> rows = doc.DocumentNode.Descendants("tbody").FirstOrDefault().Descendants()
                                       .Where(o => o.Name.StartsWith("tr")).ToList();
                bf.Activities.Add(result);
                string action      = "";
                string locatevalue = "";
                string value       = "";
                // string locby = "";
                ActGenElement.eGenElementAction GenAction;
                eLocateBy locType = eLocateBy.ByXPath;

                foreach (HtmlNode row in rows)
                {
                    if (row.Descendants("title").Count() > 0)
                    {
                        if (bf != null)
                        {
                            WorkSpace.Instance.SolutionRepository.AddRepositoryItem(bf);
                        }
                        bf     = new BusinessFlow(row.Descendants("title").FirstOrDefault().InnerText);
                        result = new Activity()
                        {
                            Active = true
                        };
                        result.ActivityName = row.Descendants("title").FirstOrDefault().InnerText;
                        bf.Activities.Add(result);
                    }
                    else
                    {
                        action      = row.Descendants("td").ToList()[0].InnerText;
                        locatevalue = row.Descendants("td").ToList()[1].InnerText.Replace("&amp;", "&").Replace("&gt;", ">");
                        value       = row.Descendants("td").ToList()[2].InnerText;

                        if (locatevalue.Trim().IndexOf("id=", StringComparison.CurrentCultureIgnoreCase) == 0 ||
                            locatevalue.Trim().IndexOf("id:=", StringComparison.CurrentCultureIgnoreCase) == 0)
                        {
                            locType     = eLocateBy.ByID;
                            locatevalue = locatevalue.Replace("id=", "").Replace("id:=", "");;
                        }

                        if (locatevalue.Trim().IndexOf("link=", StringComparison.CurrentCultureIgnoreCase) == 0 ||
                            locatevalue.Trim().IndexOf("LinkText:=", StringComparison.CurrentCultureIgnoreCase) == 0)
                        {
                            locType     = eLocateBy.ByLinkText;
                            locatevalue = locatevalue.Replace("link=", "").Replace("LinkText:=", "");
                        }
                        if (locatevalue.Trim().IndexOf("css=", StringComparison.CurrentCultureIgnoreCase) == 0 ||
                            locatevalue.Trim().IndexOf("cssselector:=", StringComparison.CurrentCultureIgnoreCase) == 0)
                        {
                            locType     = eLocateBy.ByCSS;
                            locatevalue = locatevalue.Replace("css=", "").Replace("cssselector:=", "");
                        }
                        if (locatevalue.Trim().IndexOf("/") == 0 || locatevalue.Trim().IndexOf("xpath", StringComparison.CurrentCultureIgnoreCase) == 0)
                        {
                            locType     = eLocateBy.ByXPath;
                            locatevalue = locatevalue.Replace("xpath=", "").Replace("xpath:=", "").Replace("xpath:", "").Trim();
                        }

                        switch (action.ToUpper().Trim())
                        {
                        case "OPEN":
                            GenAction   = ActGenElement.eGenElementAction.GotoURL;
                            locType     = eLocateBy.NA;
                            locatevalue = "";
                            break;

                        case "FCOMMONLAUNCHENVIRONMENT":
                            GenAction   = ActGenElement.eGenElementAction.GotoURL;
                            locType     = eLocateBy.NA;
                            value       = locatevalue;
                            locatevalue = "";
                            break;

                        case "TYPE":
                        case "FCOMMONSETVALUEEDITBOX":
                            GenAction = ActGenElement.eGenElementAction.SetValue;
                            break;

                        case "SELECT":
                        case "FCOMMONSELECTIONOPTIONFROMLIST":
                            GenAction = ActGenElement.eGenElementAction.SelectFromDropDown;
                            break;

                        case "FCOMMONJAVASCRIPTCLICK":
                            GenAction = ActGenElement.eGenElementAction.Click;
                            break;

                        case "CLICKANDWAIT":
                        case "CLICK":
                        default:
                            GenAction = ActGenElement.eGenElementAction.Click;
                            break;
                        }

                        result.Acts.Add(new ActGenElement()
                        {
                            Active = true, Description = GenAction.ToString(), LocateBy = locType, LocateValue = locatevalue, GenElementAction = GenAction, Value = value, Platform = actionsPlatform
                        });
                    }
                }
                if (bf != null)
                {
                    return(bf);
                }
            }
            catch (Exception)
            {
                Reporter.ToUser(eUserMsgKey.ImportSeleniumScriptError);
            }
            return(null);
        }