Exemplo n.º 1
0
        public void SearchCurrentPupilByName(string textForSearch)
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

            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, "Forename_TestData_Pupil" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01));

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


            #endregion

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.EnterSearchTextForPupilContacts(textForSearch);
            double millisecs = searchBox.SearchTimeInMillisecs;
            searchBox.Log("Results fetched in " + millisecs + " milliseconds");
            Assert.Less(millisecs, AddressBookConstants.MaxAcceptableSearchTimeInMillisecs);
        }
Exemplo n.º 2
0
        public void LinkToPupilRecordFromPupilInfo()
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

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

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


            #endregion

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(pupilForename);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            popup.ClickPupilDetailsLink();
            bool value = SeleniumHelper.Get(AddressBookElements.OpenedPupilRecordTab).Displayed;
            Assert.IsTrue(value);
        }
Exemplo n.º 3
0
        public void DisplayCurrentPupilImage()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils("ad");
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();

            Assert.IsTrue(popup.IsPupilImageDisplayed());
        }
Exemplo n.º 4
0
        public void DynamicallyDisplayHideResultSection()  //For no results
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.textSearch.SendKeys(invalidtextForSearch);
            searchBox.waitForPupilResultstoAppear();
            String NoResultElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text;

            Assert.True(NoResultElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found text didn't appear"); //Assertion for title if records are not found
        }
Exemplo n.º 5
0
        public void DisplayPupilResultsClassYearGroupDetails()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(textForSearch);
            searchBox.ClickOnFirstPupilRecord();
            Assert.IsTrue(searchBox.GetClassYear());
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Exemplo n.º 6
0
        public void CheckResultCountForNonExistingPupils() //For invalid pupils
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

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

            Assert.That(resultCount == 0);
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Exemplo n.º 7
0
        public void CheckResultCountForNonExistingStaff() //For invalid staff
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.textSearch.SendKeys(InvalidtextForSearch);
            int resultCount = searchBox.CheckForStaffAvailability(InvalidtextForSearch);

            Assert.That(resultCount == 0);
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Exemplo n.º 8
0
        public void DisplayStaffEmailDetails()
        {
            #region Arrange
            var staffId   = Guid.NewGuid();
            var forename  = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_Email");
            var surname   = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_Email");
            var startDate = DateTime.Today.AddDays(-1);

            var       staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate);
            DataSetup DataSetStaff    = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData);

            #endregion


            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.PersonnelOfficer);
            AutomationSugar.NavigateMenu("Tasks", "Staff", "Staff Records");
            POM.Helper.Wait.WaitLoading();
            var staffContactTriplet = new StaffRecordTriplet();
            staffContactTriplet.SearchCriteria.StaffName = String.Format("{0}, {1}", surname, forename);
            //staffContactTriplet.SearchCriteria.Search();
            //staffContactTriplet.SearchCriteria.Search();
            var resultPupils = staffContactTriplet.SearchCriteria.Search();
            int count        = resultPupils.Count();
            if (count == 1)
            {
                var staffSearchTile = resultPupils.FirstOrDefault(t => t.Name.Equals(String.Format("{0}, {1}", surname, forename)));
                var staffRecord     = staffSearchTile == null ? null : staffSearchTile.Click <StaffRecordPage>();
                staffSearchTile.Click <StaffRecordPage>();
            }


            string emailId = "*****@*****.**";

            //   Wait.WaitUntilDisplayed(By.CssSelector("[data-maintenance-container='LearnerContactTelephones']"));
            var Record = new StaffRecordPage();
            Record.SelectPhoneEmailTab();
            Record.ClickAddEmailId();
            Record.EmailTable[0].EmailAddress = emailId;
            staffContactTriplet.ClickSave();

            POM.Helper.SeleniumHelper.Logout();
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation(SeleniumHelper.iSIMSUserType.PersonnelOfficer);
            searchBox.ClearText();
            searchBox.EnterSearchTextForStaff(surname);
            searchBox.ClickOnFirstStaffRecord();
            AddressBookPopup popup = new AddressBookPopup();
            popup.GetStaffBasicDetails();
            Assert.IsTrue(popup.IsEmailDisplayed());
        }
Exemplo n.º 9
0
        public void IdentifyResultForLeaver() //For invalid pupils
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(leaverPupil);
            int    resultCount        = searchBox.CheckForResultsAvailability(leaverPupil);
            String NoElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text;

            Assert.True(NoElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found diddn't appear"); //Assertion for title if records are not found
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Exemplo n.º 10
0
        public void IdentifySectionHeaderForNoResultsFound() //For invalid staff
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.textSearch.SendKeys(InvalidtextForSearch);
            searchBox.waitForPupilResultstoAppear();
            int    resultCount        = searchBox.CheckForStaffAvailability(InvalidtextForSearch);
            String NoElementtileTitle = SeleniumHelper.Get("result_tile_scroll").Text;

            Assert.True(NoElementtileTitle == AddressBookConstants.TitleForNoResultsfound, "No results found text didn't appear"); //Assertion for title if records are not found
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Exemplo n.º 11
0
        public void DisplayPupilContactBasicDetails()
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

            AutomationSugar.Log("Data Creation started");
            Guid        pupilId       = Guid.NewGuid();
            DataPackage dataPackage   = this.BuildDataPackage();
            var         pupilSurname  = Utilities.GenerateRandomString(10, "CurrentPUPIL");
            var         pupilForename = Utilities.GenerateRandomString(10, "CurrentPUPIL" + 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, "PupilContact_WithBasicDetails" + Thread.CurrentThread.ManagedThreadId);
            var contactForename1 = Utilities.GenerateRandomString(10, "PupilContact_WithBasicDetails" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddPupilContact(pupilContactId1, contactSurname1, contactForename1);
            dataPackage.AddPupilContactRelationship(pupilContactRelationshipId1, pupilId, pupilContactId1);
            #endregion


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


            #endregion


            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupilContacts(contactForename1);
            searchBox.ClickOnFirstPupilContactRecord();
            AddressBookPopup popup = new AddressBookPopup();
            Assert.IsNotNull(AddressBookElements.DisplayPopup);
            Assert.IsTrue(popup.GetPupilContactBasicDetails());
        }
Exemplo n.º 12
0
        public void SearchCurrentStaffByName(string textForSearch)
        {
            #region Arrange
            var staffId   = Guid.NewGuid();
            var forename  = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook");
            var surname   = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook");
            var startDate = DateTime.Today.AddDays(-1);

            var       staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate);
            DataSetup DataSetStaff    = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData);

            #endregion

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForStaff(textForSearch);
            double millisecs = searchBox.SearchTimeInMillisecs;
            searchBox.Log("Results fetched in " + millisecs + " milliseconds");
            Assert.Less(millisecs, AddressBookConstants.MaxAcceptableSearchTimeInMillisecs);
        }
Exemplo n.º 13
0
        public void DisplayStaffBasicDetails(string textForSearch)
        {
            #region Arrange
            var staffId   = Guid.NewGuid();
            var forename  = SeSugar.Utilities.GenerateRandomString(10, "Sheila");
            var surname   = SeSugar.Utilities.GenerateRandomString(10, "Fortune");
            var startDate = DateTime.Today.AddDays(-1);

            var       staffRecordData = StaffRecordPage.CreateStaffRecord(out staffId, forename, surname, startDate);
            DataSetup DataSetStaff    = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: staffRecordData);

            #endregion


            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForStaff(textForSearch);
            AddressBookPopup popup = searchBox.ClickOnFirstStaffRecord();
            Assert.IsTrue(popup.GetStaffBasicDetails());
        }
Exemplo n.º 14
0
        public void DisplayPupilBasicDetails(string forenameSetup, string surnameSetup, string gender, string dateOfBirth, string DateOfAdmission, string yearGroup)
        {
            #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);

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(surnameSetup);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            Assert.IsTrue(popup.GetPupilBasicDetails());
        }
Exemplo n.º 15
0
        public void KeyUpNavigationOnPupilResults()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            SearchResultTile      srt       = searchBox.EnterSearchTextForPupils(textForSearch);
            int     resultCount             = srt.tileCount();
            Actions action = new Actions(WebContext.WebDriver);

            action.SendKeys(Keys.Tab).Perform();
            action.SendKeys(Keys.Tab).Perform();
            for (var index = 0; index < resultCount; index++)
            {
                action.SendKeys(OpenQA.Selenium.Keys.Down).Perform();
            }

            for (var i = resultCount - 2; i >= 0; i--)
            {
                action.SendKeys(OpenQA.Selenium.Keys.Up).Perform();
                String classNameForStrongTags = srt.getClassForStrongname(i);
                Assert.That(classNameForStrongTags.Contains("tt-selectable"));
            }
        }
Exemplo n.º 16
0
        public void DisplayPupilContactAssociatedToPupilDetails()
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

            AutomationSugar.Log("Data Creation started");
            Guid        pupilId       = Guid.NewGuid();
            DataPackage dataPackage   = this.BuildDataPackage();
            var         pupilSurname  = Utilities.GenerateRandomString(10, "Communications_Surname");
            var         pupilForename = Utilities.GenerateRandomString(10, "Communications_Forename" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 01, 01), new DateTime(2012, 09, 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, "SeleniumPupilContact1_Surname" + Thread.CurrentThread.ManagedThreadId);
            var contactForename1 = Utilities.GenerateRandomString(10, "SeleniumPupilContact1_Forename" + Thread.CurrentThread.ManagedThreadId);
            var titleContact1    = "Mrs";
            dataPackage.AddPupilContact(pupilContactId1, contactSurname1, contactForename1);
            dataPackage.AddPupilContactRelationship(pupilContactRelationshipId1, pupilId, pupilContactId1);
            #endregion


            #endregion

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

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(pupilForename);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            Assert.Greater(popup.HaveAssociatedPupil(), 1);
        }
Exemplo n.º 17
0
        public void DisplayPupilBasicDetailsOnEnter()
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

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

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

            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils("PupilEnterKey_Test");
            searchBox.HitEnteronFirstPupilRecord();
            AddressBookPopup popup = new AddressBookPopup();
            popup.WaitForDialogToAppear();
            Assert.IsTrue(popup.GetPupilBasicDetails());
        }