示例#1
0
        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();
            }
        }