예제 #1
0
        public void Manage_MultyProgram_CurriculumAssignmentFlow()
        {
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string ProgramName           = GCEP.ReturnValueAfterSelectingProgram(1);// GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1);
            int    firstProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  4.Clicking Curruculum template link and getting breadcrump text and verifying with program name
            CurriculumMngPage CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            //  var value = Browser.FindElement(Bys.AMAPage.BreadCrump).Text;
            string expectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(expectedFromCM.Contains(ProgramName.ToLower()));
            string breadCrumpAfterAssigment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(breadCrumpAfterAssigment.Contains(ProgramName.ToLower()));

            Thread.Sleep(2000);

            ///  5.Clicking to the the breadcrump with Program name and naviagting GCEP page
            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(ProgramName);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  6.Choosing second Program from  Dropdown and saving Program name and count of users for program
            string secondProgramName      = GCEP.ReturnValueAfterSelectingProgram(2); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2);
            int    secondProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  7.Clicking Curruculum template link and getting breadcrump text for second Porgram and verifying with Program name
            CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            string secondexpectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(secondexpectedFromCM.Contains(secondProgramName.ToLower()));
            string secondBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(secondBreadcrumpAfterAssignment.Contains(secondProgramName.ToLower()));

            Thread.Sleep(2000);

            ///  8.Cliking to the the breadcrump with  second Program name and naviagting GCEP page  and getting breadcrump text for third Porgram
            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(secondProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);
            string thirdProgramName      = GCEP.ReturnValueAfterSelectingProgram(3); //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3);
            int    thirdProgramUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Thread.Sleep(2000);
            ///  9.Clicking Curruculum template link and verifying with third Program name
            CM = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            string thirdexpectedFromCM = CM.GetBreadCrumbContainerText();

            Assert.IsTrue(thirdexpectedFromCM.Contains(thirdProgramName.ToLower()));
            string thirdBreadcrumpAfterAssignment = HelperMethods.CurriculumAssignmentFlow(browser, "new1111");

            Assert.True(thirdBreadcrumpAfterAssignment.Contains(thirdProgramName.ToLower()));

            Thread.Sleep(2000);

            GCEP = CM.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  10.Verifying each program has different count of users.
            Assert.False(DataUtils.intsEqual(firstProgramUserCount, secondProgramUserCount, thirdProgramUserCount));
        }
예제 #2
0
        public void MultyInstitution_CreatingCurriculum()
        {
            string curriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName = "Chrome2CurrName";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName = "FireFox2CurrName";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName = "IE2CurrName";
            }
            ///  1.Navigate to the login page login as a Admin witn below credentials
            LoginPage           LP = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED = LP.LoginAsUser("10016185", "password");

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }

            ///  2.click to GCEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Browser.WaitForElement(Bys.GCEPPage.InstitutionSelElem, ElementCriteria.IsEnabled);

            ///  3.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string InstitutionName           = GCEP.ReturnValueAfterSelectingInstitution(1);
            int    FirstInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Browser.WaitForElement(Bys.GCEPPage.UserManageLnk, TimeSpan.FromSeconds(90), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);

            ///  4.Clicking Curruculum template link creating curriculum with name depending on browser name
            CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTemp.Search(curriculumName);
            if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0)
            {
                CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn);
                HelperMethods.CurriculumCreationFlow(browser, curriculumName);
            }

            ///  5.Cliking to the the breadcrump with Institution name and naviagting GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(InstitutionName);

            ///  6.Choosing second Institution from  Dropdown and saving Institution name and count of users for Institution
            string secondInstutionName        = GCEP.ReturnValueAfterSelectingInstitution(2);
            int    SecondInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));

            ///  7.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  8. Verifiying curriculum not displayed for different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  9.Clicking breadcrump with second Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondInstutionName);

            ///  10.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for third Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string thirdInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(3);
            int    ThirdInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  11.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  12.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  13.Clicking breadcrump with third Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdInstitutionName);

            ///  14.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fourth Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string fourthInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(4);
            int    FourthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);

            ///  15.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  16.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  17.Clicking breadcrump with fourth Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fourthInstitutionName);

            ///  18.Verifiying breadcrump is the same as a Institution name saving Institution name and count of users for fifth Institution
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.InstitutionSelElem));
            string fifthInstitutionName      = GCEP.ReturnValueAfterSelectingInstitution(5);
            int    FifthInstitutionUserCount = Int32.Parse(GCEP.TotalUsersCountLnk.Text);


            ///  19.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  20.Verifiying curriculum not displayed for a different Institution
            Assert.True(CurTemp.NoRecordLabel.Displayed);


            ///  21.Clicking breadcrump with fifth Institution name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(fifthInstitutionName);

            ///  22. Choosing first Institution waiting for initialize page
            GCEP.InstitutionSelElem.SelectByText(InstitutionName);
            GCEP.WaitForInitialize();

            ///  23.Clicking Curruculum template link searching for curriculum what we create for first Institution
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  24. Deleting curriculum and verifying label is displayed
            CurTemp.DeleteCurriculum(curriculumName);
            Assert.IsTrue(CurTemp.NoRecordLabel.Displayed);

            ///  25.Verifying counts of user for each Institution not equal.
            Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, SecondInstitutionUserCount, ThirdInstitutionUserCount, FourthInstitutionUserCount, FifthInstitutionUserCount));
            //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount));
            //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, FirstInstitutionUserCount, SecondInstitutionUserCount));
            //Assert.False(DataUtils.intsEqual(FirstInstitutionUserCount));
            //Assert.True(DataUtils.intsEqual(FirstInstitutionUserCount, FirstInstitutionUserCount));
        }
예제 #3
0
        public void MultyProgram_CreatingCurriculum_Flow()
        {
            string curriculumName = "";

            if (BrowserName == BrowserNames.Chrome)
            {
                curriculumName = "Chrome3CurrName";
            }
            if (BrowserName == BrowserNames.Firefox)
            {
                curriculumName = "FireFox3CurrName";
            }
            if (BrowserName == BrowserNames.InternetExplorer)
            {
                curriculumName = "IE3CurrName";
            }
            ///  1.Navigate to the login page login as a Manager
            UserInfo            role = UserUtils.GetUser(UserRole.Manager);
            LoginPage           LP   = Navigation.GoToLoginPage(browser);
            EducationCenterPage ED   = LP.LoginAsUser(role.Username, role.Password);

            if (BrowserName == BrowserNames.Firefox)
            {
                Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, ElementCriteria.IsEnabled);
            }
            ///  2.click to CGEP link  navigate to Gcep page and waiting load icon disappear
            GCEPPage GCEP = ED.ClickToAdvance(ED.GcepLnk);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            /// 3.Verifiying breadcrump is the same as a Program name saving Program name
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string ProgramName = GCEP.ReturnValueAfterSelectingProgram(1);   // GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 1);

            ///  4.Clicking Curruculum template link creating curriculum searching for curriculum if its not exist then creating curriculum with name depending on browser name
            CurriculumMngPage CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);

            CurTemp.Search(curriculumName);
            if (Browser.FindElements(Bys.CurriculumMngPage.NoRecordLbl).Count > 0)
            {
                CurriculumCoursePage CurCoursPage = CurTemp.ClickToAdvance(CurTemp.CreateCurriculumTemplateBtn);
                HelperMethods.CurriculumCreationFlow(browser, curriculumName);
            }

            ///  5.Cliking to the the breadcrump with Program name and naviagting GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(ProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  6.Choosing second Program from  Dropdown and saving Institution name
            string secondProgramName = GCEP.ReturnValueAfterSelectingProgram(2);  //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 2);

            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed

            ///  7.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  8. Verifiying curriculum not displayed for different Program
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  9.Clicking breadcrump with second Program name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(secondProgramName);

            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  10.Verifiying breadcrump is the same as a Program name saving Program name for third Program
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));
            string thirdProgramName = GCEP.ReturnValueAfterSelectingProgram(3);                     //GCEP.ReturnValueAfterSelectingFromDropDown(GCEP.ProgramSelElem, 3);

            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled); //delete after performance issue removed

            ///  11.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  12. Verifiying curriculum not displayed for different Program
            Assert.True(CurTemp.NoRecordLabel.Displayed);

            ///  13.Clicking breadcrump with third Program name and navigating to GCEP page
            GCEP = CurTemp.ClickToBreadCrumbContainerToReturnGcep(thirdProgramName);
            Browser.WaitForElement(Bys.GCEPPage.ProgramSelElem, ElementCriteria.IsEnabled);

            ///  14. Choosing first Program from dropdown waiting for initialize page
            GCEP.ProgramSelElem.SelectByText(ProgramName);
            GCEP.WaitForInitialize();
            Assert.True(GCEP.SelectProgramAndVerifyBreadcrump(GCEP.ProgramSelElem));

            Browser.WaitForElement(Bys.GCEPPage.CurriculumTemplatesLnk, ElementCriteria.IsEnabled);  //delete after performance issue removed

            ///  15.Clicking Curruculum template link searching for curriculum what we create for first Program
            CurTemp = GCEP.ClickToAdvance(GCEP.CurriculumTemplatesLnk);
            CurTemp.Search(curriculumName);

            ///  16.Deleting curriculum and verifying label is displayed
            CurTemp.DeleteCurriculum(curriculumName);
            Assert.IsTrue(CurTemp.NoRecordLabel.Displayed);
        }