Exemple #1
0
        public void CheckPupilResultsOrder(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup)
        {
            #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);

            AddressBookSearchPage searchBox = new AddressBookSearchPage();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(surnameSetup);
            POM.Helper.SeleniumHelper.Sleep(2);
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(surnameSetup);
            var selectedElements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("PreferredListName_Learner")));
            Assert.That(selectedElements[0].Text.Contains(forenameSetup));
        }
Exemple #2
0
        public static AddressBookSearchPage QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType userType)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            return(new AddressBookSearchPage());
        }
Exemple #3
0
        public static AddressBookSearchPage QuickSearchNavigation()
        {
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            return(new AddressBookSearchPage());
        }
Exemple #4
0
        public static bool TestAddressBookLinkPresence(SeleniumHelper.iSIMSUserType userType)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            return(ElementRetriever.IsExist(SeleniumHelper.Get(AddressBookElements.TextSearch)));
        }
Exemple #5
0
        public void DisplayPupilTelephoneDetails(string pupilSurName, string pupilForeName, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup, string telNo, string email)
        {
            #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();
            BuildPupilRecord.AddBasicLearner(learnerIdSetup, pupilSurName, pupilForeName, dobSetup, dateOfAdmissionSetup, genderCode: "1", enrolStatus: "C");
            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: BuildPupilRecord);

            AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records");
            var pupilRecordTriplet = new PupilRecordTriplet();
            pupilRecordTriplet.SearchCriteria.PupilName = String.Format("{0}, {1}", pupilSurName, pupilForeName);
            POM.Helper.SeleniumHelper.Sleep(4);
            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}", pupilSurName, pupilForeName)));
                var pupilRecord     = pupilSearchTile == null ? null : pupilSearchTile.Click <PupilRecordPage>();
                pupilSearchTile.Click <PupilRecordPage>();
                //    Thread.Sleep(1000);
                //    Assert.AreNotEqual(null, pupilRecord, "Did not find pupil");

                // Add Pupil Telephone number
                pupilRecord.SelectPhoneEmailTab();
                pupilRecord = new PupilRecordPage();
                pupilRecord.ClickAddTelephoneNumber();
                pupilRecord.TelephoneNumberTable[0].TelephoneNumber = telNo;

                // Add Email Address
                pupilRecord.ClickAddEmailAddress();
                pupilRecord.EmailTable[0].EmailAddress = email;

                pupilRecord = PupilRecordPage.Create();
                pupilRecord.SavePupil();

                //Assert
                //    Assert.AreEqual(true, pupilRecord.IsSuccessMessageDisplayed(), "Success message is not display");
                #endregion

                AddressBookSearchPage searchBox = new AddressBookSearchPage();
                searchBox.ClearText();
                searchBox.EnterSearchTextForPupils(pupilSurName);
                AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
                Assert.IsTrue(popup.IsPupilTelephoneDisplayed());
            }
            else
            {
                throw new Exception();
            }
        }
        public static bool isQuickControlAccess(SeleniumHelper.iSIMSUserType userType)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            AddressBookSearchPage searchBox = new AddressBookSearchPage();

            return(searchBox.textSearch.Displayed);
        }
Exemple #7
0
        public static AddressBookSearchPage QuickSearchNavigationOnTabChrome(SeleniumHelper.iSIMSUserType userType)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            Actions action = new Actions(WebContext.WebDriver);

            action.SendKeys(OpenQA.Selenium.Keys.Tab).Perform();
            action.SendKeys(OpenQA.Selenium.Keys.Tab).Perform();
            //     action.SendKeys(OpenQA.Selenium.Keys.Tab).Perform();
            //    action.SendKeys(OpenQA.Selenium.Keys.Enter).Perform();
            return(new AddressBookSearchPage());
        }
        public static int hasPermissionToSearchCurrentPupil(SeleniumHelper.iSIMSUserType userType, string textForSearch)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            AddressBookSearchPage searchBox = new AddressBookSearchPage();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(textForSearch);
            int resultCount = searchBox.CheckForResultsAvailability(textForSearch);

            return(resultCount);
        }
        public static bool canViewPupilEmailDetails(SeleniumHelper.iSIMSUserType userType, string textForSearch)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

            taskMenuInstance.WaitForTaskMenuBarButton();
            AddressBookSearchPage searchBox = new AddressBookSearchPage();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(textForSearch);
            searchBox.ClickOnFirstPupilRecord();
            AddressBookPopup popup = new AddressBookPopup();

            popup.WaitForDialogToAppear();
            return(popup.IsEmailDisplayed());
        }
Exemple #10
0
        public void RMCanAccessCurrentPupilAddress(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);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();
            taskMenuInstance.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();

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.ReturnsManager);
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(surnameSetup);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            Assert.IsTrue(popup.IsAddressDisplayed());
        }
        public void DisplayPupilContactTelephoneDetails(string dateOfBirth, string DateOfAdmission, string yearGroup, string telNo, string email)
        {
            #region Data Pupil contact Setup



            AutomationSugar.Log("Data Creation started");
            Guid        pupilId       = Guid.NewGuid();
            DataPackage dataPackage   = this.BuildDataPackage();
            var         pupilSurname  = Utilities.GenerateRandomString(10, "TestData_Pupil");
            var         pupilForename = Utilities.GenerateRandomString(10, "TestData_Pupil" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01));

            #endregion

            #region Pre-Condition: Create new contact 1 and refer to pupil

            //Arrange
            AutomationSugar.Log("***Pre-Condition: Create new contact1 and refer to pupil");
            Guid pupilContactId1             = Guid.NewGuid();
            Guid pupilContactRelationshipId1 = Guid.NewGuid();
            //Add pupil contact
            var contactSurname1  = Utilities.GenerateRandomString(10, "Suvarna" + Thread.CurrentThread.ManagedThreadId);
            var contactForename1 = Utilities.GenerateRandomString(10, "Gill" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddPupilContact(pupilContactId1, contactSurname1, contactForename1);
            dataPackage.AddPupilContactRelationship(pupilContactRelationshipId1, pupilId, pupilContactId1);

            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage);
            #endregion

            #region Add email and Tel

            //  Create a new pupil, so that it can be attached later to the newly created contact1
            SharedComponents.Helpers.SeleniumHelper.Login(SharedComponents.Helpers.SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();
            taskMenuInstance.WaitForTaskMenuBarButton();
            AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Contacts");
            var pupilContactTriplet = new PupilContactTriplet();
            pupilContactTriplet.SearchCriteria.ContactName = String.Format("{0}, {1}", contactSurname1, contactForename1);
            Thread.Sleep(2);
            pupilContactTriplet.SearchCriteria.Search();
            pupilContactTriplet.SearchCriteria.Search();
            var resultPupils = pupilContactTriplet.SearchCriteria.Search();
            int count        = resultPupils.Count();
            if (count == 1)
            {
                var pupilcontactSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", contactSurname1, contactForename1)));
                var pupilcontactRecord     = pupilcontactSearchTile == null ? null : pupilcontactSearchTile.Click <PupilContactPage>();
                pupilcontactSearchTile.Click <PupilContactPage>();


                // Add Pupil Telephone number


                Wait.WaitUntilDisplayed(By.CssSelector("[data-maintenance-container='LearnerContactTelephones']"));
                pupilcontactRecord = new PupilContactPage();
                pupilcontactRecord.ClickAddTelephoneNumber();
                pupilcontactRecord.TelephoneNumberTable[0].TelephoneNumber = telNo;

                // Add Email Address
                pupilcontactRecord.ClickAddEmailAddress();
                pupilcontactRecord.EmailTable[0].EmailAddress = email;
                pupilContactTriplet.ClickSave();

                #endregion


                AddressBookSearchPage searchBox = new AddressBookSearchPage();
                searchBox.ClearText();
                searchBox.EnterSearchTextForPupilContacts(contactForename1);
                searchBox.ClickOnFirstPupilContactRecord();
                AddressBookPopup popup = new AddressBookPopup();
                popup.GetPupilContactBasicDetails();
                Assert.IsTrue(popup.IsPupilTelephoneDisplayed());
            }
            else
            {
                throw new Exception();
            }
        }
Exemple #12
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());
        }