public ProductsPage GetPage() { ProductsPage PageOfProducts; if (NextPageIsLastPage()) { PageOfProducts = new ProductsPage() { CurrentPage = _page, NumberOfPages = _numberOfPages, Products = GetNextPage() }; } else { PageOfProducts = new ProductsPage() { CurrentPage = _page, NumberOfPages = _numberOfPages, Products = GetLastPage() }; } return(PageOfProducts); }
public void DeleteAllItemsFromCartTest() { // Arrange NavigateToURL(); HomePage homePage = new HomePage(Driver); SignInPage signInPage = new SignInPage(Driver); UserPage userPage = new UserPage(Driver); ProductsPage products = new ProductsPage(Driver); signInPage.clickOnSignInUsButton(); userPage.enterCredentialsAndLogin(); //Act homePage.navigateInNestedMenu(); products.AddToCardFirstDress(); products.AddToCardSecondDress(); products.AddTshirtToCart(); products.OpenCartFromTshirt(); userPage.DeleteItemsFromCart(); userPage.DeleteItemsFromCart(); userPage.DeleteItemsFromCart(); //Assert Assert.AreEqual(products.CheckTextMessageWhenCartIsEmpty(), "Your shopping cart is empty.", "The cart is not empty"); userPage.logoutAction(); Assert.IsTrue(signInPage.IsSigninButtonDisplayed()); }
public void GivenIkBenOpDeWinkelmandPaginaMetItemsInMijnWinkelmandje() { _productsPage = Browser.GotoProductsPage(); _productsPage.AddFirstProductToCart(); _cartPage = Browser.GotoCart(); Assert.IsTrue(_cartPage.GetAmountOfProductsInCart() > 0); }
public void OrderSummerDressesTest() { // Arrange NavigateToURL(); HomePage homePage = new HomePage(Driver); SignInPage signInPage = new SignInPage(Driver); UserPage userPage = new UserPage(Driver); ProductsPage summerDressesPage = new ProductsPage(Driver); //Act homePage.navigateInNestedMenu(); summerDressesPage.AddToCardFirstDress(); summerDressesPage.AddToCardSecondDress(); summerDressesPage.AddToCardThridDress(); summerDressesPage.ProceedToCheckoutAction(); userPage.enterCredentialsAndLogin(); userPage.ClickOnProceedButtonDromAddressPage(); userPage.AgreeToConditionAndProceed(); userPage.SelectPaymentType(); userPage.ConfirmOrder(); //Assert Assert.AreEqual(userPage.OrderConfirmationTextMessage(), "Your order on My Store is complete.", "The order was not OK"); userPage.logoutAction(); Assert.AreEqual(userPage.checkIfLoginWasOk(), "AUTHENTICATION", "Logout action was not ok"); }
public App() { InitializeComponent(); //MainPage = new MainPage(); MainPage = new ProductsPage(); }
public static ProductsPage AddProduct(Product pr, IWebDriver driver) { ProductsPage productsPage = new ProductsPage(driver); ProductsPage addPage = productsPage.AddProduct(pr); return(addPage.ClickButton()); }
public App() { InitializeComponent(); //La aplicacion va a Iniciar por ProdutsPage MainPage = new ProductsPage(); }
public void CheckAutoRenewNoteIsNotDisplayedWhenTheUserHasNotCheckIt() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); contactInfoPage = new ContactInfoPage(CmdDriver.Driver); extentReportUtils.createATestCase("Check Auto renewal note is NOT displayed on Contact Info page when the user has not check it"); extentReportUtils.addTestLog(Status.Info, "CheckAutoRenewNoteIsNotDisplayedWhenTheUserHasNotCheckIt"); //CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127"); productsPage.ClickAcceptAllCookies(); productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_ULTIMATE); 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(); // Assert Auto Renewal Message Box is displayed Assert.IsFalse(contactInfoPage.IsAutoRenewalMessageDisplayed()); }
public void VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); extentReportUtils.createATestCase("Verify Product details are displayed when a user clicks on product name"); extentReportUtils.addTestLog(Status.Info, "VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName"); productsPage.ClickAcceptAllCookies(); productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); string productName = HelperUtils.GetDescription(ProductsEnum.DEVCRAFT_UI); yourOrderPage.ClickAcceptAllCookies(); // Assert productDetails are not displayed Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); // Click on product name yourOrderPage.ClickOnProductByProductName(productName); // Assert product details are displayed Assert.IsTrue(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); // Click again on product name yourOrderPage.ClickOnProductByProductName(productName); // Assert productDetails are not displayed Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); }
// GET: Products // GET: Products/startIndex=5 public ActionResult Index(int?startIndex) { if (startIndex == null) { startIndex = 0; } var products = m_db.Products.OrderBy(x => x.Id).Skip(startIndex.Value).Take(PageSize).ToList(); int productsTotalCount = m_db.Products.Count(); int currentPage = (int)(startIndex / PageSize) + 1; int pagesTotalCount = (productsTotalCount / PageSize) + 1; var productsPage = new ProductsPage(products, currentPage, pagesTotalCount, productsTotalCount); if (startIndex > 0) { productsPage.PreviousPageProductIndex = startIndex - PageSize; } if (startIndex + PageSize < productsTotalCount) { productsPage.NextPageProductIndex = startIndex + PageSize; } return(View(productsPage)); }
public void SearchForProductTest() { // Arrange NavigateToURL(); HomePage homePage = new HomePage(Driver); SignInPage signInPage = new SignInPage(Driver); UserPage userPage = new UserPage(Driver); ProductsPage products = new ProductsPage(Driver); //Act products.searchforTshirt(); products.AddTshirtToCart(); products.OpenCartFromTshirt(); userPage.ProceedTocheckoutFromSummaryPageAction(); userPage.enterCredentialsAndLogin(); userPage.ClickOnProceedButtonDromAddressPage(); userPage.AgreeToConditionAndProceed(); userPage.SelectPaymentType(); userPage.ConfirmOrder(); //Assert Assert.AreEqual(userPage.OrderConfirmationTextMessage(), "Your order on My Store is complete.", "The order was not OK"); userPage.logoutAction(); Assert.IsTrue(signInPage.IsSigninButtonDisplayed()); Assert.AreEqual(userPage.checkIfLoginWasOk(), "AUTHENTICATION", "Logout action was not ok"); }
public void VerifyUserIsNavigatedBackToProductPageWhenRemovingExistingProductFromCard() { yourOrderPage = new YourOrderPage(CmdDriver.Driver); productsPage = new ProductsPage(CmdDriver.Driver); extentReportUtils.createATestCase("Verify the user is navigated back to Product page when removing the existing product from the card"); extentReportUtils.addTestLog(Status.Info, "VerifyUserIsNavigatedBackToProductPageWhenRemovingExistingProductFromCard"); productsPage.ClickAcceptAllCookies(); // Choose product and click on 'Buy Now' button for it productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE); yourOrderPage.ClickAcceptAllCookies(); // Click Delete item link by product name yourOrderPage.ClickDeleteItemButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE); // Assert Emtry Card message text Assert.AreEqual("Your shopping cart is empty!", yourOrderPage.GetEmptyCardMessageText()); // Click "Browse Products" button yourOrderPage.ClickBrowseProductsButton(); // Assert Header on Product page Assert.AreEqual("Pricing", productsPage.GetHeaderText()); }
public void TestAddToBasket() { ProductsPage page = new ProductsPage(driver).Open().AcceptCookies().ChooseProduct(0).ClickAddToBasket(); Thread.Sleep(2000); Assert.IsTrue(page.AddedToBasketTitle.Displayed); }
public void ShouldHaveCorrectNumberOfProducts() { //IMPORTANT - how did I bypass the login here? var productsPage = new ProductsPage(Driver).Open(); productsPage.ProductCount.Should().Be(6, "we logged in successfully and we should have 6 items on the page"); }
public ProductsSteps(FourthLoginPage login, FourthHomePage fourthHomePage, SCLocationPage scLocationPage, SCHomePage scHomePage, ProductsPage productsPage) { FourthLoginPage = login; FourthHomePage = fourthHomePage; SCLocationPage = scLocationPage; SCHomePage = scHomePage; ProductsPage = productsPage; }
public static ProductsPage CreateProduct(Products product, IWebDriver driver) { HomePage homePage = new HomePage(driver); ProductsPage productsPage = homePage.AllProductView(); CreateNewPage createNewPage = productsPage.createNewButtonClick(); productsPage = createNewPage.InputProduct(product); return(new ProductsPage(driver)); }
public void GivenIkBenOpDeWinkelwagenpaginaEnHebEenProductErinZittenMetAantal(int givenAantal) { _productsPage = Browser.GotoProductsPage(); _productsPage.AddFirstProductToCart(); _cartPage = Browser.GotoCart(); var aantal = _cartPage.GetAmountOfProductsInCart(); Assert.AreEqual(givenAantal, aantal); }
/// <summary> /// Initialize /// </summary> /// <param name="rep">productsRepository</param> public App(IProductsService rep) : this() { var page = new ProductsPage() { BindingContext = new ProductsVM(rep) }; MainPage = new NavigationPage(page); }
public void ChangeCatOnProduct() { MakeScreenshotWhenFail(() => { HomePage HomePage = new HomePage(); ProductsPage productsPage = HomePage.GoToPage().GoWithMenuToProductPage(); Assert.IsTrue(productsPage.clickToCatMenu().IsMenuItemActive()); }); }
public static void Display(ProductsPage products) { Console.Clear(); MenuLabel(); FilteringValues(); ResetCursorPosition(); PrintProductsWithLabels(products.Products); PrintPageCounter(products); DisplayFilteringMenu(); }
public void CheckBrandFilter() { var productsPage = new ProductsPage(driver); productsPage.GoToPage(); var selectedBrand = productsPage.ApplyFirstBrandFilter(); var firstBrand = productsPage.CheckFirstProductBrand(); Assert.IsTrue(selectedBrand.Contains(firstBrand.Split("/")[0].Trim())); }
public void CheckMaxPriceFilter() { var productsPage = new ProductsPage(driver); productsPage.GoToPage(); productsPage.ApplyMaxPriceFilter(40); var isPriceMax = productsPage.CheckIfPriceIsMax(40); Assert.IsTrue(isPriceMax); }
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 AddNewProductTest() { HomePage.ProductsPage(); ProductsPage = new ProductsPage(driver); ProductsPage.OpenNewProduct(); NewProductPage newProductPage1 = new NewProductPage(driver); newProductPage1.CreateNewProduct("Fish", "Seafood", "Tokyo Traders", "7", "1", "10", "3", "1"); Assert.AreEqual("All Products", ProductsPage.CurrentHead()); }
public void AddingFirstTwoProductsToComparisonTest() { var productsPage = new ProductsPage(driver); productsPage.GoToPage(); productsPage.AddTwoProducts(); var comparisonPage = productsPage.GoToComparisonPage(); var productsAmount = comparisonPage.CountProudcts(); Assert.IsTrue(productsAmount == 2); }
public IActionResult Products() { List <Product> allProducts = dbContext.Products.ToList(); ProductsPage model = new ProductsPage(); model.ExistingProducts = allProducts; ViewBag.Title = "Products"; return(View(model)); }
public void ShouldBeAbleToAddItemToCart() { //Arrange var productsPage = new ProductsPage(Driver); //Act productsPage.Open(); productsPage.AddFirstProductToCart(); //Assert productsPage.Cart.ItemCount.Should().Be(1, "we added a backpack to the cart"); }
public void CheckAddProduct() { MakeScreenshotWhenFail(() => { HomePage HomePage = new HomePage(); ProductsPage productsPage = HomePage.GoToPage().GoWithMenuToProductPage(); productsPage.AddProduct(ProductCreator.WithName()); CartPage cartPage = productsPage.GoToCartPage(); Assert.IsTrue(cartPage.CheckProductIsCart(ProductCreator.WithName())); }); }
public void AddingProductToBasket() { string productName = "Джинсы"; var productsPage = new ProductsPage(driver); productsPage.GoToPage(); productsPage.AddToCart(productName); var basketPage = productsPage.GoToBasketPage(); var productInBasket = basketPage.CheckProduct(); Assert.IsTrue(productInBasket.Contains(productName)); }
public static string AddNewProduct(Product product, IWebDriver driver) { HomePage HomePage = new HomePage(driver); HomePage.ProductsPage(); ProductsPage ProductsPage = new ProductsPage(driver); ProductsPage.OpenNewProduct(); NewProductPage NewProductPage = new NewProductPage(driver); NewProductPage.CreateNewProduct(product); return(ProductsPage.CurrentHead()); }