示例#1
0
        public void ClickSave(string automationID)
        {
            AutomationSugar.ClickOn(new ByChained(DialogIdentifier, SeSugar.Automation.SimsBy.AutomationId(automationID)));
            AutomationSugar.WaitForAjaxCompletion();

            System.Threading.Thread.Sleep(5000);
        }
示例#2
0
 public void ClickManualAddAddress()
 {
     //_addManualAddressButton.Click();
     AutomationSugar.WaitFor(new ByChained(this.ComponentIdentifier, SeSugar.Automation.SimsBy.AutomationId("find_address_jobstep_button")));
     AutomationSugar.ClickOn(new ByChained(this.ComponentIdentifier, SeSugar.Automation.SimsBy.AutomationId("find_address_jobstep_button")));
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#3
0
 public void Click()
 {
     Tile.Click();
     Thread.Sleep(500);
     AutomationSugar.WaitForAjaxCompletion();
     //Wait.WaitForAjaxReady(By.CssSelector(".locking-mask"));
     Wait.WaitForDocumentReady();
 }
示例#4
0
        public void AssessmentNoteTextSave()
        {
            IWebElement noteSaveElement =
                WebContext.WebDriver.FindElement(By.CssSelector("[data-ajax-update-detail='']"));

            noteSaveElement.Click();
            AutomationSugar.WaitForAjaxCompletion();
        }
示例#5
0
        protected TPageObject ClickAdd <TPageObject>() where TPageObject : BaseComponent, new()
        {
            AutomationSugar.WaitFor(new ByChained(this.ComponentIdentifier, SeSugar.Automation.SimsBy.AutomationId("add_button")));
            AutomationSugar.ClickOn(new ByChained(this.ComponentIdentifier, SeSugar.Automation.SimsBy.AutomationId("add_button")));
            AutomationSugar.WaitForAjaxCompletion();

            return(new TPageObject());
        }
示例#6
0
        public DeniTripletPage OKButton()
        {
            var           okButton = By.CssSelector("[data-automation-id='ok_button']");
            WebDriverWait wait     = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(10));

            wait.Until(ExpectedConditions.ElementIsVisible(okButton)).Click();
            AutomationSugar.WaitForAjaxCompletion();
            return(new DeniTripletPage());
        }
示例#7
0
            public void ClickMoveAddress()
            {
                AutomationSugar.WaitFor("Action_Dropdown");
                AutomationSugar.ClickOn("Action_Dropdown");
                AutomationSugar.WaitForAjaxCompletion();

                AutomationSugar.WaitFor("Move_address_Action");
                AutomationSugar.ClickOn("Move_address_Action");
                AutomationSugar.WaitForAjaxCompletion();
            }
示例#8
0
        public void ClickDelete()
        {
            AutomationSugar.WaitFor("delete_button");
            AutomationSugar.ClickOn("delete_button");
            AutomationSugar.WaitForAjaxCompletion();

            AutomationSugar.WaitFor(new ByChained(SeSugar.Automation.SimsBy.AutomationId("confirm_delete_dialog"), SeSugar.Automation.SimsBy.AutomationId("continue_with_delete_button")));
            AutomationSugar.ClickOn(new ByChained(SeSugar.Automation.SimsBy.AutomationId("confirm_delete_dialog"), SeSugar.Automation.SimsBy.AutomationId("continue_with_delete_button")));
            AutomationSugar.WaitForAjaxCompletion();
        }
示例#9
0
            public void ClickEditAddress()
            {
                AutomationSugar.WaitFor("Action_Dropdown");
                AutomationSugar.ClickOn("Action_Dropdown");
                AutomationSugar.WaitForAjaxCompletion();

                AutomationSugar.WaitFor("Edit_Address_Action");
                AutomationSugar.ClickOn("Edit_Address_Action");
                AutomationSugar.WaitForAjaxCompletion();
            }
示例#10
0
        public static PupilContactPage LoadPupilContactDetail(Guid pupilContactId)
        {
            var    jsExecutor = (IJavaScriptExecutor)SeSugar.Environment.WebContext.WebDriver;
            string js         = "sims_commander.OpenDetail(undefined, '/{0}/Pupils/SIMS8LearnerContactMaintenanceSimpleLearnerContact/ReadDetail/{1}')";

            Retry.Do(() => { jsExecutor.ExecuteScript(string.Format(js, TestSettings.TestDefaults.Default.Path, pupilContactId)); });

            AutomationSugar.WaitForAjaxCompletion();

            return(new PupilContactPage());
        }
示例#11
0
        public static StaffRecordPage LoadStaffDetail(Guid staffId)
        {
            var    jsExecutor = (IJavaScriptExecutor)SeSugar.Environment.WebContext.WebDriver;
            string js         = "sims_commander.OpenDetail(undefined, '/{0}/Staff/SIMS8StaffMaintenanceTripleStaff/ReadDetail/{1}')";

            Retry.Do(() => { jsExecutor.ExecuteScript(string.Format(js, TestSettings.TestDefaults.Default.Path, staffId)); });

            AutomationSugar.WaitForAjaxCompletion();

            return(new StaffRecordPage());
        }
示例#12
0
        public MarsksheetPupilDetail PupilLink()
        {
            Thread.Sleep(1000);
            WaitUntilDisplayed(_pupilAdditionalDetailSelector);
            waiter.Until(ExpectedConditions.ElementToBeClickable(_pupilAdditionalDetailSelector));
            IWebElement pupilDetailButton = WebContext.WebDriver.FindElement(_pupilAdditionalDetailSelector);

            WaitForAndClick(new TimeSpan(0, 0, 20), By.CssSelector("[data-automation-id='pupil_additional_details']"));
            AutomationSugar.WaitForAjaxCompletion();
            return(this);
        }
示例#13
0
        public MarsksheetPupilDetail(SeleniumHelper.iSIMSUserType userType = SeleniumHelper.iSIMSUserType.TestUser)
        {
            WebContext.WebDriver.Manage().Window.Maximize();
            PageFactory.InitElements(WebContext.WebDriver, this);

            SeleniumHelper.Login(userType);

            AutomationSugar.WaitForAjaxCompletion();

            //SeleniumHelper.NavigateMenu("Tasks", "Assessment", "Marksheets");
            CommonFunctions.GotToMarksheetMenu();
        }
示例#14
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());
        }
示例#15
0
 public bool IsDateOfAdmissionWarningMessageDisplayed()
 {
     try
     {
         AutomationSugar.WaitForAjaxCompletion();
         return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_error")));
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#16
0
        /// <summary>
        /// Navigates to the page using the side menu
        /// </summary>
        /// <param name="topLevel">e.g.: Tasks or Lookups</param>
        /// <param name="category">e.g.: Pupils</param>
        /// <param name="item">e.g: Service Terms</param>
        public static void NavigateMenu(string topLevel, string category, string item)
        {
            var jsExecutor = (IJavaScriptExecutor)Environment.WebContext.WebDriver;

            var topLevelFilter = CreateJsFilter("h2", topLevel);
            var categoryFilter = CreateJsFilter("[data-accordian-panel-header-title]", category);
            var itemFilter     = CreateJsFilter("a", item);

            var menuUrlJsFormat    = $"$('#task-menu').{topLevelFilter}.next().{categoryFilter}.closest('.panel-heading').next().{itemFilter}.data('ajaxUrl')";
            var navigationJsFormat = $"sims_commander.OpenPage('#task-menu',{menuUrlJsFormat}, '')";

            Retry.Do(() => { jsExecutor.ExecuteScript(navigationJsFormat); });

            AutomationSugar.WaitForAjaxCompletion();
        }
示例#17
0
        public void PupilConduct_AddNewConduct()
        {
            //Arrange
            //Arrange
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.TestUser, enabledFeatures: BehaviourEventsFeature);
            Wait.WaitForDocumentReady();

            // Navigate to Pupil Record
            AutomationSugar.NavigateMenu("Tasks", "Pupil Conduct", "Behaviour Events");
            Thread.Sleep(5);
            AutomationSugar.WaitFor("add_button");
            AutomationSugar.ClickOn("add_button");
            AutomationSugar.WaitForAjaxCompletion();

            // Verify data is saved Success
            Assert.AreEqual(true, CheckNewFormIsShown(), "Success behaviour form is display");
        }
示例#18
0
 /// <summary>
 /// Navigates to Class Log page from Pupil Menu.
 /// </summary>
 public void NavigateToPupilClassLogFromQuickLink()
 {
     SeleniumHelper.FindAndClick(By.CssSelector(SeleniumHelper.AutomationId("quicklinks_top_level_pupil_submenu_classlog")));
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#19
0
 public CensusPage OKButton()
 {
     _okButton.Click();
     AutomationSugar.WaitForAjaxCompletion();
     return(new CensusPage());
 }
示例#20
0
 public void ClickEdit()
 {
     _editButton.ClickByJS();
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#21
0
 public void ClickDelete()
 {
     _deleteButton.ClickByJS();
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#22
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();
 }
示例#23
0
 public bool IsSuccessMessageDisplay()
 {
     AutomationSugar.WaitForAjaxCompletion();
     return(SeleniumHelper.IsElementExists(SimsBy.AutomationId("status_success")));
 }
示例#24
0
        public void ClassTeacherPupilAddressDetailsAccess(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string[] currentAddress)
        {
            #region Data Preparation

            DateTime dobSetup             = Convert.ToDateTime(dateOfBirth);
            DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission);

            var learnerIdSetup   = Guid.NewGuid();
            var BuildPupilRecord = this.BuildDataPackage();
            #endregion

            BuildPupilRecord.AddBasicLearner(learnerIdSetup, surnameSetup, forenameSetup, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C");
            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord);

            //Address Add
            #region
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            SharedComponents.HomePages.TaskMenuBar menu = new SharedComponents.HomePages.TaskMenuBar();
            menu.WaitForTaskMenuBarButton();
            AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records");
            AutomationSugar.WaitForAjaxCompletion();

            var pupilRecords = new PupilRecordTriplet();
            pupilRecords.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup);
            pupilRecords.SearchCriteria.IsCurrent = true;
            var pupilSearchResults = pupilRecords.SearchCriteria.Search();
            AutomationSugar.WaitForAjaxCompletion();

            // This sometimes takes an eternity
            PupilRecordTriplet.PupilRecordSearchResultTile pupilTile = null;
            for (var cnt = 0; cnt < 10; cnt++)
            {
                Thread.Sleep(5000);
                pupilTile =
                    pupilSearchResults.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surnameSetup, forenameSetup)));
                if (pupilTile != null)
                {
                    break;
                }
            }
            var pupilRecord = pupilTile.Click <PupilRecordPage>();
            AutomationSugar.WaitForAjaxCompletion();
            pupilRecord.SelectAddressesTab();

            var addAddress = pupilRecord.ClickAddAddress();
            addAddress.ClickManualAddAddress();
            addAddress.BuildingNo      = currentAddress[0];
            addAddress.BuildingName    = currentAddress[1];
            addAddress.Flat            = currentAddress[2];
            addAddress.Street          = currentAddress[3];
            addAddress.District        = currentAddress[4];
            addAddress.City            = currentAddress[5];
            addAddress.County          = currentAddress[6];
            addAddress.PostCode        = currentAddress[7];
            addAddress.CountryPostCode = currentAddress[8];
            addAddress.ClickOk(5);

            //Save
            pupilRecord.SavePupil();
            AutomationSugar.WaitForAjaxCompletion();
            #endregion

            POM.Helper.SeleniumHelper.Logout();


            Assert.IsTrue(QuickControlAccess.canViewPupilAddressDetails(SeleniumHelper.iSIMSUserType.ClassTeacher, surnameSetup));
        }
示例#25
0
 public void ClickSave()
 {
     _saveButton.ClickByJS();
     AutomationSugar.WaitForAjaxCompletion();
     Refresh();
 }
示例#26
0
 public void ClickApplyFollowUp()
 {
     _addFollowUpButton.ClickByJS();
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#27
0
        public void DisplayPupilAddressDetails(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string[] currentAddress)
        {
            #region Data Preparation
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();
            taskMenuInstance.WaitForTaskMenuBarButton();
            DateTime dobSetup             = Convert.ToDateTime(dateOfBirth);
            DateTime dateOfAdmissionSetup = Convert.ToDateTime(DateOfAdmission);

            var learnerIdSetup   = Guid.NewGuid();
            var BuildPupilRecord = this.BuildDataPackage();
            #endregion

            BuildPupilRecord.AddBasicLearner(learnerIdSetup, surnameSetup, forenameSetup, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C");
            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord);

            //Address Add
            #region

            AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records");
            AutomationSugar.WaitForAjaxCompletion();

            var pupilRecordTriplet = new PupilRecordTriplet();

            pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup);
            pupilRecordTriplet.SearchCriteria.Search();

            POM.Helper.SeleniumHelper.Sleep(2);
            pupilRecordTriplet.SearchCriteria.PupilName = "";
            pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", surnameSetup, forenameSetup);
            pupilRecordTriplet.SearchCriteria.Search();

            var resultPupils = pupilRecordTriplet.SearchCriteria.Search();
            int count        = resultPupils.Count();
            if (count == 1)
            {
                var pupilSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surnameSetup, forenameSetup)));
                var pupilRecord     = pupilSearchTile == null ? null : pupilSearchTile.Click <PupilRecordPage>();
                // pupilSearchTile.Click<PupilRecordPage>();
                //    Thread.Sleep(1000);
                //    Assert.AreNotEqual(null, pupilRecord, "Did not find pupil");

                // AutomationSugar.WaitForAjaxCompletion();


                pupilRecord.SelectAddressesTab();

                var addAddress = pupilRecord.ClickAddAddress();
                addAddress.ClickManualAddAddress();
                addAddress.BuildingNo      = currentAddress[0];
                addAddress.BuildingName    = currentAddress[1];
                addAddress.Flat            = currentAddress[2];
                addAddress.Street          = currentAddress[3];
                addAddress.District        = currentAddress[4];
                addAddress.City            = currentAddress[5];
                addAddress.County          = currentAddress[6];
                addAddress.PostCode        = currentAddress[7];
                addAddress.CountryPostCode = currentAddress[8];
                addAddress.ClickOk(5);

                //Save
                pupilRecord.SavePupil();
            }
            else
            {
                throw new Exception();
            }
            AutomationSugar.WaitForAjaxCompletion();
            #endregion

            AddressBookSearchPage searchBox = new AddressBookSearchPage();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(forenameSetup);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            POM.Helper.SeleniumHelper.Sleep(2);
            Assert.IsTrue(popup.IsAddressDisplayed());
        }
示例#28
0
 public void ClickAddAddress()
 {
     AutomationSugar.WaitFor("add_an_address_button");
     AutomationSugar.ClickOn("add_an_address_button");
     AutomationSugar.WaitForAjaxCompletion();
 }
示例#29
0
        public void VerifyFloodFill_Of_MarksAndCommentsSection(string registerdate, string YearGroup, string pupilForeName, string pupilSurName,
                                                               string gender, string dateOfBirth, string DateOfAdmission, string pupilName)
        {
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            AutomationSugar.NavigateMenu("Tasks", "Attendance", "Edit Marks");

            var editmarksTriplet = new EditMarksTriplet();

            editmarksTriplet.SearchCriteria.StartDate = registerdate;
            editmarksTriplet.SearchCriteria.Week      = true;
            editmarksTriplet.SearchCriteria.SelectYearGroup(YearGroup);
            var editmarkPage = editmarksTriplet.SearchCriteria.Search <EditMarksPage>();

            editmarkPage.ModePreserve = false;
            var editmarkTable = editmarkPage.Marks;
            IEnumerable <SchoolAttendanceCode> getANRs = Queries.GetAttendanceNotRequiredCodes();
            List <string> codes = getANRs.Select(x => x.Code).ToList <string>();

            if (codes.Contains(editmarkTable[1][2].Text))
            {
                Console.WriteLine("Marks can't be overwritten on Holidays");
                return;
            }
            // FloodFill data
            var markGridColumns = editmarkPage.Marks.Columns;

            markGridColumns[2].TimeIndicatorSelected = "AM";
            editmarkPage.CodeList = "L";
            editmarkPage.ClickSave();

            AutomationSugar.NavigateMenu("Tasks", "Attendance", "Deal with Specific Marks");
            AutomationSugar.WaitForAjaxCompletion();
            DealWithSpecifcMarksTriplet dealwithspecificmarktriplet = new DealWithSpecifcMarksTriplet();

            dealwithspecificmarktriplet.SearchCriteria.SelectDateRange = "Last 7 days";
            dealwithspecificmarktriplet.SearchCriteria.SelectMark      = "L";
            dealwithspecificmarktriplet.SearchCriteria.SelectYearGroup(YearGroup);
            var dealwithpage = dealwithspecificmarktriplet.SearchCriteria.Search <DealWithSpecificMarkPage>();

            var dealwithTable = dealwithpage.DealWithSpecificMarkTable;

            var dealGridColumns = dealwithpage.DealWithSpecificMarkTable.Columns;

            //Apply Floodfill on Mark Column
            dealwithTable.Columns[3].Select();
            dealwithTable.Columns[3].ClickDownArrow();
            dealwithTable.FloodFillMarks = "N";
            dealwithTable.OverrideMarks  = true;
            dealwithTable.ApplySelectedModeOfMarks();

            //Apply Floodfill on Comments Column
            dealwithTable.Columns[5].Select();
            dealwithTable.Columns[5].ClickDownArrow();
            dealwithTable.FloodFillComments = SeleniumHelper.GenerateRandomString(20);
            dealwithTable.OverrideComments  = true;
            dealwithTable.ApplySelectedModeOfComments();

            dealwithTable.ClickSave();

            Assert.IsTrue(AutomationSugar.SuccessMessagePresent(dealwithpage.ComponentIdentifier));
        }
示例#30
0
 public void SelectAddressesTab()
 {
     AutomationSugar.ExpandAccordionPanel("section_menu_Addresses");
     AutomationSugar.WaitForAjaxCompletion();
 }