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 FilterOrderByOrderStatusSteps(ScenarioContext injectedContext, OrderCardsHeaderPage headerPage, OrderSummaryPage summarypage, OrderFilterPanel orderFilterPanel, OrderCardsHeaderPage orderCard) { _context = injectedContext; _summaryPage = summarypage; _headerPage = headerPage; _orderFilterPanelPage = orderFilterPanel; _orderCardsPage = orderCard; }
public void CheckValidationForCompany() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); contactInfoPage = new ContactInfoPage(CmdDriver.Driver); orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver); extentReportUtils.createATestCase("Check validation for company"); extentReportUtils.addTestLog(Status.Info, "CheckValidationForCompany"); productsPage.ClickAcceptAllCookies(); // Click on Buy Now button per Product name productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); //yourOrderPage.ClickAcceptAllCookies(); // Assert there is at least one product at the page Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage()); // Navigate user to the next page - Contact Info Page yourOrderPage.ClickContinueButton(); contactInfoPage.ClickAcceptAllCookies(); ContactInfo contactInfo = new ContactInfo(); // Fill Billing Information contactInfoPage.SetFirstName(contactInfo.FirstName); contactInfoPage.SetLastName(contactInfo.LastName); contactInfoPage.SetEmail(contactInfo.Email); contactInfoPage.SetPhone(contactInfo.PhoneNumber); contactInfoPage.SetAddress(contactInfo.Address.Street); contactInfoPage.SetCountry(contactInfo.Address.Country); contactInfoPage.SetCity(contactInfo.Address.City); contactInfoPage.SetZipCode(contactInfo.Address.ZipCode); contactInfoPage.SetState("New Jersey"); // Click 'Continue' button contactInfoPage.ClickContinueButton(); // Assert email error message about required field Assert.AreEqual("Company is required", contactInfoPage.GetErrorMessageForCompany()); // Set email with more than max lenght (60) string tooLongCompany = StringUtils.CreateString(61); contactInfoPage.SetCompany(tooLongCompany); // Click 'Continue' button contactInfoPage.ClickContinueButton(); // Assert email error message about required field Assert.AreEqual("Invalid company", contactInfoPage.GetErrorMessageForCompany()); }
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 CheckVatIdIsNotRequiredField() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); contactInfoPage = new ContactInfoPage(CmdDriver.Driver); orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver); extentReportUtils.createATestCase("Check Vat id is not a required field"); extentReportUtils.addTestLog(Status.Info, "CheckVatIdIsNotRequiredField"); productsPage.ClickAcceptAllCookies(); // Click on Buy Now button per Product name productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); yourOrderPage.ClickAcceptAllCookies(); // Assert there is at least one product at the page Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage()); // Navigate user to the next page - Contact Info Page yourOrderPage.ClickContinueButton(); ContactInfo contactInfo = new ContactInfo(); contactInfo.Address.Country = "Bulgaria"; contactInfo.Address.City = "Sofia"; contactInfo.Address.ZipCode = "1000"; contactInfo.VatId = ""; // Fill Billing Information contactInfoPage.FillBillingInformation(contactInfo); // Assert error message for vat id is NOT displayed Assert.IsFalse(contactInfoPage.IsVatIdErrorMessageDisplayed()); // Navigate user to next page contactInfoPage.ClickContinueButton(); // Assert at Order summary page Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText()); }
public void CheckBillingInformationWithState() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); contactInfoPage = new ContactInfoPage(CmdDriver.Driver); orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver); extentReportUtils.createATestCase("Check Billing information with state"); extentReportUtils.addTestLog(Status.Info, "CheckBillingInformationWithState"); productsPage.ClickAcceptAllCookies(); // Click on Buy Now button per Product name productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); yourOrderPage.ClickAcceptAllCookies(); // Assert there is at least one product at the page Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage()); // Navigate user to the next page - Contact Info Page yourOrderPage.ClickContinueButton(); ContactInfo contactInfo = new ContactInfo(); // Fill Billing Information contactInfoPage.FillBillingInformation(contactInfo); // Assert Vat field is not displayed Assert.IsFalse(contactInfoPage.IsVatIdFieldDisplayed()); // Navigate user to next page contactInfoPage.ClickContinueButton(); // Assert at Order summary page Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText()); }
public void CheckBillingInformationWithVat() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); contactInfoPage = new ContactInfoPage(CmdDriver.Driver); orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver); extentReportUtils.createATestCase("Check Billing information with state"); extentReportUtils.addTestLog(Status.Info, "CheckBillingInformationWithState"); productsPage.ClickAcceptAllCookies(); // Click on Buy Now button per Product name productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); yourOrderPage.ClickAcceptAllCookies(); // Assert there is at least one product at the page Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage()); // Navigate user to the next page - Contact Info Page yourOrderPage.ClickContinueButton(); ContactInfo contactInfo = new ContactInfo(); contactInfo.Address.Country = "Bulgaria"; contactInfo.Address.City = "Sofia"; contactInfo.Address.ZipCode = "1000"; contactInfo.VatId = "BG160026043"; // Fill Billing Information contactInfoPage.FillBillingInformation(contactInfo); contactInfoPage.ClickContinueButton(); // Assert at Order summary page Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText()); }
public void VerifyPurchaseFlow() { //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(passccnumber, 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 /* TO-DO: Caputuring Successful Transaction Message in the iframe is flaky * Tried few methods, but still stuck - so doing the verification in the Home page */ var txpage = new TxStatusPage(_driver); //var statusmsg = txpage.GetTxStatusMessage(); //Assert the Success Payment message in transaction page // TO-DO: When the above status message method is stabilized //Assert.IsTrue(statusmsg.ToLower().Trim().Contains("success")); //Assert in Home Page var homemsg = homepage.GetTransMessage(); Assert.IsTrue(homemsg.ToLower().Trim().Contains("thank you")); }
public void OrderingItems() { //Landing Home Page for Automation Practice HomePage pgHome = new HomePage(); //Click on Quick view on Home Page for first item returns the QuickView Page QuickViewPage pgQuickView = pgHome.quickViewProduct("Faded Short Sleeve T-shirts"); pgQuickView.selectSize("M"); //Selecting size as M on QuickView Page //Clicking on Add to Basket returns the Checkout Page CheckoutPage pgCheckout = pgQuickView.clickAddtoCart(); PropertiesCollection.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(16); //wait for the checkout window to appear string item1ProdPrice = pgCheckout.GetProdPrice(); //returning price of first product string item1ShipPrice = pgCheckout.GetProdShipPrice(); //returning shipping price of first product string item1TotalPrice = pgCheckout.GetProdCartTotal(); //returning total price of first product //Clicking on Continue Shopping returns to HomePPage pgHome = pgCheckout.clickContinueShopping(); //Click on Quick view on Home Page for second item returns the QuickView Page pgQuickView = pgHome.quickViewProduct("Blouse"); pgQuickView.selectSize("S"); //Selecting default on QuickView Page //Clicking on Add to Basket returns the Checkout Page pgCheckout = pgQuickView.clickAddtoCart(); string item2ProdPrice = pgCheckout.GetProdPrice(); //returning price of second product string item2ShipPrice = pgCheckout.GetProdShipPrice(); //returning shipping price of second product string item2TotalPrice = pgCheckout.GetProdCartTotal(); //returning total price of second product //Clicking on Proceed to checkout returns Order Summary Window OrderSummaryPage pgOrderSummary = pgCheckout.clickProceedtoCheckout(); string strItem1Size = pgOrderSummary.getItemSize("Faded Short Sleeve T-shirts"); //returning size of first item product Reporting.AssertTrue("M", strItem1Size, "OrderingItems", "Verify Size"); string strItem1Price = pgOrderSummary.getItemPrice("Faded Short Sleeve T-shirts"); //returning price of first product from order page Reporting.AssertTrue(item1ProdPrice, strItem1Price, "OrderingItems", "Verify first item price"); string strItem2Price = pgOrderSummary.getItemPrice("Blouse"); //returning price of second product from order page Reporting.AssertTrue(item2ProdPrice, strItem2Price, "OrderingItems", "Verify second item price"); string strTotalProductPrice = pgOrderSummary.getTotalProduct(); //returning price of both product from order page string strTotalShippingPrice = pgOrderSummary.getShipping(); //returning price of shipping for product from order page string strTotalAmount = pgOrderSummary.getTotalAmount(); //returning price of shipping and both product from order page //Clicking on Proceed to Checkout returns Sign In Window OrderSignInPage pgSignin = pgOrderSummary.clickProceedToCheckout(); //Signining in the applicatin return Address confirmation window OrderAddressPage pgAddress = pgSignin.SignIn(strEmailAddress, strPassword); //Clicking on Proceed to Checkout returns Shipping In Window OrderShippingPage pgShipping = pgAddress.clickProceedToCheckout(); //Clicking on Proceed to Checkout returns Payment Window OrderPaymentPage pgPayment = pgShipping.clickProceedtoCheckout(); //Select Payment Type as Wire returns confirmation Window OrderConfirmationPage pgConfirmation = pgPayment.clickBankWirePayment(); pgConfirmation.clickConfirmOrder(); //Confirming Paying }