public async Task <string> CreateTestStepAsync([FromBody] TestStepViewModel request) { // HttpRequest res = null; var response = new ListModelResponse <TestStepViewModel>(); var testStepsDataModel = false; try { testStepsDataModel = await _teststepRepository.CreateTestStep(request.ToEntity()); if (testStepsDataModel) { // response.Message = String.Format("Created User Successfully"); response.Message = Messages.SuccessMsg; } else { //response.Message = String.Format("Create User failed"); response.Message = Messages.FailMsg; } } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.Message); }
public async Task <string> UpdateUserAsync([FromBody] TestStepViewModel request, int teststepId) { //HttpRequest res = null; var response = new ListModelResponse <TestStepViewModel>(); var usersDataModel = false; try { usersDataModel = await _teststepRepository.UpdateTestStep(request.ToEntity(), teststepId); if (usersDataModel) { // response.Message = String.Format("Record Updated Successfully"); response.Message = Messages.SuccessMsg; } else { // response.Message = String.Format("Record Updation failed"); response.Message = Messages.FailMsg; } } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.Message); }
private void New_Step_Button_Click(object sender, RoutedEventArgs e) { object element = this.viewModel.RoboViewModel.SelectedNode; if (element != null && element.GetType().Name.Equals("TestSequenceViewModel")) { TestSequenceViewModel elementModel = (TestSequenceViewModel)element; TestStepViewModel newStep = new TestStepViewModel(); newStep.Name = "Nth Step"; newStep.Description = "3rd Step desc"; elementModel.TestStepCollection.Add(newStep); elementModel.IsExpanded = true; newStep.IsSelected = true; newStep.IsExpanded = true; } else { MessageBox.Show("Please select the sequence under which new step to be added.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); } }
public bool Serialize(XmlTextWriter w, RoboViewModel robo) { this.writer = w; Type suitCollectionType = new ObservableCollection <TestSuitViewModel>().GetType(); Type sequenceCollectionType = new ObservableCollection <TestSequenceViewModel>().GetType(); Type stepCollectionType = new ObservableCollection <TestStepViewModel>().GetType(); Type appsCollectionType = new ObservableCollection <AppsViewModel>().GetType(); Type dataSourceCollectionType = new ObservableCollection <DataSourceViewModel>().GetType(); Type variableCollectionType = new ObservableCollection <VariableViewModel>().GetType(); Type stringType = string.Empty.GetType(); Type boolType = bool.TrueString.GetType(); Type intType = int.MinValue.GetType(); Type doubleType = double.MinValue.GetType(); Type suitType = new TestSuitViewModel().GetType(); Type seqType = new TestSequenceViewModel().GetType(); Type stepType = new TestStepViewModel().GetType(); Type appType = new AppsViewModel().GetType(); Type dsType = new DataSourceViewModel().GetType(); Type varType = new VariableViewModel().GetType(); Type[] types = { suitCollectionType, sequenceCollectionType, stepCollectionType, appsCollectionType, dataSourceCollectionType, variableCollectionType, stringType, boolType, intType, doubleType, suitType, seqType, stepType, appType, dsType, varType }; writer.WriteStartDocument(true); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartElement("Suits"); AppendNodeRobo(types, robo); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Close(); return(true); }
internal static void DealWithTestStepViewModel(TestStepViewModel TSModel, Grid grid, TreeView TestCaseTreeView) { main_grid = grid; testCaseTreeView = TestCaseTreeView; string name = TSModel.Name; string desc = TSModel.Description; Label labelName = new Label(); labelName.Content = "Name"; addToGrid(grid, labelName, 0, true); TextBox txtName = new TextBox(); txtName.Text = name; txtName.Name = "Name"; addToGrid(grid, txtName, 1, false); Label labelDesc = new Label(); labelDesc.Content = "Description"; addToGrid(grid, labelDesc, 0, true); TextBox txtDesc = new TextBox(); txtDesc.TextWrapping = TextWrapping.Wrap; txtDesc.Name = "Description"; txtDesc.VerticalScrollBarVisibility = ScrollBarVisibility.Visible; txtDesc.MinHeight = 70; txtDesc.Text = desc; addToGrid(grid, txtDesc, 1, false); grid.LostFocus += new RoutedEventHandler(TestStepDetailsEdited); }