internal void SelectServiceTypeOptions()
        {
            //Select the Service type

            // ServiceTypeOptions.Click();


            if (GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='locationType' and @value='0']")).Text.Equals(GlobalDefinitions.ExcelLib.ReadData(2, "Service Type")))
            {
                Hourlybasisservice.Click();
            }
            else
            {
                Oneoffservice.Click();
            }

            Base.test.Log(LogStatus.Info, "Selected Service Type");
        }
Example #2
0
        internal void EditShareSkill()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\Rammy\Desktop\marsframework\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            GlobalDefinitions.wait(30);

            //Click on ShareSkill button
            ShareSkillButton.Click();

            //Wait
            GlobalDefinitions.wait(30);

            //Enter data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Title"));
            string TitleTextbox = Title.GetAttribute("Value");

            if (TitleTextbox.Length == 0)
            {
                Assert.IsEmpty("Title");
            }

            //Enter data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Description"));
            Assert.That(Description.Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(3, "Description")));

            CategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Category"));
            CategoryDropDown.Click();

            SubCategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "SubCategory"));
            SubCategoryDropDown.Click();

            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Tags"));
            Tags.SendKeys(Keys.Enter);

            //Click on Hourly basis service or One-off service
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "Hourly basis service")
            {
                Hourlybasisservice.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "One-off service")
            {
                OneOffservice.Click();
            }

            //Click on On-site or Online
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "On-site")
            {
                OnSite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "Online")
            {
                Online.Click();
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Convert excel dateformat to C# - Enter data in Staredate
            string dateformat   = "dd / MM / yyyy";
            string sdate        = GlobalDefinitions.ExcelLib.ReadData(3, "Startdate");
            string newStartDate = DateTime.Parse(sdate).ToString(dateformat);

            StartDateDropDown.SendKeys(newStartDate);

            string StartDate = StartDateDropDown.GetAttribute("Value");

            if (StartDate.Length == 0)
            {
                Assert.IsEmpty("Startdate");
            }

            //Convert excel dateformat to C# - Enter data in Enddate
            string edate      = GlobalDefinitions.ExcelLib.ReadData(3, "Enddate");
            string newEndDate = DateTime.Parse(edate).ToString(dateformat);

            EndDateDropDown.SendKeys(newEndDate);

            string EndDate = EndDateDropDown.GetAttribute("Value");

            if (EndDate.Length == 0)
            {
                Assert.IsEmpty("Enddate");
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Click on a day
            Days.Click();

            //Convert excel timeformat to C# - enter data in Starttime
            string timeformat   = "hh:mmtt";
            string stime        = GlobalDefinitions.ExcelLib.ReadData(3, "Starttime");
            string newStartTime = DateTime.Parse(stime).ToString(timeformat);

            StartTimeDropDown.SendKeys(newStartTime);

            string Start = StartTimeDropDown.GetAttribute("Value");

            if (Start.Length == 0)
            {
                Assert.IsEmpty("Starttime");
            }

            //Convert excel timeformat to C# - enter data in Endtime
            string etime      = GlobalDefinitions.ExcelLib.ReadData(3, "Endtime");
            string newEndTime = DateTime.Parse(etime).ToString(timeformat);

            EndTimeDropDown.SendKeys(newEndTime);

            string End = EndTimeDropDown.GetAttribute("Value");

            if (End.Length == 0)
            {
                Assert.IsEmpty("Endtime");
            }

            //Click on Skill-exchange or Credit
            if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Skill-exchange")
            {
                SkillExchangeOption.Click();
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Credit")
            {
                CreditOption.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
            }


            //Click on Active or Hidden
            ActiveOption.Click();
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Active")
            {
                ActiveOption.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Hidden")
            {
                HiddenOption.Click();
            }

            //Upload a file
            WorkSample.Click();
            GlobalDefinitions.wait(20);
            string path = GlobalDefinitions.ExcelLib.ReadData(3, "WorkSample");

            AutoItX.WinActivate("File Upload");

            //Wait
            GlobalDefinitions.wait(60);

            AutoItX.Send(path);
            AutoItX.Send("{ENTER}");

            Save.Click();

            Assert.That(ManageTitle.Text, Is.EqualTo("Voice Actor"));
        }