Example #1
0
        public void ClickSave()
        {
            SeleniumHelper.Sleep(5);
            Wait.WaitForControl(SimsBy.AutomationId("well_know_action_save"));
            IWebElement save = SeleniumHelper.Get(SimsBy.AutomationId("well_know_action_save"));

            save.ClickByJS();
            Wait.WaitForAjaxReady(By.CssSelector(".locking-mask"));
            Refresh();
        }
Example #2
0
        public QuickAddBehaviourDialog OpenBehaviourPopup()
        {
            By behaviourLinkSelector = SimsBy.Xpath("//*/a[@data-class-log-conduct-event='behaviourlink']");

            ElementRetriever.FindElementSafe(WebContext.WebDriver, behaviourLinkSelector).Click();
            AutomationSugar.WaitForAjaxCompletion();

            // Arbitrary but assume that if the title is displayed then the dialog has loaded?
            Wait.WaitForElementDisplayed(SimsBy.AutomationId("record_behaviour_popup_header_title"));

            return(new QuickAddBehaviourDialog());
        }
Example #3
0
 public void DeleteRow()
 {
     if (_removeButton.IsExist())
     {
         _removeButton.ClickByJS();
         var _okButton = SeleniumHelper.Get(SimsBy.AutomationId("Yes_button"));
         if (_okButton.IsExist())
         {
             _okButton.Click();
         }
     }
 }
Example #4
0
 /// <summary>
 /// Au : Hieu Pham
 /// Check Pupil Leaving detail display for pupil name.
 /// </summary>
 /// <param name="pupilName"></param>
 /// <returns></returns>
 public bool IsPupilLeavingDetailForPupilName(string pupilName)
 {
     try
     {
         IWebElement titleElement = SeleniumHelper.FindElement(SimsBy.AutomationId("pupil_leaving_details_header_display_name"));
         return(titleElement.GetText().Equals(pupilName));
     }
     catch (NoSuchElementException)
     {
         return(false);
     }
 }
Example #5
0
 public bool IsDateOfAdmissionWarningMessageDisplayed()
 {
     try
     {
         AutomationSugar.WaitForAjaxCompletion();
         return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_error")));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #6
0
 public void DeleteRow()
 {
     if (SeleniumHelper.IsExist(_deleteButton))
     {
         _deleteButton.ScrollToByAction();
         _deleteButton.ClickByJS();
         var _okButton = SeleniumHelper.Get(SimsBy.AutomationId("Yes_button"));
         if (SeleniumHelper.IsExist(_okButton))
         {
             _okButton.Click();
         }
     }
 }
Example #7
0
        public SuspensionRecordPage ConfirmDelete(SuspensionExpulsion row, bool isDelete = false)
        {
            IWebElement _cancelButton = SeleniumHelper.Get(SimsBy.AutomationId("No_button"));
            IWebElement _yesButton    = SeleniumHelper.Get(SimsBy.AutomationId("Yes_button"));

            if (isDelete)
            {
                _yesButton.Click();
            }
            else
            {
                _cancelButton.Click();
            }
            return(new SuspensionRecordPage());
        }
Example #8
0
        public Note GetNote(string noteName)
        {
            var _notes = _timeLineElement.FindElements(SimsBy.CssSelector(".event"));

            foreach (var note in _notes)
            {
                var name = note.FindElement(SimsBy.AutomationId("log-event-heading")).GetText();
                if (name.Trim().Contains(noteName))
                {
                    return(new Note(note));
                }
            }

            return(null);
        }
Example #9
0
        public SearchListResultsComponent <TResultTile> Search()
        {
            WebDriverWait wait = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(10));
            Stopwatch     sw   = new Stopwatch();

            sw.Start();
            AutomationSugar.ClickOn(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("search_criteria_submit")));
            _logger.LogLine("Waiting and clicking on search button took {0}ms.", sw.ElapsedMilliseconds);
            wait.Until(ExpectedConditions.ElementIsVisible(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("resultTile"))));
            _logger.LogLine("Waiting search results took {0}ms.", sw.ElapsedMilliseconds);
            SearchListResultsComponent <TResultTile> results = new SearchListResultsComponent <TResultTile>(_parent);

            _logger.LogLine("Binding seach results tool {0}ms.", sw.ElapsedMilliseconds);
            sw.Stop();
            return(results);
        }
Example #10
0
        private void Initialise()
        {
            const string resultTileIdentifier = "search_result";

            var results = this.Component.FindElements(SimsBy.AutomationId(resultTileIdentifier));

            foreach (var result in results)
            {
                var resultComponent = new TResultTile {
                    Tile = result
                };

                PageFactory.InitElements(resultComponent, new ElementLocator(result));
                _results.Add(resultComponent);
            }
        }
Example #11
0
 public bool IsYesNoDeleteButtonDisplayed()
 {
     return(SeleniumHelper.FindElement(SimsBy.AutomationId("Yes_button")).IsExist() && SeleniumHelper.FindElement(SimsBy.AutomationId("No_button")).IsExist());
 }
Example #12
0
 public bool IsSuccessMessageDisplay()
 {
     AutomationSugar.WaitForAjaxCompletion();
     return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_success")));
 }
 public void ClickAdd()
 {
     _addButton.ClickByJS();
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("well_know_action_save"));
     Refresh();
 }
 public static BehaviourEventRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("add_button"));
     return(new BehaviourEventRecordPage());
 }
Example #15
0
 public void ClickClear()
 {
     AutomationSugar.WaitFor(new ByChained(this.ComponentIdentifier, SimsBy.AutomationId("clear_jobstep_button")));
     AutomationSugar.ClickOn(new ByChained(this.ComponentIdentifier, SimsBy.AutomationId("clear_jobstep_button")));
     AutomationSugar.WaitForAjaxCompletion();
 }
Example #16
0
 public static AchievementEventRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("add_button"));
     return(new AchievementEventRecordPage());
 }
 public void ClickFollowUpTab()
 {
     _followUpTab.ClickByJS();
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("pupil_Involved_Selection_Strip"));
     Refresh();
 }
Example #18
0
 /// <summary>
 /// Creates this instance.
 /// </summary>
 /// <returns></returns>
 public static ExclusionRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("well_know_action_save"));
     return(new ExclusionRecordPage());
 }
Example #19
0
 public void Delete()
 {
     _timeLineElement.FindElement(SimsBy.AutomationId("delete_button")).ClickByJS();
     SeleniumHelper.FindElement(SimsBy.AutomationId("Yes_button")).ClickByJS();
     Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
 }