public void ReflectionShowsInTableAfterAdded() { // TEMPORARY: When the Delete User API is developed, we can remove the below code and uncomment the code below it, which creates new users // on the fly. Decide this when the delete API is complete /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); /// 3. Switch to the Reflection tab and verify the reflection is shown in the table CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, Bys.CBDLearnerPage.ReflectionsTblBdy, 0, LR.ReflectionTitle, "td", Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); ///// 1. Login as learner //LoginPage LP = Navigation.GoToLoginPage(browser); //UserInfo LRUser = UserUtils.CreateAndRegisterUser(null, UserUtils.Application.CBD, UserUtils.UserRole.LR); //CBDLearnerPage CLP = LP.Login(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password, false); ///// 2. Add a reflection //LearnerRelectionObject LR = CLP.AddReflection(); ///// 3. Switch to the Reflection tab and verify the reflection is shown in the table //CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); //Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, LR.ReflectionTitle, Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); }
public void UIUpdatesAfterLearnerAddsReflection() { /// 1. Create learner user and login LoginPage LP = Navigation.GoToLoginPage(browser); LRUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.CBD, UserUtils.UserRole.LR); CBDLearnerPage CLP = LP.LoginAsNewUser(UserUtils.UserRole.LR, LRUser.Username, LRUser.Password); /// 2. Store the number from the label text of the Reflections tab, and also "Showing" label, for the purpose of a future Assert within this /// test. If there are no Reflections yet, this showing label will not appear, so skip it if so CLP.SwitchToTab(CLP.ReflectionsTab, Bys.CBDLearnerPage.ReflectionsTab); string origNumbOfReflectionsOnReflectionsTab = DataUtils.GetStringBetweenCharacters(CLP.ReflectionsTab.Text, "(", ")"); if (browser.Exists(Bys.CBDLearnerPage.ShowingLbl, ElementCriteria.IsVisible)) { string origNumbOfReflectionsOnShowingLbl = DataUtils.GetStringAfterCharacter(CLP.ShowingLbl.Text, "f", 2); } /// 3. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); /// 4. Assert that the Reflections tab label increased by 1 Assert.AreEqual(Int32.Parse(origNumbOfReflectionsOnReflectionsTab) + 1, Int32.Parse(DataUtils.GetStringBetweenCharacters(CLP.ReflectionsTab.Text, "(", ")"))); /// 5. Assert that the label within the Reflections tab increased by 1 // Bug RCPSC-264: "Learner->Add Reflection: "Showing" label does not update after learner adds reflection" // Uncomment and run the test when fixed if (browser.Exists(Bys.CBDLearnerPage.ShowingLbl, ElementCriteria.IsVisible)) { //Assert.AreEqual(Int32.Parse(origNumbOfReflectionsOnShowingLbl) + 1, Int32.Parse(DataUtils.GetStringAfterCharacter(CLP.ShowingLbl.Text, "f", 2))); } /// 5. Assert that the table contains the reflection Assert.True(ElemGet.Grid_ContainsRecord(browser, CLP.ReflectionsTbl, Bys.CBDLearnerPage.ReflectionsTblBdy, LR.ReflectionTitle, "td", Bys.CBDLearnerPage.TableFirstBtn, Bys.CBDLearnerPage.TableNextBtn)); }
public void LearnerCanAddReflection() { /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); }
public void LearnerCanAddReflection() { /// 1. Login as a learner LoginPage LP = Navigation.GoToLoginPage(browser); CBDLearnerPage CLP = LP.LoginAsExistingUser(UserUtils.UserRole.LR, UserUtils.Learner1Login, "test"); /// 2. Add a reflection LearnerRelectionObject LR = CLP.AddReflection(); }