Exemplo n.º 1
0
 public void SrchResultAfterDel()
 {
     //Search for service only if the service is active
     if (ServiceData.ActvStatusData(RowNum) == "Active")
     {
         Wait.wait(1, driver);
         String displayResult = "No results found, please select a new category!";
         Assert.That(SrchDisplay.Text, Is.EqualTo(displayResult));
     }
 }
Exemplo n.º 2
0
 public void SkillSrchResult()
 {
     if (ServiceData.ActvStatusData(RowNum) == "Active")
     {
         Thread.Sleep(500);
         if ((SellerInfo.Text == "Sara Susan") && (ServiceData.TitleData(RowNum) == ServiceInfo.Text))
         {
             TestContext.WriteLine("The service has been found in the search list");
         }
         String CreditCharge    = "Charge is :$" + ServiceData.CreditValue(RowNum);
         String CreditActualVal = Charge.Text;
         Assert.That(CreditActualVal, Is.EqualTo(CreditCharge));
         Service.Click();
     }
 }
Exemplo n.º 3
0
        public void ViewListings()
        {
            //Implicit wait until the listings are visible
            Wait.wait(2, driver);

            //Validate the Listings in the Manage Listings Page by checking the values displayed for all the fields with the values from excel

            //Read the data for Title from excel into a variable
            var TitleData = ServiceData.TitleData(RowNum);

            //Read the data for Category from excel into a variable
            var CategoryData = ServiceData.CategData(RowNum);

            //Read the data for Description from excel into a variable
            var DescriptionData = ServiceData.DescriptionData(RowNum);

            String DescriptionDataTrunc = "";
            String Description          = "";

            //Truncate the string (only 70 characters of description gets displayed in the Manage listing)
            if (DescriptionData.Length > 70)
            {
                DescriptionDataTrunc = DescriptionData.Substring(0, 70);
                Description          = DescriptionListing.Text.Substring(0, 70);
            }
            else
            {
                DescriptionDataTrunc = DescriptionData;
                Description          = DescriptionListing.Text;
            }

            //Read the data for Service Type from excel into a variable
            var ServiceTypeData = ServiceData.SrvcTypeData(RowNum);

            //Read the data for Service Type from excel into a variable
            var SkillTradeData = ServiceData.SkillTrdeData(RowNum);

            //Read the data for Service Type from excel into a variable
            var ActiveStatusData = ServiceData.ActvStatusData(RowNum);

            //Set a flag as per the status of Active provided by user
            bool ActiveStatusSet = false;

            if (ActiveStatusData == "Active")
            {
                ActiveStatusSet = true;
            }
            else if (ActiveStatusData == "Hidden")
            {
                ActiveStatusSet = false;
            }

            //Assert statements to validate the various fields of the listings
            Assert.Multiple(() =>
            {
                Assert.That(TitleData, Is.EqualTo(TitleListing.Text));
                Assert.That(DescriptionDataTrunc, Is.EqualTo(Description));
                Assert.That(CategoryData, Is.EqualTo(CategoryListing.Text));
                Assert.That(ServiceTypeData, Is.EqualTo(ServiceTypeListing.Text));
                Assert.That(ActiveStatusSet, Is.EqualTo(ActiveStatusListing.Selected));
            });
        }
Exemplo n.º 4
0
        public void FillDetailsOfServiceProvided()
        {
            //Wait for the share skill page to be loaded and until title field text box is visible
            Wait.ElementIsVisible(driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[1]/div/div[2]/div/div[1]/input");

            //Read the data for Title from excel and enter the data into the Title Textbox
            Title.SendKeys(ServiceData.TitleData(RowNum));

            //Read the data for Description from excel and enter the data into the Description Textbox
            Description.SendKeys(ServiceData.DescriptionData(RowNum));

            //Read the Category name from the excel
            var CategoryData = ServiceData.CategData(RowNum);

            //Read the Subcategory name from the excel
            var SubCategoryData = ServiceData.SubCategData(RowNum);

            SelectElement CategorySelect = new SelectElement(Category);

            //Select the required Category from the dropdown
            CategorySelect.SelectByText(CategoryData);

            SelectElement SubCategorySelect = new SelectElement(SubCategory);

            //Select the required SubCategory from the dropdown
            SubCategorySelect.SelectByText(SubCategoryData);

            //Read the Skill exchange tag count from the excel
            var SkillExchngCount = ServiceData.TagsCntData(RowNum);

            int Count     = Int32.Parse(SkillExchngCount);
            int TagsCount = Int32.Parse(ServiceData.TagsDataCount(RowNum));

            int DaysCnt = Int32.Parse(ServiceData.AvailableDaysCnt(RowNum));

            //Fill in the Start and End times for all days
            for (int TagCount = 0; TagCount < TagsCount; TagCount++)
            {
                //Read the data for Tags from excel and enter the data into the Tags field
                Tags.SendKeys(ExcelLibHelpers.ReadData((TagCount + RowNum), "Tags"));

                //Press ENTER key to add the tag
                Tags.SendKeys(Keys.Enter);
            }

            //Read the Service Type data from excel into a variable
            var ServiceTypeData = ServiceData.SrvcTypeData(RowNum);

            //Read the Location Type data from excel into a variable
            var LocationTypeData = ServiceData.LocatnTypeData(RowNum);

            //Read the Skill Trade data from excel into a variable
            var SkillTradeData = ServiceData.SkillTrdeData(RowNum);

            //Read the Active Status data from excel into a variable
            var ActiveStatusData = ServiceData.ActvStatusData(RowNum);

            //Choose Service Type
            ChooseServiceType(ServiceTypeData);

            //Choose Location Type
            ChooseLocationType(LocationTypeData);

            //Choose Skill Trade
            ChooseSkillTrade(SkillTradeData, Count);

            //Click on the 'Start date' field
            StartDate.Click();

            //Read the Start Date data from the excel
            var StartDateData = ServiceData.StrtDateData(RowNum);

            //Read the End Date data from the excel
            var EndDateData = ServiceData.EndDateData(RowNum);

            //Initialse the variable that hold StartTime and EndTime
            var StartTimeData = "000000";
            var EndTimeData   = "000000";

            //Clear the field before adding the date
            StartDate.Clear();

            //Enter the data for 'Start date' from excel
            StartDate.SendKeys(StartDateData);

            Wait.wait(1, driver);

            //Click on the 'End date' field
            EndDate.Click();

            //Clear the 'End date'
            EndDate.Clear();

            //Enter the data for 'End date' from excel
            EndDate.SendKeys(EndDateData);


            //Select the Start time, End time, Available Days
            for (int DaysCount = 0; DaysCount < DaysCnt; DaysCount++)
            {
                if (ServiceData.AvailableDays(RowNum) == "Sun")
                {
                    CheckBox[0].Click();
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    StartTime[0].Click();
                    StartTime[0].SendKeys(StartTimeData);
                    EndTime[0].Click();
                    EndTime[0].SendKeys(EndTimeData);
                }
                else if (ServiceData.AvailableDays(RowNum) == "Mon")
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[1].Click();
                    StartTime[1].Click();
                    StartTime[1].SendKeys(StartTimeData);
                    EndTime[1].Click();
                    EndTime[1].SendKeys(EndTimeData);
                }
                else if (ServiceData.AvailableDays(RowNum) == "Tue")
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[2].Click();
                    StartTime[2].Click();
                    StartTime[2].SendKeys(StartTimeData);
                    EndTime[2].Click();
                    EndTime[2].SendKeys(EndTimeData);
                }
                else if (ServiceData.AvailableDays(RowNum) == "Wed")
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[3].Click();
                    StartTime[3].Click();
                    StartTime[3].SendKeys(StartTimeData);
                    EndTime[3].Click();
                    EndTime[3].SendKeys(EndTimeData);
                }
                else if (ServiceData.AvailableDays(RowNum) == "Thu")
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[4].Click();
                    StartTime[4].Click();
                    StartTime[4].SendKeys(StartTimeData);
                    EndTime[4].Click();
                    EndTime[4].SendKeys(EndTimeData);
                }
                else if (ServiceData.AvailableDays(RowNum) == "Fri")
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[5].Click();
                    StartTime[5].Click();
                    StartTime[5].SendKeys(StartTimeData);
                    EndTime[5].Click();
                    EndTime[5].SendKeys(EndTimeData);
                }
                else
                {
                    StartTimeData = ServiceData.StrtTimeData(RowNum);
                    EndTimeData   = ServiceData.EndTimeData(RowNum);
                    CheckBox[6].Click();
                    StartTime[6].Click();
                    StartTime[6].SendKeys(StartTimeData);
                    EndTime[6].Click();
                    EndTime[6].SendKeys(EndTimeData);
                }
                RowNum++;
            }


            //Choose the Active status button
            ChooseActiveStatus(ActiveStatusData);

            //Click on the save button
            SaveButton.Click();

            //Implicit wait
            Wait.wait(1, driver);
        }