public OnlineShoppingCartFacade( BillingInformationPage billingInformationPage, ShoppingCartPage shoppingCartPage) { this.BillingInformationPage = billingInformationPage; this.ShoppingCartPage = shoppingCartPage; }
public void WhenProceedToCheckout() { Utilities ut = new Utilities(Driver); ShoppingCartPage sp = new ShoppingCartPage(Driver); ut.ClickOnElement(sp.button); }
public void WhenUserClickOnAddToCartButton() { Utilities ut = new Utilities(Driver); ShoppingCartPage sp = new ShoppingCartPage(Driver); ut.ClickOnElement(sp.addToCart); }
public void P20_1_tc_26288_Add_Test_to_Cart() { CommonSection.Administer.ContentManagement.Tests(); TestsPage.ClickCreateNew(); TestwizardPage.CreateNewTest(TestTitle + "_TC26288"); _test.Log(Status.Info, "A New test created"); TestwizardPage.addCosttoTest("5"); _test.Log(Status.Info, "Upload any Image file to content"); TestwizardPage.checkin(); CommonSection.Logout(); LoginPage.LoginAs("srlearner103").WithPassword("").Login(); CommonSection.SearchCatalog(TestTitle + "_TC26288"); SearchResultsPage.ClickCourseTitle(TestTitle + "_TC26288"); Assert.IsTrue(ContentDetailsPage.OverviewTab.isAddtoCartbuttondisplay()); _test.Log(Status.Pass, "Verify Add to Cart button display"); ContentDetailsPage.OverviewTab.click_AddtoCart(); Assert.IsTrue(ContentDetailsPage.OverviewTab.AddtoCartportlet.isTestAddedtoCart()); CommonSection.ClickShoppingCart(); ShoppingCartPage.CompletePurchaseProcess(); OrderPage.Click_Purchased_Content(TestTitle + "_TC26288"); Assert.IsTrue(ContentDetailsPage.OverviewTab.Costportlet.isViewOrderlinkDisplay()); _test.Log(Status.Pass, "Verify view order link display on Add to Cart portlet"); ContentDetailsPage.OverviewTab.Costportlet.ClickViewOrderlink(); Assert.IsTrue(OrderDetailsPage.VerifyPurchasedContent(TestTitle + "_TC26288")); TC26378 = true; }
public void BuyProductFromCart() { ConfirmAddToCartStartPage ConfirmAddToCartStartPage = new ConfirmAddToCartStartPage(FFDriver); PageFactory.InitElements(FFDriver, (new ConfirmAddToCartStartPage(this.FFDriver))); ShoppingCartPage ShoppingCartPage = ConfirmAddToCartStartPage.OpenShoppingCartPage(); SignInPage SignInPage = ShoppingCartPage.OpenSignInPage(); //TODO:retrieving data from file string login = ConfigurationManager.AppSettings["login"]; string password = ConfigurationManager.AppSettings["password"]; SelectShippingAddress SelectShippingAddress = SignInPage.OpenShippingAddressPageWithCredentials(login, password); AmazonUIBuyer.Pages.SelectShippingAddress.ShippingAddressInfo ShippingAddressInfo = new AmazonUIBuyer.Pages.SelectShippingAddress.ShippingAddressInfo(); //TODO: retriving and setting values ShippingAddressInfo.FullName = ConfigurationManager.AppSettings["FullName"]; ShippingAddressInfo.AddressLineFirst = ConfigurationManager.AppSettings["AddressLineFirst"]; ShippingAddressInfo.AddressLineSecond = ConfigurationManager.AppSettings["AddressLineSecond"]; ShippingAddressInfo.City = ConfigurationManager.AppSettings["City"]; ShippingAddressInfo.StateProvinceRegion = ConfigurationManager.AppSettings["StateProvinceRegion"]; ShippingAddressInfo.ZIP = ConfigurationManager.AppSettings["ZIP"]; ShippingAddressInfo.Country = ConfigurationManager.AppSettings["Country"]; ShippingAddressInfo.PhoneNumber = ConfigurationManager.AppSettings["PhoneNumber"]; ShippingAddressInfo.WeekendDelivery = ConfigurationManager.AppSettings["WeekendDelivery"]; ShippingAddressInfo.SecurityAccessCode = ConfigurationManager.AppSettings["SecurityAccessCode"]; ShippingOptionPage ShippingOptionPage = SelectShippingAddress.CreateShippingAddress(ShippingAddressInfo); PaymentMethodPage PaymentMethodPage = ShippingOptionPage.SelectShippingOption("free"); PlaceOrderPage PlaceOrderPage = PaymentMethodPage.ProvideCardInformation(ConfigurationManager.AppSettings["cardName"], ConfigurationManager.AppSettings["cardNumber"], ConfigurationManager.AppSettings["expCardMonth"], ConfigurationManager.AppSettings["expCardYear"]); //PlaceOrderPage.PlaceOrder(); }
public void AddToCart(string articleName) { // Search for "adidas schuhe" via search box landingPage.SearchForArticle(articleName); // wait for search results to load var searchResultsPage = new SearchResultsPage(driver); // Assert Assert.IsTrue(searchResultsPage.HasResults(5), "No search item found at 5th position"); // Click on first article searchResultsPage.ClickFirstArticle(); // Check if article page is loaded var articlePage = new ArticlePage(driver); // Assert Assert.IsTrue(articlePage.ArticleTitle.Contains(searchResultsPage.ArticleTitle), "The correct article page has not loaded. Article text from search does not match with title from article page"); // Select article size articlePage.SelectSize(); // Add article to shopping cart articlePage.ClickAddToCart(); // Wait for shopping cart page to load var shoppingCartPage = new ShoppingCartPage(driver); // Assert Assert.IsTrue(driver.Title.Equals("Amazon.de Einkaufswagen"), "The title for shopping cart page does not show"); Assert.AreEqual("Zum Einkaufswagen hinzugefügt", shoppingCartPage.AddedToCartText, "The message \"Zum Einkaufswagen hizugefügt\" does not show"); }
public void CheckCurrencyFormat(Currency currency, string puttern) { HomePage homePage = LoadHomePage(); homePage = homePage.ChooseCurrency(currency); homePage.AddProductToCart(ProductRepository.GetIPhone()); cartPage = homePage.GotoShoppingCartPage(); SelectShippingMethodComponent ShippingMethod = cartPage.ApplySippingAndTaxes(ShippingDetailsRepository.GetUADetails()); cartPage = ShippingMethod.ApllyShippingMethod(); Thread.Sleep(2000); // for presentation ONLY Total = cartPage.GetPriceOption("Total:"); SubTotal = cartPage.GetPriceOption("Sub-Total:"); FlatShippingRate = cartPage.GetPriceOption("Flat Shipping Rate:"); FixedTestTax = cartPage.GetPriceOption(TaxRateRepository.GetFixTaxRate().Name + ":"); PercentageTestTax = cartPage.GetPriceOption(TaxRateRepository.GetPercentageTaxRate().Name + ":"); StringAssert.IsMatch(puttern, Total); StringAssert.IsMatch(puttern, SubTotal); StringAssert.IsMatch(puttern, FlatShippingRate); StringAssert.IsMatch(puttern, FixedTestTax); StringAssert.IsMatch(puttern, PercentageTestTax); // for presentation ONLY Console.WriteLine(Total); Console.WriteLine(SubTotal); Console.WriteLine(FlatShippingRate); Console.WriteLine(PercentageTestTax); Console.WriteLine(FixedTestTax); }
public void PriceInTable(Product addingProduct) { HomePage homePage = LoadApplication(); Thread.Sleep(1000); // only for presentation homePage.AddProductToCart(addingProduct); Thread.Sleep(1000); // only for presentation shoppingCartPage = homePage .GotoShoppingCartPage(); shoppingCartPageUpdate = shoppingCartPage .UpdateMessage(addingProduct, ShoppingCartData.VALID_CHECK); Thread.Sleep(1000); // only for presentation Console.WriteLine(shoppingCartPageUpdate.GetTablePriceSubTotal() + " + " + shoppingCartPageUpdate.GetTablePriceEcoTax() + " + " + shoppingCartPageUpdate.GetTablePriceVat() //only for presentation + " == " + shoppingCartPageUpdate.GetTablePriceTotal()); Assert.IsTrue(shoppingCartPageUpdate.GetTablePriceSubTotal() + shoppingCartPageUpdate.GetTablePriceEcoTax() + shoppingCartPageUpdate.GetTablePriceVat() == shoppingCartPageUpdate.GetTablePriceTotal()); Console.WriteLine(shoppingCartPageUpdate.GetTablePriceVat() + "==" + ((shoppingCartPageUpdate.GetTablePriceSubTotal() + //only for presentation "*" + ShoppingCartData.FOR_VAT_1) + "/" + ShoppingCartData.FOR_VAT_2)); Assert.IsTrue(shoppingCartPageUpdate.GetTablePriceVat() == ((shoppingCartPageUpdate.GetTablePriceSubTotal() * ShoppingCartData.FOR_VAT_1) / ShoppingCartData.FOR_VAT_2)); }
public void CheckPayForOrder_WhenUserIsNotLog_RedirectToLoginPage() { driver.Navigate().GoToUrl(DataHelper.ServerUrl); var mainPage = new MainPage(driver); mainPage.NavigateToHorseProduct(); var mainCategoryPage = new MainCategoryPage(driver); mainCategoryPage.NavigateToPrestigeSaddleDetails(); var productDetailsPage = new ProductDetailsPage(driver); productDetailsPage.ChooseOptions(); productDetailsPage.AddElementToShoppingCartAndNavigateToIt(); var shoppingCartPage = new ShoppingCartPage(driver); shoppingCartPage.NavigateToOrderData(); var loginPage = new LoginPage(driver); bool isLoginButton = loginPage.IsLoginButton(); Assert.True(isLoginButton == true); }
public void TestMethod1() { HomePage homePage = new HomePage(driver); LogInPage logInPage = new LogInPage(driver); MyAccountPage myAccountPage = new MyAccountPage(driver); CatalogPage catalogPage = new CatalogPage(driver); Window window = new Window(driver); ShoppingCartPage shoppingCartPage = new ShoppingCartPage(driver); AdressPage adressPage = new AdressPage(driver); ShippingPage shippingPage = new ShippingPage(driver); PaymentPage paymentPage = new PaymentPage(driver); OrderSummaryPage orderSummaryPage = new OrderSummaryPage(driver); OrderConfirmationPage orderConfirmationPage = new OrderConfirmationPage(driver); homePage.GoToPage(); homePage.ClickOnSignIn(); logInPage.FillLogInForm("*****@*****.**", "clave1"); logInPage.ClickOnSubmitLogin(); Assert.AreEqual("Welcome to your account. Here you can manage all of your personal information and orders.", myAccountPage.GetSuccessMessage()); myAccountPage.ClickOnWomenOption(); catalogPage.ClickOnAddtoCartButton(); window.ClickOnProceedCheckout(); shoppingCartPage.ClickOnProceedCheckout(); adressPage.ClickOnProceedCheckout(); shippingPage.AgreeTermsOfService(); shippingPage.ClickOnProceedCheckout(); paymentPage.PaybyCheck(); orderSummaryPage.ClickOnProceedCheckout(); orderConfirmationPage.GetSuccessMessage(); }
public void CreateWishlsitWithCartProducts() { HomePage myHomePage = new HomePage(Driver); SearchedProductsPage mySearchedProductsPage = new SearchedProductsPage(Driver); ProductOverviewPage myProductOverviewPage = new ProductOverviewPage(Driver); ShoppingCartPage myShoppingCartPage = new ShoppingCartPage(Driver); CreateWishlistPage myWishlistPage = new CreateWishlistPage(Driver); myHomePage.ClickOnProductSubCategory("Componente", "Placi video"); mySearchedProductsPage.SortProductsByText("Rating clienti"); mySearchedProductsPage.ClickOnSpecifiedProductByIndex(0); myProductOverviewPage.ClickOnAddToShoppingCartButton(); myHomePage.ClickOnProductSubCategory("Componente", "Procesoare"); mySearchedProductsPage.SortProductsByText("Numar vizualizari"); mySearchedProductsPage.ClickOnSpecifiedProductByIndex(1); myProductOverviewPage.ClickOnAddToShoppingCartButton(); myHomePage.ClickOnProductSubCategory("Componente", "Placi de baza"); mySearchedProductsPage.SortProductsByText("Top vanzari"); mySearchedProductsPage.ClickOnSpecifiedProductByIndex(0); myProductOverviewPage.ClickOnAddToShoppingCartButton(); myShoppingCartPage.ClickOnWishListButton(); myWishlistPage.CreateWishlist("Automation test", "This a wishlist create by automation testing", "Autoamtion", "C#", "automationc#@someemail.com"); Assert.IsTrue(myWishlistPage.WishlistConfidentialityCheckBox.Displayed); }
public void CheckPayForOrder_WhenUserIsLog_PlaceOrder() { driver.Navigate().GoToUrl(DataHelper.ServerUrl); var mainPage = new MainPage(driver); mainPage.NavigateToLoginPage(); var loginPage = new LoginPage(driver); loginPage.LoginOnPage(DataHelper.Email, DataHelper.Password); mainPage = new MainPage(driver); mainPage.NavigateToHorseProduct(); var mainCategoryPage = new MainCategoryPage(driver); mainCategoryPage.NavigateToPrestigeSaddleDetails(); var productDetailsPage = new ProductDetailsPage(driver); productDetailsPage.ChooseOptions(); productDetailsPage.AddElementToShoppingCartAndNavigateToIt(); var shoppingCartPage = new ShoppingCartPage(driver); shoppingCartPage.NavigateToOrderData(); var dataOrderPage = new DataOrderPage(driver); dataOrderPage.FillForm(); dataOrderPage.NavigateToConfirmOrder(); }
public OnlineShoppingCartFacade( BillingInformationPage billingInformationPage, ShoppingCartPage shoppingCartPage) { this.BillingInformationPage = billingInformationPage; this.ShoppingCartPage = shoppingCartPage; }
internal Then TheShoppingCartContainsNumberOfItems(int numberOfItemsInCart) { var cart = new ShoppingCartPage(driver, ctx); Assert.AreEqual(numberOfItemsInCart, cart.HasNumberOfItems(numberOfItemsInCart)); return(this); }
public void TestInit() { this.TestInitialize(); this.homePage = new HomePage(this.Driver); this.harryPotterPage = new HarryPotterPage(this.Driver); this.firstProductPage = new FirstProductPage(this.Driver); this.shoppingCartPage = new ShoppingCartPage(this.Driver); }
public void Verify_AddToCart_Functionality() { Verify_Shop_Now_Button_Functionality(); _product.ClickAddToCartButton(); ShoppingCartPage _cart = _product.ClickSHoppingCartIcon(); _cart.VerifyProductTitle(); }
public OrderHistorySteps(WebDriver webDriver) { _webDriver = webDriver; homePage = new HomePage(_webDriver.Driver); tshirtsPage = new TshirtsPage(_webDriver.Driver); shoppingCartPage = new ShoppingCartPage(_webDriver.Driver); orderHistoryPage = new OrderHistoryPage(_webDriver.Driver); }
public void ThenQuantityOfProductIsCorrect(string qty) { Utilities ut = new Utilities(Driver); ShoppingCartPage scp = new ShoppingCartPage(Driver); string qtyInCart = ut.ReturnValueFromElement(scp.quantityInCart); Assert.AreEqual(qty, qtyInCart, "Quantity of product in cart is not correct"); }
// should be straight to the db, not through the UI public void AndGiven_I_add_an_album_to_my_Cart() { _sut = _homePage .GenreMenu .SelectGenreByName(AlbumGenre.Disco) .SelectAlbumByName("Le Freak") .AddToCart(); }
public void ThenProductIsAddedToTheCart() { Utilities ut = new Utilities(Driver); ShoppingCartPage cart = new ShoppingCartPage(Driver); string product = ScenarioContext.Current.Get <string>(TestConstants.ProductName); Assert.That(ut.ReturnTextFromElement(cart.productName), Is.EqualTo(product), "Correct product is not present in the cart"); }
public void ThenProductIsAddedToCart() { Utilities ut = new Utilities(Driver); ShoppingCartPage scp = new ShoppingCartPage(Driver); string productName = ScenarioContext.Current.Get <string>(TestConstants.ProductName); Assert.AreEqual(productName, ut.ReturnTextFromElement(scp.productInCart), "Product is not correct"); }
// should be straight to the db, not through the UI public void AndGiven_I_add_an_album_to_my_Cart() { _sut = _homePage .GenreMenu .SelectGenreByName(AlbumGenre.Disco) .SelectAlbumByName("Le Freak") .AddToCart(); }
public void POMTestCase1() { log.Info("Test execution starts!"); // variable definitions (data-driven) string userName = Convert.ToString(this.TestContext.DataRow["userName"]); string passWord = Convert.ToString(this.TestContext.DataRow["passWord"]); string searchKeyWord = Convert.ToString(this.TestContext.DataRow["searchKeyWord"]); string firstName = Convert.ToString(this.TestContext.DataRow["firstName"]); string lastName = Convert.ToString(this.TestContext.DataRow["lastName"]); string emailAddress = Convert.ToString(this.TestContext.DataRow["emailAddress"]); string city = Convert.ToString(this.TestContext.DataRow["city"]); string address = Convert.ToString(this.TestContext.DataRow["address"]); string postalCode = Convert.ToString(this.TestContext.DataRow["postalCode"]); string cellPhoneNumber = Convert.ToString(this.TestContext.DataRow["cellPhoneNumber"]); string poNumber = Convert.ToString(this.TestContext.DataRow["poNumber"]); // navigate to the website HomePage homePage = new HomePage(driver); homePage.NavigateToHomePage(); // login LoginPage loginPage = homePage.GoToLoginPage(); loginPage.TypeUserName(userName); /* also has an assertion */ loginPage.TypePassword(passWord); /* also has an assertion */ loginPage.ConfirmLoginAndGoBackToHomePage(); // search for an item SearchResultPage searchResultPage = homePage.Search(searchKeyWord); // put the first searched item into cart searchResultPage.AddCertainItemToCart(0); // go to the shopping cart and accept the term of service ShoppingCartPage shoppingCartPage = searchResultPage.GoToShoppingCartPage(); shoppingCartPage.AcceptTermOfService(); shoppingCartPage.AssertSubTotalPrice(); /*confirm the subtotal output*/ // go to the checkout page and fill the info CheckoutPage checkoutPage = shoppingCartPage.GoToCheckoutPage(); checkoutPage.FillInfo(firstName, lastName, emailAddress, city, address, postalCode, cellPhoneNumber, poNumber); // go to thank you page ThankYouPage thankYouPage = checkoutPage.GoToThankYouPage(); // finish purchase and go back to home page HomePage homePageBack = thankYouPage.FinishPurchaseAndGoToHomePage(); // logout homePageBack.Logout(); log.Info("Test execution finishes!"); }
public void TestMethod() { LaunchPage launchPage = new LaunchPage(); LoginPage loginPage = launchPage.GoToLoginPage(); MyHomePage myHomePage = loginPage.DoLogin("aman123", "testing123"); ShoppingCartPage shoppingCartPage = myHomePage.BuyProduct("top"); OrderReviewPage orderReviewPage = shoppingCartPage.ConfirmOrder(); OrderStatusPage orderStatusPage = orderReviewPage.PlaceOrder(); orderStatusPage.GeTTopMenu().LogOut(); // loging out }
public void CreatePurchaseBulgaria_AndValidateNoVATTax() { IWebDriver driver = new FirefoxDriver(); ShoppingCartPage shoppingCartPage = new ShoppingCartPage(driver); BillingInformationPage billingInformationPage = new BillingInformationPage(driver); OnlineShoppingCartFacade onlineShoppingCart = new OnlineShoppingCartFacade(shoppingCartPage, billingInformationPage); BillingInformation billingInfo = new BillingInformation("Anton", "Angelov", "Kaspichan"); ShippingInformation shippingInfo = new ShippingInformation("Anton", "Angelov", "Kalofer"); onlineShoppingCart.PerformPurchase(billingInfo, shippingInfo); }
public void InitPages() { loginPage = new LoginPage(Driver); homePage = new HomePage(Driver); commonElements = new CommonElements(Driver); productPage = new ProductPage(Driver); searchPage = new SearchPage(Driver); productFilterPage = new ProductFilterPage(Driver); shoppingCartPage = new ShoppingCartPage(Driver); accountPage = new AccountPage(Driver); userInfoPage = new UserInfoPage(Driver); }
public void CreatePurchaseBulgaria_AndValidateNoVATTax() { IWebDriver driver = new FirefoxDriver(); var shoppingCartPage = new ShoppingCartPage(driver); var billingInformationPage = new BillingInformationPage(driver); var onlineShoppingCart = new OnlineShoppingCartFacade(billingInformationPage, shoppingCartPage); var billingInfo = new BillingInformation("Anton", "Angelov", "Kaspichan"); var shippingInfo = new ShippingInformation("Anton", "Angelov", "Kalofer"); onlineShoppingCart.PerformPurchase(billingInfo, shippingInfo); }
public void AddProductToCart() { HomePage myHomePage = new HomePage(Driver); SearchedProductsPage mySearchedProductsPage = new SearchedProductsPage(Driver); ProductOverviewPage myProductOverviewPage = new ProductOverviewPage(Driver); ShoppingCartPage myShoppingCartPage = new ShoppingCartPage(Driver); myHomePage.ClickOnProductSubCategory("Mobile", "Smartphone"); mySearchedProductsPage.SortProductsByText("Rating clienti"); mySearchedProductsPage.ClickOnSpecifiedProductByIndex(1); myProductOverviewPage.ClickOnAddToShoppingCartButton(); Assert.IsTrue(myShoppingCartPage.EmptyShoppingCartButton.Displayed); }
public void EmptyShoppingCart() { HomePage myHomePage = new HomePage(Driver); SearchedProductsPage mySearchedProductsPage = new SearchedProductsPage(Driver); ProductOverviewPage myProductOverviewPage = new ProductOverviewPage(Driver); ShoppingCartPage myShoppingCartPage = new ShoppingCartPage(Driver); myHomePage.ClickOnProductSubCategory("Mobile", "Smartphone"); mySearchedProductsPage.ClickOnSpecifiedProductByIndex(3); myProductOverviewPage.ClickOnAddToShoppingCartButton(); myShoppingCartPage.ClickOnEmptyCartButton(); Assert.IsTrue(myShoppingCartPage.EmptyShoppingCartMessage.Displayed); }
public void tc_61893_Create_New_Account_Public_Catalog_Shopping_Cart() { CommonSection.SearchCatalog(AICCCourseTitle + "TC60459"); SearchResultsPage.ClickCourseTitle(AICCCourseTitle + "TC60459"); Assert.IsTrue(ContentDetailsPage.ContentBanner.isContentTitledisplay(AICCCourseTitle + "TC60459")); _test.Log(Status.Pass, "Verify Content title is display on Banner"); ContentDetailsPage.OverviewTab.click_AddtoCart(); CommonSection.ClickShoppingCart(); ShoppingCartPage.ClickCheckout_public(); Assert.IsTrue(Driver.checkTitle("Login")); _test.Log(Status.Pass, "Verify page redirect to Login page"); //account creation handle using 61891 }
public void VerifyFailedPurchaseFlow() { //Getting the instance of the landing Home Page var homepage = new HomePage(_driver); var prodname = homepage.GetProductTitle(); //Assert the product title is same Assert.AreEqual("Midtrans Pillow", prodname.Trim()); //clicking on Buy button to navigate to shopping cart page homepage.ClickBuyNow(); //getting the instance of the shopping cart page var cartpage = new ShoppingCartPage(_driver); //Asserting the quantity of the item Assert.AreEqual("1", cartpage.GetQuantityValue()); //clicking on Checkout to navigate to order summary page cartpage.ClickCheckout(); //getting the instance of the order summary iframe var osummary = new OrderSummaryPage(_driver); //Assert the product name shown in the order summary Assert.AreEqual("Midtrans Pillow", osummary.GetProductName().Trim()); osummary.ClickContinueButton(); //getting the instance of the payment list iframe var paymentlist = new PaymentListPage(_driver); paymentlist.ClickCreditCard(); //getting the instance of the credit card details page var ccpage = new CardDetailsPage(_driver); // pass the values read from the config file ccpage.EnterCardDetails(failccnumber, ccexpiry, cccvv); ccpage.ClickContinueButton(); //getting the instance of the Bank OTP page var otppage = new OTPPage(_driver); otppage.EnterOTP(bankotp); otppage.ClickOkButton(); //getting the instance of the transaction status page var txpage = new TxStatusPage(_driver); var statusmsg = txpage.GetFailedTxStatusMessage(); //Assert the failed payment status message in transaction page Assert.IsTrue(statusmsg.ToLower().Trim().Contains("failed")); }
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"); }
public void TestInitialize() { options = new ChromeOptions(); options.AddArgument("--ignore-ssl-errors=yes"); options.AddArgument("--ignore-certificate-errors"); driver = new ChromeDriver(options); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("http://opencart.abstracta.us/"); menuItem = new MenuItemControl(driver); homePage = new HomePage(driver); productListPage = homePage.NavigateToTabletsProductList(driver); productListPage.AddToCartFirstProduct(shoppingCartBO); shoppingCartPage = menuItem.NavigateToShoppingCart(driver); }