Ejemplo n.º 1
0
        public void PromptToSaveChangesOnNavigationToOtherScreen()
        {
            #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, "LinkForPupil2");
            var         pupilForename = Utilities.GenerateRandomString(10, "LinkForPupil2" + 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

            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            NavigateToOtherScreen.GoToRoomScreen();
            RoomPage SchoolRoomPage = new RoomPage();
            SchoolRoomPage.CreateSchoolRoom();
            SchoolRoomPage.EnterShortName("Rm60");
            AddressBookSearchPage searchBox = new AddressBookSearchPage();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(pupilForename);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            popup.ClickPupilDetailsLink();
            popup.WaitForConfirmationDialogToAppear();
            WebContext.Screenshot();
            bool DialogDisplayed = SeleniumHelper.Get("save_continue_commit_dialog").Displayed;
            Assert.IsTrue(DialogDisplayed, "Failure to popup confirmation Dialog");
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public static bool KeyDownNavigationOnPupilResults(SeleniumHelper.iSIMSUserType user)
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(user);
            SearchResultTile      srt       = searchBox.EnterSearchTextForPupils("ad");
            int     resultCount             = srt.tileCount();
            bool    traversed = false;
            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();
                String classNameForStrongTags = srt.getClassForStrongname(index);
                if (classNameForStrongTags.Contains("tt-selectable"))
                {
                    traversed = true;
                }
                else
                {
                    return(false);
                }
            }
            return(traversed);
        }
Ejemplo n.º 6
0
        public void AddNewManualCommunicationLog()
        {
            String[] featureList = { "CommunicationLogs" };
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, featureList);

            AddressBookSearchPage searchBox = new AddressBookSearchPage();

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

            popup.ClickCommunicationLogLink();
            Wait.WaitForDocumentReady();
            CommunicationLogDetail log       = new CommunicationLogDetail();
            AddLogDialog           logDialog = log.AddNewCommunicationLog();

            logDialog.SetMessageFormatType();
            SeleniumHelper.Sleep(2);
            logDialog.SetCategory();

            logDialog.Date        = DateTime.Now.ToShortDateString();
            logDialog.Description = "Test description";

            logDialog.Refresh();
            logDialog.Save();
        }
Ejemplo n.º 7
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();
            }
        }
Ejemplo n.º 8
0
        public static bool CanTabToQuickSearchOnChrome(SeleniumHelper.iSIMSUserType userType)
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationOnTabChrome(userType);

            searchBox.ClearText();
            searchBox.textSearch.SendKeys("ad");
            string value = SeleniumHelper.Get(AddressBookElements.LinkAddressBook).GetAttribute("aria-expanded");

            return(value == "true");
        }
Ejemplo n.º 9
0
        public void SysMgrCanNotAccessCurrentPupilAddress()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger);

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

            Assert.IsFalse(popup.IsAddressDisplayed());
        }
Ejemplo n.º 10
0
        public void SysMgrCanAccessCurrentPupil_DOB_Name()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger);

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

            Assert.IsTrue(popup.GetPupilBasicDetailsNameDOB());
        }
Ejemplo n.º 11
0
        public void SysMgrCanNotAccessPupilGenderDetails()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.SystemManger);

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

            Assert.IsTrue(popup.CheckPupilGenderDetailsForBlank());
        }
Ejemplo n.º 12
0
        public static bool isQuickControlAccess(SeleniumHelper.iSIMSUserType userType)
        {
            SeleniumHelper.Login(userType);
            TaskMenuBar taskMenuInstance = new TaskMenuBar();

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

            return(searchBox.textSearch.Displayed);
        }
Ejemplo n.º 13
0
        public void DisplayCurrentPupilImage()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

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

            Assert.IsTrue(popup.IsPupilImageDisplayed());
        }
Ejemplo n.º 14
0
        public void CannotAccessCurrentPupilImage()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(SeleniumHelper.iSIMSUserType.ReturnsManager);

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

            Assert.IsFalse(popup.IsPupilImageDisplayed());
        }
Ejemplo n.º 15
0
        public static bool canViewBasicDetailsCurrentPupil(SeleniumHelper.iSIMSUserType userType, string textForSearch)
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationByUserType(userType);

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

            WebContext.Screenshot();
            return(popup.GetPupilBasicDetails());
        }
Ejemplo n.º 16
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
        }
Ejemplo n.º 17
0
        public void DisplayStaffAddressDetails(string buildingNo, string street, string district, string city,
                                               string postCode, string countryPostCode, string language, string placeOfWork,
                                               string jobTitle, string occupation, string priority, string relationship)
        {
            #region Arrange
            var staffId   = Guid.NewGuid();
            var forename  = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_address");
            var surname   = SeSugar.Utilities.GenerateRandomString(10, "Staff_AddressBook_address");
            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>();


                staffRecord.SelectAddressesTab();
                var addAddressDialog = staffRecord.ClickAddAddress();
                addAddressDialog.ClickManualAddAddress();
                // Add new address
                addAddressDialog.BuildingNo      = buildingNo;
                addAddressDialog.Street          = street;
                addAddressDialog.District        = district;
                addAddressDialog.City            = city;
                addAddressDialog.PostCode        = postCode;
                addAddressDialog.CountryPostCode = countryPostCode;
                addAddressDialog.ClickOk();
                AutomationSugar.Log("Created a new address to the staff record");
                staffContactTriplet.ClickSave();
            }

            AddressBookSearchPage searchBox = new AddressBookSearchPage();
            searchBox.ClearText();
            searchBox.EnterSearchTextForStaff(surname);
            searchBox.ClickOnFirstStaffRecord();
            AddressBookPopup popup = new AddressBookPopup();
            popup.GetStaffBasicDetails();
            Assert.IsTrue(popup.IsAddressDisplayed());
        }
Ejemplo n.º 18
0
        public void DisplayPupilResultsClassYearGroupDetails()
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigation();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(textForSearch);
            searchBox.ClickOnFirstPupilRecord();
            Assert.IsTrue(searchBox.GetClassYear());
            if (true)
            {
                WebContext.Screenshot();
            }
        }
Ejemplo n.º 19
0
        //Returns true if popup is shown else false
        public static bool MinimumCharacterRequiredToGetResult(SeleniumHelper.iSIMSUserType userType, string charToSearch)
        {
            AddressBookSearchPage searchBox = QuickSearch.QuickSearchNavigationOnTab(userType);

            searchBox.ClearText();
            searchBox.textSearch.SendKeys(charToSearch);

            bool value = SeleniumHelper.Get(AddressBookElements.PlaceHolderForResults).Displayed;

            System.Threading.Thread.Sleep(500);
            SeleniumHelper.Get(AddressBookElements.HomeScreen).Click();
            return(value);
        }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
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();
            }
        }
Ejemplo n.º 22
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();
            }
        }
Ejemplo n.º 23
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());
        }
Ejemplo n.º 24
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();
            }
        }
Ejemplo n.º 25
0
        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());
        }
Ejemplo n.º 26
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();
            }
        }
Ejemplo n.º 27
0
 public void CheckStaffResultsOrder()
 {
     #region Arrange
     var       staffId         = Guid.NewGuid();
     var       forename        = SeSugar.Utilities.GenerateRandomString(10, "ResultOrder_Staff");
     var       surname         = SeSugar.Utilities.GenerateRandomString(10, "ResultOrder_Staff");
     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.SchoolAdministrator);
     AddressBookSearchPage searchBox = new AddressBookSearchPage();
     searchBox.ClearText();
     searchBox.EnterSearchTextForStaff(surname);
     var selectedElements = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("search_result_tile_Staff")));
     Assert.IsTrue(selectedElements.Text.Contains("resultorder_staff"));
 }
Ejemplo n.º 28
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());
        }
Ejemplo n.º 29
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);
        }
Ejemplo n.º 30
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());
        }