public void A11_Access_Key_Expire_When_User_Completed_the_Content_Bundle_34189() { #region Create General Course and Bundle With Cost and Access keys Enabled CommonSection.CreateLink.GeneralCourse(); _test.Log(Status.Info, "Creating a Paid General Course"); GeneralCoursePage.CreateGeneralCourse(generalcourse + "TC34189", "Test General Course"); GeneralCoursePage.setCost("5"); DocumentPage.ClickButton_CheckIn(); _test.Log(Status.Info, "Paid general course created"); CommonSection.Learn.Home(); CommonSection.CreateLink.Bundle(); _test.Log(Status.Info, "Creating a Paid Bundle Course with Access Keys"); objCreate.FillBundlePage(browserstr + "TC34189"); GeneralCoursePage.setCost("5"); _test.Log(Status.Info, "Cost Has Been Set"); BundlesPage.enableAccessKeys(); _test.Log(Status.Info, "Access Keys Enabled"); BundlesPage.addContentIntoBundle(generalcourse + "TC34189"); _test.Log(Status.Info, "Adding Paid General Course into Bundle"); DocumentPage.ClickButton_CheckIn(); #endregion #region Purchase Access Keys for Bundle ShoppingCarts.purchaseAccessKeys("Bundle", Variables.bundleTitle + browserstr + "TC34189"); ShoppingCarts.completePurchaseProcess(); _test.Log(Status.Info, "Keys has been purchased from shopping cart"); CommonSection.Manage.Training(); CommonSection.Manage.AccessKeys(); AccessKeysPage.searchForContent(Variables.bundleTitle + browserstr + "TC34189"); AccessKeysPage.assignKeysToLearner("*****@*****.**"); _test.Log(Status.Info, "Keys has been assigned to learner"); driver.LogoutUser(ObjectRepository.LogoutHoverLink, ObjectRepository.HoverMainLink); #endregion LoginPage.LoginAs("ssuser1").WithPassword("password").Login(); Assert.IsTrue(BundlesPage.searchforBundle(Variables.bundleTitle + browserstr + "TC34189", generalcourse + "TC34189")); _test.Log(Status.Info, "General Course Displaying inside Bundle, Assertion Pass"); Assert.IsTrue(Driver.Instance.IsElementVisible(By.XPath("//input[@value='Enroll']"))); _test.Log(Status.Info, "Cost of General Course Override, Assertion Pass"); GeneralCoursePage.completeGeneralCourse(); BundlesPage.simplysearchforBundle(Variables.bundleTitle + browserstr + "TC34189"); Assert.IsTrue(Driver.Instance.IsElementVisible(By.XPath("//p[contains(.,'You have already completed this item. You must use another access key to begin a new attempt.')]"))); driver.LogoutUser(ObjectRepository.LogoutHoverLink, ObjectRepository.HoverMainLink); LoginPage.LoginAs("").WithPassword("").Login(); }
public void a09_Launch_General_Course_26250() { #region Creating general course CommonSection.CreateLink.GeneralCourse(); _test.Log(Status.Info, "Creating a Paid General Course"); GeneralCoursePage.CreateGeneralCourse(generalcourse + "TC26250", "Test General Course"); DocumentPage.ClickButton_CheckIn(); _test.Log(Status.Info, "General course created"); #endregion CommonSection.Logout(); _test.Log(Status.Info, "Logout from admin"); LoginPage.LoginAs("ak_learner").WithPassword("password").Login(); _test.Log(Status.Info, "Login with Learner"); CommonSection.SearchCatalog(generalcourse + "TC26250"); _test.Log(Status.Info, "Searching for general course from catalog"); CatalogPage.ClickonSearchedCatalog(generalcourse + "TC26250"); GeneralCoursePage.completeGeneralCourse(); TC_26224 = true; _test.Log(Status.Pass, "Assertion Pass as Learner Launched & Completed the General Course"); }