Example #1
0
        public void tc_59265_As_a_learner_I_want_to_redeem_discount_codes_at_the_classroom_section_Level()
        {
            CommonSection.Logout();
            LoginPage.LoginAs("ak_learner").WithPassword("").Login();

            CommonSection.SearchCatalog("NewClassroomTest_DIscountCode002");
            _test.Log(Status.Info, "Search for the content");
            SearchResultsPage.ClickCourseTitle("NewClassroomTest_DIscountCode002");
            _test.Log(Status.Info, "Click on searched title");
            ContentDetailsPage.ClickOnAddtoCartButtonOfSection();
            _test.Log(Status.Info, "Click on Add to Cart Button");
            Assert.IsTrue(CommonSection.isCountincrease_ShopingCart());
            _test.Log(Status.Pass, "Verify the cart count has Increased");
            CommonSection.ClickShoppingCart();
            _test.Log(Status.Info, "Click on Shopping Cart");
            ShoppingCartPage.ApplyDiscountCode("Ak005");
            _test.Log(Status.Info, "Apply wrong Discount code");
            StringAssert.AreEqualIgnoringCase("The discount code you entered is not a valid discount code. Confirm that you have entered the code correctly. If you did, then perhaps you no longer have permission to use the code.", ShoppingCartPage.VerifyWrongDiscountCodeMessage());
            _test.Log(Status.Pass, "Verify Alert message for wrong discount Code");
            ShoppingCartPage.ApplyDiscountCode("Ak003");
            _test.Log(Status.Info, "Apply valid discount code");
            StringAssert.AreEqualIgnoringCase("The discount code was applied to your order.", ShoppingCartPage.VerifyValidDiscountCodeMessage());
            _test.Log(Status.Pass, "Verify Alert message for valid discount Code");
            Assert.IsTrue(ShoppingCartPage.DiscountedAmountIsDisplayed());
            _test.Log(Status.Pass, "Verify discounted amount is displayed");
            ShoppingCartPage.RemoveDiscountCode();
            _test.Log(Status.Info, "Remove discount code");
            StringAssert.AreEqualIgnoringCase("The discount code was removed from your order.", ShoppingCartPage.VerifyDiscountCodeRemoveMessage());
            _test.Log(Status.Pass, "Verify Alert message for remove discount Code");
            ShoppingCartPage.ApplyDiscountCode("Ak004");
            _test.Log(Status.Info, "Apply valid percentage discount code");
            StringAssert.AreEqualIgnoringCase("The discount code was applied to your order.", ShoppingCartPage.VerifyValidDiscountCodeMessage());
            _test.Log(Status.Pass, "Verify Alert message for valid discount Code");
            Assert.IsTrue(ShoppingCartPage.DiscountedAmountInPercentageDisplayed());
            _test.Log(Status.Pass, "Verify discounted amount is displayed");
            ShoppingCartPage.RemoveContent("NewClassroomTest_DIscountCode002 - Section 1");
            _test.Log(Status.Info, "Remove content from cart");
            CommonSection.Logout();
            _test.Log(Status.Info, "Logout from learner's account");
            LoginPage.LoginAs("siteadmin").WithPassword("").Login();
            CommonSection.Administer.ECommerce.PricingAndCodes.DiscountCodes();
            _test.Log(Status.Info, "Click Discount codes From administer");
            DiscountCodesPage.SearchCodeAndEditContent("Ak003");
            _test.Log(Status.Info, "Seach the discount code and from Manage go to Edit content");
            DiscountCodesPage.RemoveDiscountCode();
            _test.Log(Status.Info, "Remove Discount code");
            DiscountCodesPage.SearchCodeAndEditContent("Ak004");
            _test.Log(Status.Info, "Seach the discount code and from Manage go to Edit content");
            DiscountCodesPage.RemoveDiscountCode();
            _test.Log(Status.Info, "Remove Discount code");
        }