private ObservableList <ExternalItemFieldBase> GetALMItemFields() { ObservableList <ExternalItemFieldBase> fields = new ObservableList <ExternalItemFieldBase>(); //QC ->|testSet, |testCase, |designStep, |testInstance, |designStepParams, |run //QTest->|test-suites, |test-cases, |test-steps, |test-cycles, |parameters, |test-runs string testSetfieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(ResourceType.TEST_SET); List <QTestApiModel.FieldResource> testSetfieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), testSetfieldInRestSyntax); string testCasefieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(ResourceType.TEST_CASE); List <QTestApiModel.FieldResource> testCasefieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), testCasefieldInRestSyntax); string designStepfieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(ResourceType.DESIGN_STEP); List <QTestApiModel.FieldResource> designStepfieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), designStepfieldInRestSyntax); string testInstancefieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(ResourceType.TEST_CYCLE); List <QTestApiModel.FieldResource> testInstancefieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), testInstancefieldInRestSyntax); string runfieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(ResourceType.TEST_RUN); List <QTestApiModel.FieldResource> runfieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), runfieldInRestSyntax); fields.Append(AddFieldsValues(testSetfieldsCollection, testSetfieldInRestSyntax)); fields.Append(AddFieldsValues(testCasefieldsCollection, testCasefieldInRestSyntax)); fields.Append(AddFieldsValues(designStepfieldsCollection, designStepfieldInRestSyntax)); fields.Append(AddFieldsValues(testInstancefieldsCollection, testInstancefieldInRestSyntax)); fields.Append(AddFieldsValues(runfieldsCollection, runfieldInRestSyntax)); return(fields); }
public ObservableList <BusinessFlowExecutionSummary> GetAllBusinessFlowsExecutionSummary(bool GetSummaryOnlyForExecutedFlow = false) { ObservableList <BusinessFlowExecutionSummary> BFESs = new ObservableList <BusinessFlowExecutionSummary>(); foreach (GingerRunner ARC in Runners) { BFESs.Append(ARC.GetAllBusinessFlowsExecutionSummary(GetSummaryOnlyForExecutedFlow, ARC.Name)); } return(BFESs); }
public void RefreshALMItemFields(ObservableList <ExternalItemFieldBase> exitingFields, bool online, BackgroundWorker bw = null) { ObservableList <ExternalItemFieldBase> mergedFields = new ObservableList <ExternalItemFieldBase>(); if (ALMIntegration.Instance.AutoALMProjectConnect()) { //Get latestALMFields from ALMCore with Online flag ObservableList <ExternalItemFieldBase> latestALMFields = AlmCore.GetALMItemFields(bw, online); foreach (ExternalItemFieldBase latestField in latestALMFields) { ExternalItemFieldBase currentField = exitingFields.Where(x => x.ID == latestField.ID && x.ItemType == latestField.ItemType).FirstOrDefault(); if (currentField != null) { currentField.Name = latestField.Name; currentField.ItemType = latestField.ItemType; currentField.Mandatory = latestField.Mandatory; currentField.ExternalID = latestField.ExternalID; currentField.PossibleValues = latestField.PossibleValues; currentField.ToUpdate = false; if (string.IsNullOrEmpty(currentField.SelectedValue) == false) { if ((latestField.PossibleValues.Count == 0 && currentField.SelectedValue != latestField.SelectedValue) || (latestField.PossibleValues.Count > 0 && latestField.PossibleValues.Contains(currentField.SelectedValue) && currentField.SelectedValue != latestField.PossibleValues[0])) { currentField.ToUpdate = true; } else { currentField.SelectedValue = latestField.SelectedValue; currentField.ToUpdate = false; } } else { currentField.SelectedValue = latestField.SelectedValue; currentField.ToUpdate = false; } mergedFields.Add(currentField); } else { mergedFields.Add(latestField); } } exitingFields.ClearAll(); exitingFields.Append(mergedFields); } }
public ObservableList <ExternalItemFieldBase> RefreshALMItemFields(ObservableList <ExternalItemFieldBase> exitingFields, ObservableList <ExternalItemFieldBase> latestALMFields) { ObservableList <ExternalItemFieldBase> mergedFields = new ObservableList <ExternalItemFieldBase>(); foreach (ExternalItemFieldBase latestField in latestALMFields) { ExternalItemFieldBase currentField = exitingFields.Where(x => x.ID == latestField.ID && x.ItemType == latestField.ItemType).FirstOrDefault(); if (currentField != null) { currentField.Name = latestField.Name; currentField.ItemType = latestField.ItemType; currentField.Mandatory = latestField.Mandatory; currentField.ExternalID = latestField.ExternalID; currentField.PossibleValues = latestField.PossibleValues; currentField.ToUpdate = false; if (string.IsNullOrEmpty(currentField.SelectedValue) == false) { if ((latestField.PossibleValues.Count == 0 && currentField.SelectedValue != latestField.SelectedValue) || (latestField.PossibleValues.Count > 0 && latestField.PossibleValues.Contains(currentField.SelectedValue) && currentField.SelectedValue != latestField.PossibleValues[0])) { currentField.ToUpdate = true; } else { currentField.SelectedValue = latestField.SelectedValue; currentField.ToUpdate = false; } } else { currentField.SelectedValue = latestField.SelectedValue; currentField.ToUpdate = false; } mergedFields.Add(currentField); } else { mergedFields.Add(latestField); } } exitingFields.ClearAll(); exitingFields.Append(mergedFields); return(mergedFields); }
public override ObservableList <ExternalItemFieldBase> GetALMItemFields(BackgroundWorker bw, bool online, ALM_Common.DataContracts.ResourceType resourceType) { ConnectALMServer(); fieldApi = new QTestApi.FieldApi(connObj.Configuration); ObservableList <ExternalItemFieldBase> fields = new ObservableList <ExternalItemFieldBase>(); if (resourceType == ALM_Common.DataContracts.ResourceType.ALL) { fields = GetALMItemFields(); } else { string fieldInRestSyntax = QtestConnect.Instance.ConvertResourceType(resourceType); List <QTestApiModel.FieldResource> fieldsCollection = fieldApi.GetFields((long)Convert.ToInt32(ALMCore.DefaultAlmConfig.ALMProjectKey), fieldInRestSyntax); fields.Append(AddFieldsValues(fieldsCollection, resourceType.ToString())); } return(UpdatedAlmFields(fields)); }