//[Test] public void sandboxtest() { UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity = EAP.AddActivityThenSendToHoldingArea(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", true); }
public void UserCanSendActivityToHoldingAreaThenCompleteActivity() { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Click the Enter a CPD Activity button, fill in the fields, click Send to Holding Area, then click Close /// Do this again for a second activity EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity = EAP.AddActivityThenSendToHoldingArea(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", true); DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity2 = EAP.AddActivityThenSendToHoldingArea(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", true); /// 3. Verify that the activity shows in the My Holding Area table Assert.True(ElemGet.Grid_ContainsRecord(browser, DP.MyHoldingAreaTbl, Bys.MyDashboardPage.MyHoldingAreaTblBody, 0, ConferenceActivity2.ActivityName, "span")); /// 4. Click the View More button underneath the My Holding Area table, then verify that the activity is showing in the /// Incomplete Activities. Click Complete Activity, then click the Continue button and complete the activity and verify /// that it disappears from the Incomplete Activites table MyHoldingAreaPage MP = DP.ClickAndWait(DP.ViewMoreBtn); Assert.True(ElemGet.Grid_ContainsRecord(browser, MP.IncompleteActivitiesTbl, Bys.MyHoldingAreaPage.IncompleteActivitiesTblBody, 0, ConferenceActivity2.ActivityName, "a")); MP.ClickCompleteActivityBtn(MP.IncompleteActivitiesTbl, Bys.MyHoldingAreaPage.IncompleteActivitiesTblBodyRow, ConferenceActivity2.ActivityName); // Not running this in firefox. For some reason, when I enter the date in the above AddActivityThenSendToHoldingArea method, the date enters fine // and the activity completes, but when I open the activity from this window, then the date isnt there, so this is an automation bug. Revisit if (BrowserName != BrowserNames.Firefox) { EAP.ClickAndWait(EAP.ContinueBtn); EAP.ClickAndWait(EAP.OptionalTabSubmitBtn); EAP.CloseBtn.Click(); // Very tired right now. Add dynamic wait here later Thread.Sleep(5000); browser.SwitchTo().DefaultContent(); Assert.False(ElemGet.Grid_ContainsRecord(browser, MP.IncompleteActivitiesTbl, Bys.MyHoldingAreaPage.IncompleteActivitiesTblBody, 0, ConferenceActivity2.ActivityName, "a")); } }
public void UserCanDeleteActivityFromMyHoldingArea() { /// 1. Create a Mainport user and Login UserInfo NewUser = UserUtils.CreateAndRegisterUser(UserUtils.Application.Mainport, UserUtils.UserRole.MP); LoginPage LP = Navigation.GoToLoginPage(browser); MyDashboardPage DP = LP.LoginAsNewUser(UserUtils.UserRole.MP, NewUser.Username, ConfigurationManager.AppSettings["LoginPassword"]); /// 2. Click the Enter a CPD Activity button, fill in the fields, click Continue, then click Send to Holding Area, then click Close EnterCPDActivityPage EAP = DP.ClickAndWait(DP.EnterACPDActivityBtn); Activity ConferenceActivity = EAP.AddActivityThenSendToHoldingArea(Constants.MainportActivityTypes.Sec1_Conference_IfNotAccreditedCutCreditsInHalf, "10", true); /// 3. Click the My Holding Area tab, click the X button to delete the activity, then verify that it disappears from the Incomplete Activites table MyHoldingAreaPage MP = DP.ClickAndWaitBasePage(DP.MyHoldingAreaTab); MP.DeleteActivity(ConferenceActivity.ActivityName); Assert.False(ElemGet.Grid_ContainsRecord(browser, MP.IncompleteActivitiesTbl, Bys.MyHoldingAreaPage.IncompleteActivitiesTblBody, 0, ConferenceActivity.ActivityName, "a")); }