private async void Refresh(object sender, RoutedEventArgs e)
        {
            _iterations = await Logic.GetTeamIterations(GlobalSettings.Instance.Team?.TeamId);

            Iterations.Clear();
            foreach (var iteration in _iterations)
            {
                if (iteration.Value.TimeFrame != "past")
                {
                    Iterations.Add(iteration.Value.Name);
                }
                if (iteration.Value.Attributes.TimeFrame == "current")
                {
                    CurrentIteration = iteration.Value.Name;
                }
            }

            var result = await Logic.GetWorkItemsByQuery(false);

            if (result != null)
            {
                _workItems          = result.WorkItems;
                _completedWorkItems = result.CompletedWorkItems;
                _auditIssues        = result.AuditIssues;
                OnCurrentIterationChanged();

                foreach (var completed in _completedWorkItems.Union(_workItems))
                {
                    var notes = completed.Notes;
                }
            }
        }
        public override bool TryParse()
        {
            if (!base.TryParse())
            {
                return(false);
            }

            // try to parse the second level report nodes, the type shall be 'iteration' for GUI test
            Iterations.Clear();
            ReportNodeType[] childNodes = Node.ReportNode;
            if (childNodes != null)
            {
                foreach (ReportNodeType node in childNodes)
                {
                    IterationReport iteration = Iterations.TryParseAndAdd(node, this.Node);
                    if (iteration != null)
                    {
                        AllStepsEnumerator.Merge(iteration.AllStepsEnumerator);
                        continue;
                    }
                }
            }
            if (Iterations.Length == 0)
            {
                // no iteration node is parsed successfully under testrun node,
                // it might because the GUI test is run with one iteration only
                // which omits the iteration node in the report Xml
                // here create a temporary iteration node so that the nodes read from the Xml
                // can be processed properly
                ReportNodeType iterationNode = new ReportNodeType
                {
                    type = "Iteration",
                    Data = new DataType
                    {
                        Name              = "Action0",
                        IndexSpecified    = true,
                        Index             = 1,
                        Result            = "Done",
                        StartTime         = Node.Data.StartTime,
                        DurationSpecified = Node.Data.DurationSpecified,
                        Duration          = Node.Data.Duration
                    },
                    ReportNode = Node.ReportNode
                };
                IterationReport iteration = Iterations.TryParseAndAdd(iterationNode, this.Node);
                if (iteration != null)
                {
                    AllStepsEnumerator.Merge(iteration.AllStepsEnumerator);
                }

                if (Iterations.Length == 0)
                {
                    // failed to parse at least one iteration, not a valid GUI test
                    return(false);
                }
            }

            return(true);
        }
        private async Task GetIterationsAsync()
        {
            Iterations.Clear();
            var iterations = await _training.GetTrainedIterationsAysnc();

            foreach (var i in iterations)
            {
                Iterations.Add(i);
            }


            SelectedIteration = (Iterations.Count > 0) ? Iterations[0] : null;
            DownloadModel.RaiseCanExecuteChanged();
        }
        public void GetIterationsMethod()
        {
            Iterations.Clear();
            if (SelectedTeamProject == null)
            {
                return;
            }

            Status = "Getting iterations for team project " + SelectedTeamProject.Name;

            var itManager = new IterationManager(ConnectionManager.Instance);

            foreach (var iteration in itManager.GetAllIterationsForTeamProject(SelectedTeamProject.Name))
            {
                Iterations.Add(new IterationsViewModel(iteration));
            }
            Status = "All iteration loaded";
        }
        public async void GetIterationsMethod()
        {
            Iterations.Clear();
            if (SelectedTeamProject == null)
            {
                return;
            }

            Status = "Getting iterations for team project " + SelectedTeamProject.Name;

            WorkHttpClient workClient    = ConnectionManager.Instance.GetClient <WorkHttpClient>();
            var            allIterations = await workClient.GetTeamIterationsAsync(new TeamContext(SelectedTeamProject.Id));

            foreach (var iteration in allIterations)
            {
                Iterations.Add(new IterationsViewModel(iteration));
            }
            Status = "All iteration loaded";
        }
Beispiel #6
0
        public override bool TryParse()
        {
            if (!base.TryParse())
            {
                return(false);
            }

            // try to parse the second level report nodes
            Iterations.Clear();
            Groups.Clear();
            Flows.Clear();
            Branches.Clear();
            BusinessComponents.Clear();
            RecoverySteps.Clear();
            GeneralSteps.Clear();

            ReportNodeType[] childNodes = Node.ReportNode;
            if (childNodes != null)
            {
                foreach (ReportNodeType node in childNodes)
                {
                    // iteration
                    IterationReport iteration = Iterations.TryParseAndAdd(node, this.Node);
                    if (iteration != null)
                    {
                        AllBCsEnumerator.Merge(iteration.AllBCsEnumerator);
                        continue;
                    }

                    // group
                    GroupReport group = Groups.TryParseAndAdd(node, this.Node);
                    if (group != null)
                    {
                        AllBCsEnumerator.Merge(group.AllBCsEnumerator);
                        continue;
                    }

                    // flow
                    FlowReport flow = Flows.TryParseAndAdd(node, this.Node);
                    if (flow != null)
                    {
                        AllBCsEnumerator.Merge(flow.AllBCsEnumerator);
                        continue;
                    }

                    // branch
                    BranchReport branch = Branches.TryParseAndAdd(node, this.Node);
                    if (branch != null)
                    {
                        AllBCsEnumerator.Merge(branch.AllBCsEnumerator);
                        continue;
                    }

                    // business component
                    BusinessComponentReport bc = BusinessComponents.TryParseAndAdd(node, this.Node);
                    if (bc != null)
                    {
                        AllBCsEnumerator.Add(bc);
                        continue;
                    }

                    // recovery step
                    RecoveryStepReport recovery = RecoverySteps.TryParseAndAdd(node, this.Node);
                    if (recovery != null)
                    {
                        AllBCsEnumerator.Merge(recovery.AllBCsEnumerator);
                        continue;
                    }

                    // general step
                    GeneralStepReport generalStep = GeneralSteps.TryParseAndAdd(node, this.Node);
                    if (generalStep != null)
                    {
                        AllBCsEnumerator.Merge(generalStep.AllBCsEnumerator);
                        continue;
                    }
                }
            }

            return(true);
        }
        public override bool TryParse()
        {
            if (!base.TryParse())
            {
                return(false);
            }

            // try to parse the second level report nodes, the type shall be 'Step' for API test
            Iterations.Clear();
            ReportNodeType[] secondLevelNodes = Node.ReportNode;
            if (secondLevelNodes != null)
            {
                foreach (ReportNodeType secondLvNode in secondLevelNodes)
                {
                    // test if the second-level node is Step type
                    if (secondLvNode.type.ToLower() != NodeType_Step)
                    {
                        continue;
                    }

                    // try to parse the third-level node and test if it is 'Action' type
                    ReportNodeType[] actionNodes = secondLvNode.ReportNode;
                    if (actionNodes == null)
                    {
                        continue;
                    }
                    foreach (ReportNodeType actionNode in actionNodes)
                    {
                        // test if the third-level node is Action type
                        if (actionNode.type.ToLower() != NodeType_Action)
                        {
                            continue;
                        }

                        // try to parse the fourth-level node and test if it is 'Iteration' type
                        ReportNodeType[] iterationNodes = actionNode.ReportNode;
                        if (iterationNodes == null)
                        {
                            continue;
                        }
                        foreach (ReportNodeType iterationNode in iterationNodes)
                        {
                            // try to add as an iteration report
                            IterationReport iteration = Iterations.TryParseAndAdd(iterationNode, actionNode);
                            if (iteration != null)
                            {
                                AllActivitiesEnumerator.Merge(iteration.AllActivitiesEnumerator);
                                continue;
                            }
                        }
                    }
                }
            }
            if (Iterations.Length == 0)
            {
                // no iteration node is parsed successfully, it is not a valid API test Xml report
                return(false);
            }

            return(true);
        }