Exemple #1
0
        /// <summary>
        /// Read the notification message header text
        /// </summary>
        /// <returns></returns>
        private string readAndReturnNotificationMessageText()
        {
            string message = BaseSeleniumComponents.WaitForAndGet(DataExchangeElement.NotificationAlert).FindChild(By.CssSelector("span[class=\"search-result h1-result\"]")).Text;

            WebContext.Screenshot();
            return(message);
        }
Exemple #2
0
        public static void UpdateValue(string css, object value)
        {
            if (css.Contains("dropdownImitator"))
            {
                SeleniumHelperObsolete.FindAndSetValueForSelector(css, value.ToString());
            }
            else
            {
                var x = BaseSeleniumComponents.WaitForAndGet(new TimeSpan(0, 0, 0, 5), By.CssSelector(css));

                if (x.Displayed)
                {
                    SeleniumHelperObsolete.FindAndSetValue(css, value.ToString());
                }
                else
                {
                    if (x.GetAttribute("data-tristate-checkbox-value") != null)
                    {
                        var c =
                            WebContext.WebDriver.FindElement(
                                By.CssSelector(string.Format("#{0}", x.GetAttribute("name"))));

                        c.Click();
                    }
                }
            }
        }
        public ViewDistribution ClickViewDistribution(int columnNumber)
        {
            IWebElement sortlink = WebContext.WebDriver.FindElement(By.CssSelector("td[column=\"" + columnNumber.ToString() + "\"] > div > i[data-grid-id='marksheetGrid']"));
            string      columnId = sortlink.GetAttribute("data-sort-asc-indicator");

            var columnDetailsDiv = BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector("[data-menu-column-id=\"" + columnId + "\"]"));

            _distributionGraphPopover.Click();
            return(new ViewDistribution());
        }
Exemple #4
0
        public void SetApplicationToAdmitted()
        {
            var loc = By.Name("LearnerApplication.ApplicationStatusSelector.dropdownImitator");

            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption("Admitted");
            Thread.Sleep(1000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("well_know_action_save"))).Click();
            Thread.Sleep(5000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("save_&_continue_button"))).Click();
            Thread.Sleep(5000);
        }
Exemple #5
0
        public void DeleteSchoolIntake(string schoolIntakeId, string admissionYear)
        {
            NavgateToSchoolIntakeDirectly();

            Thread.Sleep(1000);
            var loc = By.CssSelector("form[data-section-id='searchCriteria'] [name='YearOfAdmission.dropdownImitator']");

            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption(admissionYear);
            Thread.Sleep(1000);
            SearchCriteria.Search();
            SearchResults.WaitForResults();
            Thread.Sleep(1000);
            SearchResults.Click(schoolIntakeId);
            Thread.Sleep(2000);
            SeleniumHelper.Get(By.CssSelector("[data-ajax-url*='/iSIMSMVCClientFarm1/School/SchoolIntakeMaintenance/ConfirmDeleteDetail']")).Click();
            Thread.Sleep(2000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("continue_with_delete_button"))).Click();
            Thread.Sleep(2000);
        }
Exemple #6
0
        public string CreateNewApplication(string forename, string surname, string gender, string dateOfBirth, string admissionGroup)
        {
            SeleniumHelper.Get(By.CssSelector("a[title=\"Add New Application\"] > span.toolbar-text")).Click();
            Thread.Sleep(2000);
            SeleniumHelper.Get(By.Name("LegalForename")).Clear();
            SeleniumHelper.Get(By.Name("LegalForename")).SendKeys(forename);

            SeleniumHelper.Get(By.Name("LegalSurname")).Clear();
            SeleniumHelper.Get(By.Name("LegalSurname")).SendKeys(surname);

            By loc = By.Name("Gender.dropdownImitator");

            BaseSeleniumComponents.WaitForAndGet(loc);
            SeleniumHelper.Get(loc).ChooseSelectorOption(gender);

            SeleniumHelper.Get(By.Name("DateOfBirth")).Clear();
            SeleniumHelper.Get(By.Name("DateOfBirth")).SendKeys(dateOfBirth);

            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("continue_button"))).Click();
            Thread.Sleep(1000);

            loc = By.CssSelector("div[data-section-id='dialog-detail'] [name='AdmissionGroup.dropdownImitator']");
            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption(admissionGroup);

            loc = By.Name("EnrolmentStatus.dropdownImitator");
            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption("Single Registration");

            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("create_record_button"))).Click();
            Thread.Sleep(5000);

            var afterSpliItems = SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("well_know_action_save")))
                                 .GetAttribute("data-ajax-url")
                                 .Split('/')
                                 .ToList();
            string learner_id = afterSpliItems.LastOrDefault();

            return(learner_id);
        }
        public static void FindAndSetCheckBox(string css, bool @checked)
        {
            var element = BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector(css));

            var checkedValue = element.GetAttribute("checked");

            if (@checked)
            {
                //Assuming NULL means unchecked.
                if (checkedValue == null)
                {
                    element.Click();
                }
            }
            else
            {
                //Assuming !NULL means checked.
                if (checkedValue != null)
                {
                    element.Click();
                }
            }
        }
Exemple #8
0
        public string CreateNewSchoolIntake(string admissionYear, string admissionTerm, string yearGroup, string plannedAdmissions, string schoolIntakeName, string admissionGroupName, string dateOfAdmission, string capacity)
        {
            // Intake Group
            Thread.Sleep(1000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("add_button"))).Click();
            Thread.Sleep(1000);

            var loc = By.CssSelector("div[data-section-id='IntakeDetailsDependenciesSection'] [name='YearOfAdmission.dropdownImitator']");

            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption(admissionYear);
            Thread.Sleep(1000);

            loc = By.Name("AdmissionTerm.dropdownImitator");
            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption(admissionTerm);
            Thread.Sleep(1000);

            loc = By.CssSelector("div[data-section-id='IntakeDetailsDependenciesSection'] [name='YearGroup.dropdownImitator']");
            BaseSeleniumComponents.WaitForAndGet(loc).ChooseSelectorOption(yearGroup);
            Thread.Sleep(1000);

            var plannedAdmissionNumber = SeleniumHelper.Get(By.Name("PlannedAdmissionNumber"));

            plannedAdmissionNumber.Clear();
            plannedAdmissionNumber.SendKeys(plannedAdmissions);

            Thread.Sleep(1000);
            loc = By.CssSelector("div[data-section-id='IntakeDetailsDependenciesSection'] [name='Name']");
            var name = SeleniumHelper.Get(loc);

            name.Clear();
            name.SendKeys(schoolIntakeName);


            // Admission Group
            Thread.Sleep(1000);
            loc = By.CssSelector("input[name$='.Name'");
            var admissionGroupGridName = SeleniumHelper.Get(loc);

            admissionGroupGridName.Clear();
            admissionGroupGridName.SendKeys(admissionGroupName);

            loc = By.CssSelector("input[name$='.DateOfAdmission'");
            var admissionGroupGridDateOfAdmission = SeleniumHelper.Get(loc);

            admissionGroupGridDateOfAdmission.Clear();
            admissionGroupGridDateOfAdmission.SendKeys(dateOfAdmission);

            loc = By.CssSelector("input[name$='.Capacity'");
            var admissionGroupGridCapacity = SeleniumHelper.Get(loc);

            admissionGroupGridCapacity.Clear();
            admissionGroupGridCapacity.SendKeys(capacity);

            Thread.Sleep(1000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("well_know_action_save"))).Click();

            // New confirmation dialog box
            Thread.Sleep(2000);
            SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("yes,_update_any_associated_applications_button")))
            .Click();

            var afterSpliItems = SeleniumHelper.Get(By.CssSelector(SeleniumHelper.AutomationId("well_know_action_save")))
                                 .GetAttribute("data-ajax-url")
                                 .Split('/')
                                 .ToList();
            string schoolIntakeId = afterSpliItems.LastOrDefault();

            return(schoolIntakeId);
        }
        public static bool FindElement(string css)
        {
            var element = BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector(css));

            return(element != null);
        }
 public static IWebElement GetElementByCssSelector(string Cssselector)
 {
     return(BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector(Cssselector)));
 }
 //Gets last column of marksheet : fails if last column will not be visible
 public static IWebElement FindLastColumn()
 {
     return(BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector("[class=\" webix_last\"]")));
 }
 public static IWebElement FindColumnByColumnNumber(string columnNumber)
 {
     return(BaseSeleniumComponents.WaitForAndGet(BrowserDefaults.TimeOut, By.CssSelector("[column='" + columnNumber + "']")));
 }