private void UpdateBtn_Click(object sender, RoutedEventArgs e) { if (tp.Where(t => t.ID.Equals(Idtext.Text)).Any() == true) { ///tp.Where(w => w.ID == Idtext.Text).ToList().ForEach(s => s.ID = Idtext.Text); tp.Where(w => w.ID == Idtext.Text).ToList().ForEach(s => s.Description = Descriptiontext.Text); tp.Where(w => w.ID == Idtext.Text).ToList().ForEach(s => s.Version = Versiontext.Text); tp.Where(w => w.ID == Idtext.Text).ToList().ForEach(s => s.Name = Nametext.Text); tp.Where(w => w.ID == Idtext.Text).ToList().ForEach(s => s.Logo = Logotext.Text); } Nametext.Clear(); Idtext.Clear(); Versiontext.Clear(); Descriptiontext.Clear(); Logotext.Clear(); Idtext.IsReadOnly = false; }
internal void description() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//i[@class='outline write icon'])[1]")); //Click Description Description.Click(); GlobalDefinitions.wait(40); Descriptiontext.Clear(); //Enter Description Descriptiontext.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description")); DescriptionSave.Click(); //Assert GlobalDefinitions.wait(40); //String des = Desc.Text; //Assert.IsTrue(des.Contains(GlobalDefinitions.ExcelLib.ReadData(2, "Description"))); String addMessage = GlobalDefinitions.driver.FindElement(By.XPath("//div[@class='ns-box ns-growl ns-effect-jelly ns-type-success ns-show']//div")).Text; String expectedAddMessage = "Description has been saved successfully"; Assert.AreEqual(addMessage, expectedAddMessage); }
private void SaveDetails(object sender, RoutedEventArgs e) { if (tp.Where(t => t.ID.Equals(Idtext.Text)).Any() == false) { tp.Add(new NewTestPlan { Name = Nametext.Text, ID = Idtext.Text, Version = Versiontext.Text, Description = Descriptiontext.Text, Logo = Logotext.Text }); Nametext.Clear(); Idtext.Clear(); Versiontext.Clear(); Descriptiontext.Clear(); Logotext.Clear(); } else { MessageBox.Show("With this ID already details are exist you can update only"); Idtext.IsReadOnly = true; } }