Пример #1
0
        public PupilPickerDialog ClickAddPupil()
        {
            _addPupilButton.ClickByJS();
            Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));

            return(new PupilPickerDialog());
        }
Пример #2
0
 public void Cancel()
 {
     if (_cancelButton.IsExist())
     {
         _cancelButton.ClickByJS();
         Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     }
 }
Пример #3
0
 public void ClickDelete()
 {
     base.Refresh();
     if (_deleteButton.IsExist())
     {
         _deleteButton.ClickByJS();
         Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     }
 }
Пример #4
0
 public MedicalPracticePage Cancel()
 {
     if (_cancelButton.IsExist())
     {
         _cancelButton.ClickByJS();
         Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     }
     return(new MedicalPracticePage());
 }
Пример #5
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();
        }
Пример #6
0
 public SuspensionRecordPage ClickDeleteRow(SuspensionExpulsion row)
 {
     if (row != null)
     {
         row.DeleteRow();
         _saveButton.Click();
         Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     }
     return(new SuspensionRecordPage());
 }
Пример #7
0
 public ConfirmRequiredDialog ClickSave(bool waitForConfirmDialog = true)
 {
     _saveButton.ClickByJS();
     Wait.WaitForAjaxReady(By.CssSelector(".locking-mask"));
     if (waitForConfirmDialog)
     {
         Wait.WaitForElement(SimsBy.CssSelector("[data-section-id='generic-confirm-dialog']"));
         return(new ConfirmRequiredDialog());
     }
     return(null);
 }
Пример #8
0
 public void DeleteRow()
 {
     if (_removeButton.IsExist())
     {
         _removeButton.ClickByJS();
         var _okButton = SeleniumHelper.Get(SimsBy.AutomationId("Yes_button"));
         if (_okButton.IsExist())
         {
             _okButton.Click();
         }
     }
 }
Пример #9
0
 public bool IsDateOfAdmissionWarningMessageDisplayed()
 {
     try
     {
         AutomationSugar.WaitForAjaxCompletion();
         return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_error")));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Пример #10
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);
     }
 }
Пример #11
0
        public List <Note> GetNotes()
        {
            List <Note> lstNote = new List <Note>();
            var         _notes  = _timeLineElement.FindElements(SimsBy.CssSelector(".event"));

            foreach (var noteElement in _notes)
            {
                var note = new Note(noteElement);
                lstNote.Add(note);
            }
            return(lstNote);
        }
Пример #12
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());
        }
Пример #13
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();
         }
     }
 }
Пример #14
0
        public bool IsOverlapMessageDisplayed()
        {
            IList <IWebElement> elements = SeleniumHelper.FindElements(SimsBy.CssSelector(".validation-summary-errors li"));

            foreach (var element in elements)
            {
                if (element.GetText().Trim().Contains("Dates Overlap"))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #15
0
        public SuspensionRecordPage ClickDeleteAllRow(List <SuspensionExpulsion> rows)
        {
            if (rows.Count > 0)
            {
                foreach (SuspensionExpulsion row in rows)
                {
                    row.DeleteRow();
                }
                _saveButton.Click();
                Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
            }

            return(new SuspensionRecordPage());
        }
Пример #16
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);
        }
Пример #17
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());
        }
Пример #18
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);
            }
        }
Пример #19
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);
        }
Пример #20
0
 public bool IsYesNoDeleteButtonDisplayed()
 {
     return(SeleniumHelper.FindElement(SimsBy.AutomationId("Yes_button")).IsExist() && SeleniumHelper.FindElement(SimsBy.AutomationId("No_button")).IsExist());
 }
Пример #21
0
 public bool IsSuccessMessageDisplay()
 {
     AutomationSugar.WaitForAjaxCompletion();
     return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_success")));
 }
Пример #22
0
 public string GetSliderState()
 {
     Wait.WaitUntilDisplayed(SimsBy.CssSelector("[data-subslider-control]"));
     return(WebContext.WebDriver.FindElement(By.CssSelector("input[name='SliderState']")).GetValue());
 }
Пример #23
0
 public void SelectAssociatedPupilsTab()
 {
     _associatedPupilsLink.ClickByJS();
     Wait.WaitForElementDisplayed(SimsBy.CssSelector("[data-maintenance-container='LearnerContactRelationships']"));
 }
Пример #24
0
 public SuspensionRecordPage SaveValues()
 {
     _saveButton.Click();
     Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     return(new SuspensionRecordPage());
 }
Пример #25
0
 public AddAssociatedPupilsTripletDialog ClickAddPupilLink()
 {
     _addPupilLink.ClickByJS();
     Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
     return(new AddAssociatedPupilsTripletDialog());
 }
Пример #26
0
 public void ClickAdd()
 {
     _addButton.ClickByJS();
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("well_know_action_save"));
     Refresh();
 }
Пример #27
0
 public static BehaviourEventRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("add_button"));
     return(new BehaviourEventRecordPage());
 }
Пример #28
0
 public void ClickFollowUpTab()
 {
     _followUpTab.ClickByJS();
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("pupil_Involved_Selection_Strip"));
     Refresh();
 }
Пример #29
0
 /// <summary>
 /// Creates this instance.
 /// </summary>
 /// <returns></returns>
 public static ExclusionRecordPage Create()
 {
     Wait.WaitUntilDisplayed(SimsBy.AutomationId("well_know_action_save"));
     return(new ExclusionRecordPage());
 }
Пример #30
0
 public void ClickSave()
 {
     _saveButton.Click();
     Wait.WaitForAjaxReady(SimsBy.CssSelector(".locking-mask"));
 }