Esempio n. 1
0
        public void GetPlanDetails_Click(object sender, RoutedEventArgs e)
        {
            try {
                if (int.TryParse(TxtPlanId.Text, out _planId))
                {
                    TvMtm.Items.Clear();
                    MtmInteraction.Getwpfsuitetree(_planId, TvMtm, true);
                    var tester = MtmInteraction.GetTester();
                    tester.Sort();
                    TesterName.ItemsSource = tester;
                }

                else
                {
                    MessageBox.Show("Invalid PlanId");
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(
                    "It seems something has gone wrong. Please send us the below information so that we can resolve the issue." +
                    Environment.NewLine + exp.Message, "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
                DataGetter.Diagnostic.AppendLine("Error while exporting to Excel: " + exp.Message);
            }
        }
Esempio n. 2
0
 private void btnGenerateTree_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var planId = int.Parse(TxtPlanId.Text);
         PlanName.Text = MtmInteraction.GetPlanName(planId);
         if (PlanName.Text == null)
         {
             MessageBox.Show("Invalid planId. Retry!");
         }
         if (int.TryParse(TxtPlanId.Text, out planId))
         {
             TvMtm.Items.Clear();
             MtmInteraction.Getwpfsuitetree(planId, TvMtm, true);
         }
         else
         {
             MessageBox.Show("Invalid planid.You can get the planid from MTM in the Select Test Plan Window.",
                             "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
     catch (Exception exp)
     {
         MessageBox.Show(
             "It seems something has gone wrong. Please send us the below information so that we can resolve the issue." +
             Environment.NewLine + exp.Message, "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Esempio n. 3
0
        public static List <ResultSummary> GetResultSummaryList(int suiteId, string suiteName)
        {
            var resDetail = new ConcurrentBag <ResultSummary>();

            Stp.Restart();
            MtmInteraction.ClearPerformanceCounters();
            MtmInteraction.GetResultDetails(suiteId, resDetail, suiteName);
            Stp.Stop();
            Diagnostic.AppendLine("Fetch Suite data for " + suiteName + "-" + suiteId + ":    " +
                                  Stp.Elapsed.TotalSeconds);
            Diagnostic.AppendLine("Outcometime:   " + MtmInteraction.OutcomeTime);
            Diagnostic.AppendLine("Priority Time:   " + MtmInteraction.PriorityTime);
            Diagnostic.AppendLine("Tester Time:   " + MtmInteraction.TesterTime);
            Diagnostic.AppendLine("Title Time:   " + MtmInteraction.TitleTime);
            Diagnostic.AppendLine("Initialize Time:   " + MtmInteraction.Initialize);
            Diagnostic.AppendLine("Test Case Id Time:   " + MtmInteraction.TcidTime);
            Diagnostic.AppendLine("Automation Status Time:   " + MtmInteraction.AutomationTime);
            Diagnostic.AppendLine("Plan:   " + MtmInteraction.SelectedPlanName);
            Diagnostic.AppendLine("Total count:  " + resDetail.Count() + "    Blocked Count:   " +
                                  resDetail.Count(l => l.Outcome.Equals("Blocked", StringComparison.OrdinalIgnoreCase)));

            Diagnostic.AppendLine("---------------------------------------------------");

            return(resDetail.ToList());
        }
Esempio n. 4
0
        public Home()
        {
            InitializeComponent();



            try
            {
                if (string.IsNullOrEmpty(MtmInteraction.SelectedPlanName))
                {
                    MtmInteraction.InitializeVstfConnection(new Uri(ConfigurationManager.AppSettings["TFSUrl"]),
                                                            ConfigurationManager.AppSettings["TeamProject"],
                                                            int.Parse(ConfigurationManager.AppSettings["TestPlanID"]));
                    DataGetter.Diagnostic.AppendLine("TFS URL: " + ConfigurationManager.AppSettings["TFSUrl"]);
                    DataGetter.Diagnostic.AppendLine("Team Project: " + ConfigurationManager.AppSettings["TeamProject"]);
                    DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
                }
                MtmInteraction.Getwpfsuitetree(int.Parse(ConfigurationManager.AppSettings["TestPlanID"]), TvMtm, true);
            }
            catch (Exception exp)
            {
                MessageBox.Show(
                    "It seems something has gone wrong. Please send us the below information so that we can resolve the issue." +
                    Environment.NewLine + exp.Message, "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            TxtPlanId.Text = ConfigurationManager.AppSettings["TestPlanID"];
            List <string> reports = new List <string>
            {
                "Summary",

                "Module",
                "Tester",


                "Automation",
                "TestList"
            };

            CmbReportSelection.ItemsSource   = reports;
            CmbReportSelection.SelectedIndex = 0;
            List <string> automationStatus = new List <string> {
                "Both", "Automated", "Manual"
            };

            CmbAutomationStaus.ItemsSource = automationStatus;
            int planid = 0;

            if (int.TryParse(ConfigurationManager.AppSettings["TestPlanID"], out planid))
            {
                if (planid != 0)
                {
                    PlanName.Text = MtmInteraction.GetPlanName(planid);
                }
            }
        }
Esempio n. 5
0
        private void Create_Playlist()
        {
            try
            {
                //string name = testerName.SelectedItem.ToString();
                var selectedId = (from i in _queryResult where i.Selected && i.AutomationStatus select i.TcId).ToList();

                if (selectedId.Count == 0)
                {
                    MessageBox.Show("Hey! It seems there are no automated cases here to generate the playlist");
                    return;
                }

                var dlg = new SaveFileDialog
                {
                    FileName   = "Playlist1",
                    DefaultExt = ".playlist",
                    Filter     = "Playlist (.playlist)|*.playlist"
                };


                var result = dlg.ShowDialog();

                if (result == true)
                {
                    var fileLocation = dlg.FileName;
                    FilePath.Text        = fileLocation;
                    Mouse.OverrideCursor = Cursors.Wait;
                    MtmInteraction.CreatePlaylist(selectedId, fileLocation);

                    DataGetter.Diagnostic.AppendLine("Total time taken for playlist generation: " +
                                                     (MtmInteraction.AutomationPlaylistAddition +
                                                      MtmInteraction.AutomationMethodTime));
                    DataGetter.Diagnostic.AppendLine("Time taken for playlist data fetch " +
                                                     MtmInteraction.AutomationMethodTime);
                    DataGetter.Diagnostic.AppendLine("Time taken for playlist file generation: " +
                                                     MtmInteraction.AutomationPlaylistAddition);
                    DataGetter.Diagnostic.AppendLine("---------------------------------------------------");

                    MessageBox.Show("Playlist generated!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry! Something went wrong. Please send the diagnostic log to us.");
                DataGetter.Diagnostic.AppendLine("Error occured in generating playlist.");
                DataGetter.Diagnostic.AppendLine(ex.Message);
                DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
            }
            finally
            {
                Mouse.OverrideCursor = null;
            }
        }
Esempio n. 6
0
        public QueryFilter()
        {
            DataContext = this;

            InitializeComponent();

            try
            {
                var actions = new List <string> {
                    "Assign Tester", "Playlist", "Result Update"
                };

                TesterAction.ItemsSource = actions;


                TesterAction.SelectedIndex = 0;
                var automationStatus = new List <string> {
                    "Both", "Automated", "Manual"
                };
                CmbAutomationStaus.ItemsSource = automationStatus;
                var priorities = new List <string> {
                    "All", "1", "2", "3", "4"
                };
                CmbPriority.ItemsSource = priorities;
                var outcomes = new List <string> {
                    "All", "Active", "Blocked", "Failed", "Passed", "In progress"
                };
                CmbOutcome.ItemsSource = outcomes;

                //Valid Outcomes are used for result update.
                var validOutcomes = outcomes;

                validOutcomes.Remove("All");
                Resultoptions.ItemsSource = validOutcomes;



                MtmInteraction.Getwpfsuitetree(int.Parse(ConfigurationManager.AppSettings["TestPlanID"]), TvMtm, true);
                var tester = MtmInteraction.GetTester();

                tester.Sort();
                TesterName.ItemsSource = tester;
            }
            catch (Exception exp)
            {
                MessageBox.Show(
                    "It seems something has gone wrong. Please send us the below information so that we can resolve the issue." +
                    Environment.NewLine + exp.Message, "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            TxtPlanId.Text = ConfigurationManager.AppSettings["TestPlanID"];
        }
Esempio n. 7
0
        public MainWindow()
        {
            InitializeComponent();
            DataGetter.FirstRun = bool.Parse(ConfigurationManager.AppSettings["FirstRun"]);

            var concol = new Color
            {
                R = byte.Parse(ConfigurationManager.AppSettings["R"]),
                A = byte.Parse(ConfigurationManager.AppSettings["A"]),
                G = byte.Parse(ConfigurationManager.AppSettings["G"]),
                B = byte.Parse(ConfigurationManager.AppSettings["B"])
            };

            AppearanceManager.Current.AccentColor = concol;
            var fontsize = ConfigurationManager.AppSettings["FontSize"];

            AppearanceManager.Current.FontSize = fontsize.Equals("large", StringComparison.OrdinalIgnoreCase) ? FirstFloor.ModernUI.Presentation.FontSize.Large : FirstFloor.ModernUI.Presentation.FontSize.Small;
            var theme = ConfigurationManager.AppSettings["Theme"];

            AppearanceManager.Current.ThemeSource = theme.Equals("dark", StringComparison.OrdinalIgnoreCase) ? AppearanceManager.DarkThemeSource : AppearanceManager.LightThemeSource;
            DataContext = new SettingsAppearanceViewModel();
            if (!DataGetter.FirstRun)

            {
                try
                {
                    MtmInteraction.InitializeVstfConnection(new Uri(ConfigurationManager.AppSettings["TFSUrl"]),
                                                            ConfigurationManager.AppSettings["TeamProject"],
                                                            int.Parse(ConfigurationManager.AppSettings["TestPlanID"]));
                    DataGetter.Diagnostic.AppendLine("TFS URL: " + ConfigurationManager.AppSettings["TFSUrl"]);
                    DataGetter.Diagnostic.AppendLine("Team Project: " + ConfigurationManager.AppSettings["TeamProject"]);
                    DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
                }
                catch (Exception exp)
                {
                    MessageBox.Show(
                        "Unable to connect to VSTF.Please check your connectivity and configuration." +
                        Environment.NewLine + "Exception Details: " + exp.Message, "OOPS!");
                }
            }
        }
Esempio n. 8
0
        private void Updateresults()
        {
            try
            {
                //string name = testerName.SelectedItem.ToString();
                Mouse.OverrideCursor = Cursors.Wait;
                var errflag = false;
                foreach (var i in _queryResult.Where(i => i.Selected))
                {
                    try
                    {
                        MtmInteraction.UpdateResult(i.TcId.ToString(), "Updated from MTM Buddy",
                                                    i.SuiteName.Substring(i.SuiteName.LastIndexOf("\\", StringComparison.OrdinalIgnoreCase) + 1), false,
                                                    Resultoptions.SelectedValue.ToString());
                    }
                    catch (Exception ex)
                    {
                        DataGetter.Diagnostic.AppendLine("Error occured in updating results " + i.TcId);
                        DataGetter.Diagnostic.AppendLine(ex.Message);
                        DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
                        errflag = true;
                    }
                }
                MessageBox.Show(errflag
                    ? "Sorry! Something went wrong. Please check the diagnostic log for details."
                    : "All done");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry! Something went wrong. Please send the diagnostic log to us.");

                DataGetter.Diagnostic.AppendLine("Error occured in updating results.");
                DataGetter.Diagnostic.AppendLine(ex.Message);
                DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
            }
            finally
            {
                Mouse.OverrideCursor = null;
            }
        }
Esempio n. 9
0
        private void Assign_Tester()
        {
            try {
                var name       = TesterName.Text;
                var selectedId = (from i in _queryResult where i.Selected select i.TcId).ToList();
                if (selectedId.Count == 0)
                {
                    MessageBox.Show("Hey! It seems you forgot to select cases");
                    return;
                }
                MtmInteraction.AssignTester(_suiteid, selectedId, name);

                MessageBox.Show("All changes done!");
            }
            catch (Exception exp)
            {
                MessageBox.Show(
                    "It seems something has gone wrong. Please send us the below information so that we can resolve the issue." +
                    Environment.NewLine + exp.Message, "OOPS!", MessageBoxButton.OK, MessageBoxImage.Warning);
                DataGetter.Diagnostic.AppendLine("Error while Assigning Testers: " + exp.Message);
            }
        }
Esempio n. 10
0
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            ConfigurationManager.AppSettings["TFSUrl"]      = TxtTfsUrl.Text;
            ConfigurationManager.AppSettings["TeamProject"] = TxtTeamProject.Text;

            ConfigurationManager.AppSettings["TestPlanId"] = TxtTestPlanId.Text;

            try
            {
                MtmInteraction.InitializeVstfConnection(new Uri(ConfigurationManager.AppSettings["TFSUrl"]),
                                                        ConfigurationManager.AppSettings["TeamProject"],
                                                        int.Parse(ConfigurationManager.AppSettings["TestPlanID"]));
                DataGetter.SaveConfig("TFSUrl", TxtTfsUrl.Text);
                DataGetter.SaveConfig("TeamProject", TxtTeamProject.Text);
                DataGetter.SaveConfig("TestPlanID", TxtTestPlanId.Text);

                ConfigurationManager.AppSettings["FirstRun"] = false.ToString();
                DataGetter.SaveConfig("FirstRun", false.ToString());



                DataGetter.Diagnostic.AppendLine("Config changed:");
                DataGetter.Diagnostic.AppendLine("TFS URL: " + TxtTfsUrl.Text);
                DataGetter.Diagnostic.AppendLine("Team Project: " + TxtTeamProject.Text);


                DataGetter.Diagnostic.AppendLine("---------------------------------------------------");
                MessageBox.Show("Voila! All changes have been saved.");
            }


            catch (Exception exp)
            {
                MessageBox.Show(
                    "Unable to connect to VSTF.Please check your connectivity and configuration" + Environment.NewLine +
                    "Exception Details: " + exp.Message, "OOPS!");
            }
        }