Пример #1
0
        internal void EditShareSkillData()
        {
            //Calling wait method
            GenericWait.ElementExists(GlobalDefinitions.driver, "Name", "title", 8);

            //Clearing the "Title"
            Title.Clear();

            //Entering the updated "Title"
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "Title"));
            //Validating Title
            GlobalDefinitions.TextDataFieldValidation("Title", GlobalDefinitions.ExcelLib.ReadData(2, "Title"), Title.GetAttribute("value"));

            //Clearing the "Description"
            Description.Clear();

            //Entering the updated "Description"
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "Description"));
            //Validating Description
            GlobalDefinitions.TextDataFieldValidation("Description", GlobalDefinitions.ExcelLib.ReadData(4, "Description"), Description.Text);

            // Select the Service type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(4, "ServiceType"));
            //Validating Service Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("ServiceTypeRadioButtons", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(4, "ServiceType"));

            // Select the Location type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(4, "LocationType"));
            //Validating Location Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("LocationTypeRadioButtons", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(4, "LocationType"));
        }
Пример #2
0
        public void SelectAvailabilityType()
        {
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Availability']/../..//*[@class='right floated outline small write icon']", 5);
            Thread.Sleep(2000);
            string AvailabilityTypeValue = GlobalDefinitions.ExcelLib.ReadData(2, "Availability Type");

            if (AvailabilityTypeValue == "Full Time")
            {
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Availability']/../..//*[@class='right floated outline small write icon']", 5);

                AvailabilityTypeEditButton.Click();
                HelperCallingMethods.SelectingDropdown(AvailabilityType, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Availabilty Type"));

                //Validate message
                GlobalDefinitions.MessageValidation("Availability updated");
                Thread.Sleep(2000);
            }
            else if (AvailabilityTypeValue == "Part Time")
            {
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Availability']/../..//*[@class='right floated outline small write icon']", 5);
                AvailabilityTypeEditButton.Click();
                HelperCallingMethods.SelectingDropdown(AvailabilityType, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Availability Type"));

                //Validate message
                GlobalDefinitions.MessageValidation("Availability updated");
                Thread.Sleep(2000);
            }
        }
Пример #3
0
        public void SelectAvailabilityHour()
        {
            //GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathAddShareSkill, "Availability");
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Hours']/../..//*[@class='right floated outline small write icon']", 5);

            string AvailabilityHourValue = GlobalDefinitions.ExcelLib.ReadData(2, "Availability Hour");

            if (AvailabilityHourValue == "Less than 30hours a week")
            {
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Hours']/../..//*[@class='right floated outline small write icon']", 5);

                AvailabilityHourEditButton.Click();
                HelperCallingMethods.SelectingDropdown(AvailabilityHour, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Availability Hour"));


                //Validate message
                GlobalDefinitions.MessageValidation("Availability updated");
                Thread.Sleep(2000);
            }
            else if (AvailabilityHourValue == "More than 30hours a week")
            {
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Hours']/../..//*[@class='right floated outline small write icon']", 5);

                AvailabilityHourEditButton.Click();
                HelperCallingMethods.SelectingDropdown(AvailabilityHour, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Availability Hour"));

                //Validate message
                GlobalDefinitions.MessageValidation("Availability updated");
                Thread.Sleep(2000);
            }

            else if (AvailabilityHourValue == "As needed")
            {
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//strong[text()='Hours']/../..//*[@class='right floated outline small write icon']", 5);

                AvailabilityHourEditButton.Click();
                HelperCallingMethods.SelectingDropdown(AvailabilityHour, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Availabilty Hour"));

                //Validate message
                GlobalDefinitions.MessageValidation("Availability updated");
                Thread.Sleep(2000);
            }
        }
Пример #4
0
        internal void EnterShareSkill()
        {
            //Calling wait method
            GenericWait.ElementExists(GlobalDefinitions.driver, "Name", "title", 8);

            //Entering the "Title"
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            //Validating Title
            GlobalDefinitions.TextDataFieldValidation("Title", GlobalDefinitions.ExcelLib.ReadData(2, "Title"), Title.GetAttribute("value"));

            //Entering the "Description"
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            //Validating Description
            GlobalDefinitions.TextDataFieldValidation("Description", GlobalDefinitions.ExcelLib.ReadData(2, "Description"), Description.Text);

            //Selecting Category
            HelperCallingMethods.SelectingDropdown(CategoryDropDown, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
            //Validating Category selection
            GlobalDefinitions.DropDownDataValidation("Category", CategoryDropDown, GlobalDefinitions.ExcelLib.ReadData(2, "Category"));

            //Selecting Sub-Category
            HelperCallingMethods.SelectingDropdown(SubCategoryDropDown, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));
            //Validating Sub-Category selection
            GlobalDefinitions.DropDownDataValidation("SubCategory", SubCategoryDropDown, GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));

            //Entering Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags") + "\n");
            //GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//span[@class='ReactTags__tag']"), 5);
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//span[@class='ReactTags__tag']", 6);
            string EnteredTagTxt = TagReact.Text;

            //Validating entered Tag
            GlobalDefinitions.TextDataFieldValidation("Tags", GlobalDefinitions.ExcelLib.ReadData(2, "Tags"), EnteredTagTxt.Remove(EnteredTagTxt.Length - 1, 1));

            // Select the Service type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"));
            //Validating Service Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("ServiceTypeRadioButtons", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"));

            // Select the Location type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"));
            //Validating Location Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("LocationTypeRadioButtons", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"));

            //Selecting date and time
            HelperCallingMethods helperCallingMethods = new HelperCallingMethods();

            helperCallingMethods.SelectingDateAndTime();
            //Validating Start Date, End Date, Start Time,End Time
            GlobalDefinitions.TextDataFieldValidation("Start Date", DateTime.Today.ToString("dd/MM/yyyy"), DateTime.Parse(StartDateDropDown.GetAttribute("value")).ToString("dd/MM/yyyy"));
            GlobalDefinitions.TextDataFieldValidation("End Date", DateTime.Today.AddDays(14).ToString("dd/MM/yyyy"), DateTime.Parse(EndDateDropDown.GetAttribute("value")).ToString("dd/MM/yyyy"));
            GlobalDefinitions.TextDataFieldValidation("Start Time", GlobalDefinitions.ExcelLib.ReadData(2, "Starttime"), DateTime.Parse(StartTime.GetAttribute("value")).ToString("hh:mmtt"));
            GlobalDefinitions.TextDataFieldValidation("End Time", GlobalDefinitions.ExcelLib.ReadData(2, "Endtime"), DateTime.Parse(EndTime.GetAttribute("value")).ToString("hh:mmtt"));


            //Selecting SkillTrade or Credit radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[8]/div[@class='twelve wide column']/div/div[@class = 'field']", "skillTrades", GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade"));
            string SkillTradeValue = GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade");

            //Enter Skill-Exchange or Credit
            if (SkillTradeValue == "Skill-exchange")
            {
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange") + "\n");
                //Validating entered Skill exchange value
                GlobalDefinitions.TextDataFieldValidation("SkillExchange", GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"), SkillExchangeTag.Text.Remove(SkillExchangeTag.Text.Length - 1, 1));
            }
            else if (SkillTradeValue == "Credit")
            {
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
                //Validating entered Credit value
                GlobalDefinitions.TextDataFieldValidation("Credit", GlobalDefinitions.ExcelLib.ReadData(2, "Credit"), CreditAmount.GetAttribute("value"));
            }

            //Uploading file for Work Sample
            WorkSamples.Click();
            AutoItX3 autoIt = new AutoItX3();

            autoIt.WinWait("Open", "File Upload", 1);
            autoIt.WinActivate("Open", "File Upload");
            autoIt.ControlFocus("Open", "File Upload", "[CLASS:Edit; INSTANCE:1]");
            autoIt.Sleep(1000);
            //autoIt.Send(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory()) + "\\FileUploadTest.txt"));
            autoIt.Send(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\FileUploadTest.txt"));
            autoIt.Sleep(1000);
            autoIt.Send("{ENTER}");
            autoIt.Sleep(2000);
            string[] FileSplitText     = WorkSampleFileName.Text.Split('.');
            string   FileSplitTextName = FileSplitText[0];

            //Validating uploaded worksample
            GlobalDefinitions.TextDataFieldValidation("WorkSamples", FileSplitTextName.ToString(), GlobalDefinitions.ExcelLib.ReadData(2, "FileName").ToString());

            //selecting Active radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", "isActive", GlobalDefinitions.ExcelLib.ReadData(2, "Active"));
            //Validating Active radio button selection
            GlobalDefinitions.RadiobuttonValidation("Active", "//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", "isActive", GlobalDefinitions.ExcelLib.ReadData(2, "Active"));

            //Clicking Save button
            Save.Click();

            string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Share skill added");
        }