public void AdvancedSearchTooManyResultsTest() { /// 1. Navigate to the login page LoginPage LP = Navigation.GoToLoginPageMainpro(browser); /// 2. Login As AutomationTestUser-DanielNestor DashboardPage DP = LP.LoginAsUser("AutomationTestUser-DanielNestor", "test"); /// 3. Click on the Enter a CPD Activity Button EnterACPDActivityPage EP = DP.ClickToAdvance(DP.EnterCPDActBtn); /// 4. Select Group Learning, Certified, CFPC Certified Mainpro+ Activities // MIKE: Added an end line above this line EP.FillEnterACPDActivityForm("Group Learning", "Certified", "CFPC Certified Mainpro+ Activities"); /// 5. Click on the button to advance EP.ClickToAdvance(EP.LiveInPersonRdoBtn); /// 6. Enter "Heart" into the advanced search box EP.ProgramActivityTitleTxt.SendKeys("Heart"); Thread.Sleep(2000); /// 7. Click on the search EP.AdvancedSearchBtn.Click(); Thread.Sleep(2000); /// 8. verify that a message appears indicating that too many results appeared browser.WaitForElement(Bys.EnterACPDActivityPage.TooManyResultsLbl, ElementCriteria.IsVisible); Assert.True(EP.TooManyResultsLbl.Displayed); }
public void CreateAnAssessmentActivityTest() { /// 1. Navigate to the login page LoginPage LP = Navigation.GoToLoginPageMainpro(browser); //create the dashboard page, but do not initalize it yet DashboardPage DP = null; /// 2. Login as a different user depending on which browser it is if (BrowserName == BrowserNames.InternetExplorer) { DP = LP.LoginAsUser("Automation Explorer User Assessment", "test"); } else if (BrowserName == BrowserNames.Chrome) { DP = LP.LoginAsUser("Automation Chrome User Assessment", "test"); } else if (BrowserName == BrowserNames.Firefox) { DP = LP.LoginAsUser("Automation Firefox User Assessment", "test"); } else { //if an invalid browser is used Assert.Fail(); } // MIKE: Removed a bunch of end lines here. double initialCreditValue = DP.GetTotalCredits(); EnterACPDActivityPage EP = DP.ClickToAdvance(DP.EnterCPDActBtn); /// 3. create an activity that is a Certified Assessment, Other Activity MIKE: Added an end line above here EP.FillEnterACPDActivityForm("Assessment", "Certified", "Other Certified Assessment Activities"); EP.LiveInPersonRdoBtn.Click(); EP.ClickToAdvance(EP.LiveInPersonRdoBtn); /// 4. Click continue after all of the options have been selected EP.ContinueBtn.Click(); //Daniel: Wait Criteria Added /// 5. Fill out the details EP.FillOutAndSubmitAssessmentForm(); // MIKE: See comments inside method DP.DashboardTab.Click(); Thread.Sleep(1000); // MIKE: Add wait criteria double newCreditValue = DP.GetTotalCredits(); //loop over until the credits update do { Thread.Sleep(5000); browser.Navigate().Refresh(); newCreditValue = DP.GetTotalCredits(); } while (newCreditValue == initialCreditValue); Assert.AreEqual(initialCreditValue + 1, newCreditValue); }
public void CreateAnAMAPRAGroupLearningActivityTest() { //creating a random new user with api calls UserInfo NewUser1 = UserUtils.CreateUser("AMA-SL"); /// 1. Navigate to the login page LoginPage LP = Navigation.GoToLoginPageMainpro(browser); //create the dashboard page //Login to the Automation Test User, However another user should be selected in the case that DashboardPage DP = LP.LoginAsUser(NewUser1.Username, "test");; //deal with the eula page DP.EULAButton.Click(); double initialCreditValue = DP.GetTotalCredits(); //get the inital credit value so it can be compared in the end against a new credit value EnterACPDActivityPage EP = DP.ClickToAdvance(DP.EnterCPDActBtn); /// 3. create an activity that is a Certified Assessment, Other Activity MIKE: Added an end line above here EP.FillEnterACPDActivityForm("Group Learning", "Certified", "American Medical Association (AMA) PRA Category 1"); //if the popup appears, click the okay button and then //click on the popup button appears if (EP.AMAPopupSubmitBtn.Displayed) { EP.AMAPopupSubmitBtn.Click(); } EP.LiveInPersonRdoBtn.Click(); EP.ClickToAdvance(EP.LiveInPersonRdoBtn); /// 4. Click continue after all of the options have been selected EP.ContinueBtn.Click(); Thread.Sleep(2000); // MIKE: Add wait criteria for this click, then use ClickToAdvance and place the wait criteria in there, instead of sleeping. Can wait for an element to appear on the next instance of this page /// 5. Fill out the details EP.FillOutAndSubmitAMAGLForm(); DP.DashboardTab.Click(); Browser.WaitForElement(Bys.DashboardPage.TotalCreditsValueLbl, ElementCriteria.IsVisible); double newCreditValue = DP.GetTotalCredits(); //loop over until the credits update do { Thread.Sleep(5000); browser.Navigate().Refresh(); newCreditValue = DP.GetTotalCredits(); } while (newCreditValue == initialCreditValue); Assert.AreEqual(initialCreditValue + 1, newCreditValue); // is what is expected if 1 credit is added }
public void AdvancedSearchNoValuesReturnTest() { // Mike: You have 2 method inside Navigation that do the same thing. Remove one of these methods, and // then utilize the config files instead if you need to use seperate URLs. We can talk about this. /// 1. Navigate to the login page LoginPage LP = Navigation.GoToLoginPageMainpro(browser); // Mike: Can remove this comment. I had this added in the early stages, its just clutter now. You can remove it in every test // Wrapper to login DashboardPage DP = LP.LoginAsUser("AutomationTestUser-DanielNestor", "test"); /// 2. Click on the Enter a CPD activity button EnterACPDActivityPage EP = DP.ClickToAdvance(DP.EnterCPDActBtn); /// 3. Select Assessment, Certified, CFPC Certified Mainpro+ Activites EP.FillEnterACPDActivityForm("Assessment", "Certified", "CFPC Certified Mainpro+ Activities"); // MIKE: See my comment inside this method EP.ClickToAdvance(EP.LiveInPersonRdoBtn); // MIKE: See my comment inside this method // Mike: I added an end line above the below line. We want all step comments to have end lines above them to make the steps easier to read. // You had the above line EP.ClickToAdvance(EP.LiveInPersonRdoBtn) and the below line EP.ProgramActivityTitleTxt.SendKeys without an end line between them /// 4. Fill out the search box with "This is a test sending keys" EP.ProgramActivityTitleTxt.SendKeys("This is a test sending keys"); //add wait critera Thread.Sleep(2000); /// 5. Click on the search button EP.AdvancedSearchBtn.Click(); Thread.Sleep(2000); /// 6. A message should appear indicating that there is no returned elements browser.WaitForElement(Bys.EnterACPDActivityPage.NoResultsLbl, ElementCriteria.IsVisible); Assert.True(EP.NoResultsLbl.Displayed); }
public void AMAPRASelfMaxCreditTest() { //creating a random user with api calls UserInfo NewUser1 = UserUtils.CreateUser("AMA-SL"); /// 1. Navigate to the login page LoginPage LP = Navigation.GoToLoginPageMainpro(browser); //create the dashboard page //Login to the Automation Test User, However another user should be selected in the case that // DashboardPage DP = LP.LoginAsUser(NewUser1.Username, "test");; //deal with the eula DP.EULAButton.Click(); EnterACPDActivityPage EP = DP.ClickToAdvance(DP.EnterCPDActBtn); /// 3. create an activity that is a Certified Assessment, Other Activity MIKE: Added an end line above here EP.FillEnterACPDActivityForm("Self-Learning", "Certified", "American Medical Association (AMA) PRA Category 1"); //if the popup appears, click the okay button and then //click on the popup button appears if (EP.AMAPopupSubmitBtn.Displayed) { EP.AMAPopupSubmitBtn.Click(); } EP.LiveInPersonRdoBtn.Click(); EP.ClickToAdvance(EP.LiveInPersonRdoBtn); /// 4. Click continue after all of the options have been selected EP.ContinueBtn.Click(); Thread.Sleep(2000); // MIKE: Add wait criteria for this click, then use ClickToAdvance and place the wait criteria in there, instead of sleeping. Can wait for an element to appear on the next instance of this page /// 5. Fill out the details EP.FillOutAMAActivityForm1(90); // MIKE: See comments inside method //next go on and check to see that only 50 credits are applied to the Certification Browser.ExecuteScript("arguments[0].click();", EP.PopupSubmitBtn); Thread.Sleep(8000); // MIKE: Add wait criteria. Can wait for an element to be NOT visible DP.DashboardTab.Click(); Thread.Sleep(1000); // MIKE: Add wait criteria double newCreditValue = DP.GetTotalCredits(); //loop over until the credits update do { Thread.Sleep(5000); browser.Navigate().Refresh(); newCreditValue = DP.GetTotalCredits(); } while (newCreditValue == 0); //once the new credits appear, click on the link to open up the popup int x = 0; //now check to see if the applied credits DP.TotalCreditsLinkLnk.Click(); Thread.Sleep(5000); String creditValue = DP.TotalCreditsValueLbl.Text; //just putting the wait criteria here incase a breakpoint is needed Thread.Sleep(5000); Assert.AreEqual(creditValue, "50"); }