public void Validate_Edit_Service() { test = extent.StartTest("Starting edit Service test"); ListingManagement service = new ListingManagement(); service.EditServiceDetails(); Global.GlobalDefinitions.wait(2000); try { string Expected = "ListingManagement"; Assert.AreEqual(Expected, Global.GlobalDefinitions.driver.Title); Global.Base.test.Log(LogStatus.Pass, "Service is edited successfully"); } catch (Exception e) { IWebElement NoListings = Global.GlobalDefinitions.driver.FindElement(By.XPath("//h3[contains(text(),'You do not have any service listings!')]")); if (NoListings.Displayed) { Assert.AreEqual(NoListings.Text, "You do not have any service listings!"); Global.Base.test.Log(LogStatus.Pass, "You do not have any service listings to Edit"); } else { Global.Base.test.Log(LogStatus.Fail, "Service is not Edited" + e); } } }
public void EditSkill(string TitleForServcToBeEdited, int rownumber) { bool editMatchFound = false; TestCase_Name = $"Editing existing services for title {TitleForServcToBeEdited}"; test = extent.CreateTest(TestCase_Name); //Create an instance for the SignIn page SignIn JoinObj = new SignIn(driver); //Invoke the LoginSteps to verify if the user can log in with valid credentials JoinObj.LoginSteps(); //Invoke the function to validate if the user has logged in successfully and the home page is displayed JoinObj.ValidateHomePage(); //Create an instance for the HomePage HomePage listObj = new HomePage(driver); //Invoke the funtion to navigate to Manage Listings listObj.navigateToManageListings(); //Create an instance for the Listing Management page ListingManagement obj = new ListingManagement(driver, TitleForServcToBeEdited, rownumber); //Invoke the function to check if the service to be edited is available in the Manage Listings editMatchFound = obj.NavigateToEditDetails(); //Create instances for ServiceListing Page and SearchSkill Page ServiceListing editObj = new ServiceListing(driver, rownumber); SearchSkill SrchObj = new SearchSkill(driver, rownumber); //Proceed to Edit service only if the service to be edited is found if (editMatchFound) { //Invoke the function to Edit services editObj.EditServices(); //Implicit wait Wait.wait(2, driver); //Invoke the function to search for service after edit obj.SearchSkillsAfterEdit(); //Invoke the function to validate the search result SrchObj.SkillSrchResult(); //Implicit wait Wait.wait(2, driver); //Create an instance for ServiceDetail Page ServiceDetail ViewEditdDetailObj = new ServiceDetail(driver, rownumber); //Invoke the function to validate the edited details ViewEditdDetailObj.ValidateServiceDetail(); } }
//Function to add services using Share Skill feature to render services to others public void ShareSkill(int rownumber) { String Title = ServiceData.TitleData(rownumber); TestCase_Name = $"Adding services with title {Title}"; test = extent.CreateTest(TestCase_Name); //Create an instance for the SignIn page SignIn JoinObj = new SignIn(driver); //Invoke the LoginSteps to verify if the user can log in with valid credentials JoinObj.LoginSteps(); //Invoke the function to validate if the user has logged in successfully and the home page is displayed JoinObj.ValidateHomePage(); //Create an instance for the HomePage HomePage SkillObj = new HomePage(driver); //Invoke the function to navigate to Share Skill Page SkillObj.navigateToShareSkill(); //Create an instance for the ShareSkillPage ShareSkillPage Obj = new ShareSkillPage(driver, rownumber); //Invoke the function to fill the details of services rendered Obj.FillDetailsOfServiceProvided(); //Create an instance for the Listing Management page ListingManagement listObj = new ListingManagement(driver, rownumber); //Invoke the funtion to navigate to Manage Listings listObj.ManageListing(); //Invoke the funtion to view the listings listObj.ViewListings(); //Invoke the funtion to view the details of the listings listObj.NavigateToViewAddedDetails(); //Create an instance for the Service Detail page ServiceDetail ViewDetailObj = new ServiceDetail(driver, rownumber); //Invoke the funtion to validate the details of services ViewDetailObj.ValidateServiceDetail(); }
public void Validate_Remove_Service() { test = extent.StartTest("Starting Remove Service test"); ListingManagement service = new ListingManagement(); service.RemoveServiceDetails(); Global.GlobalDefinitions.wait(2000); try { IList <IWebElement> Title = Global.GlobalDefinitions.driver.FindElements(By.XPath("//table//tbody//tr//td[3]")); IList <IWebElement> Category = Global.GlobalDefinitions.driver.FindElements(By.XPath("//table//tbody//tr//td[2]")); bool recordFound = true; for (int i = 0; i < Title.Count; i++) { if ((Global.GlobalDefinitions.ExcelLib.ReadData(2, "Title") == Title[i].Text) && (Global.GlobalDefinitions.ExcelLib.ReadData(2, "Category") == Category[i].Text)) { recordFound = true; } else { recordFound = false; } } Assert.True(recordFound == false); Global.Base.test.Log(LogStatus.Pass, "Service is removed successfully"); } catch (Exception e) { IWebElement NoListings = Global.GlobalDefinitions.driver.FindElement(By.XPath("//h3[contains(text(),'You do not have any service listings!')]")); if (NoListings.Displayed) { Assert.AreEqual(NoListings.Text, "You do not have any service listings!"); Global.Base.test.Log(LogStatus.Pass, "You do not have any service listings to Remove"); } else { Global.Base.test.Log(LogStatus.Fail, "Service is not removed" + e); } } }
public void Validate_Remove_AllServices() { test = extent.StartTest("Starting Remove Service test"); ListingManagement service = new ListingManagement(); service.RemoveAllServices(); Global.GlobalDefinitions.wait(5000); try { IWebElement NoListings = Global.GlobalDefinitions.driver.FindElement(By.XPath("//h3[contains(text(),'You do not have any service listings!')]")); if (NoListings.Displayed) { Assert.AreEqual(NoListings.Text, "You do not have any service listings!"); Global.Base.test.Log(LogStatus.Pass, "Service is removed successfully"); } } catch (Exception e) { Global.Base.test.Log(LogStatus.Fail, "Services are not removed" + e); } }
public void DeleteService(string TitleForServcToBeDeleted) { TestCase_Name = $"Deleting existing services for title {TitleForServcToBeDeleted}"; test = extent.CreateTest(TestCase_Name); //Create an instance for the SignIn page SignIn JoinObj = new SignIn(driver); //Invoke the LoginSteps to verify if the user can log in with valid credentials JoinObj.LoginSteps(); //Invoke the function to validate if the user has logged in successfully and the home page is displayed JoinObj.ValidateHomePage(); //Create an instance for the HomePage HomePage listObj = new HomePage(driver); //Invoke the funtion to navigate to Manage Listings listObj.navigateToManageListings(); //Implicit wait Wait.wait(2, driver); //Create an instance for ListingManagement ListingManagement DeletelistObj = new ListingManagement(driver, TitleForServcToBeDeleted); //Invoke Delete Operation DeletelistObj.DeleteDetails(); //Invoke a function to search for the service after deletion DeletelistObj.SearchSkillsAfterDelete(); SearchSkill SrchObj = new SearchSkill(driver); //Invoke a function for search SrchObj.SrchResultAfterDel(); }