Beispiel #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();
        }
Beispiel #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());
        }
Beispiel #3
0
 public void DeleteRow()
 {
     if (_removeButton.IsExist())
     {
         _removeButton.ClickByJS();
         var _okButton = SeleniumHelper.Get(SimsBy.AutomationId("Yes_button"));
         if (_okButton.IsExist())
         {
             _okButton.Click();
         }
     }
 }
Beispiel #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);
     }
 }
Beispiel #5
0
 public bool IsDateOfAdmissionWarningMessageDisplayed()
 {
     try
     {
         AutomationSugar.WaitForAjaxCompletion();
         return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_error")));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #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();
         }
     }
 }
Beispiel #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());
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #11
0
 public bool IsYesNoDeleteButtonDisplayed()
 {
     return(SeleniumHelper.FindElement(SimsBy.AutomationId("Yes_button")).IsExist() && SeleniumHelper.FindElement(SimsBy.AutomationId("No_button")).IsExist());
 }
Beispiel #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());
 }
Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #18
0
 /// <summary>
 /// Creates this instance.
 /// </summary>
 /// <returns></returns>
 public static ExclusionRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("well_know_action_save"));
     return(new ExclusionRecordPage());
 }
Beispiel #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"));
 }