Beispiel #1
0
        public void DeleteFavoriteItem()
        {
            CheckFavoritedItem();

            FavoritesPageObject page = new FavoritesPageObject(TestProperties.driver);

            page.DeleteProduct();

            System.Threading.Thread.Sleep(1000);

            page.DeleteConfirm();

            bool productInList = false;

            System.Threading.Thread.Sleep(1000);

            foreach (var product in page.GetFavoritedList())
            {
                if (product.Text.ToString() == FavoriteHelper.FavoritedProduct)
                {
                    productInList = true;
                    Console.WriteLine("The product is still on your list");
                }
            }

            TestProperties.driver.Manage().Window.Maximize();
            System.Threading.Thread.Sleep(300);

            Assert.IsFalse(productInList);
            Console.WriteLine("Removed Product not in your favorite list");

            TestProperties.driver.Manage().Window.Maximize();
            System.Threading.Thread.Sleep(300);
        }
Beispiel #2
0
        public void CheckFavoritedItem()
        {
            NavigateToFavorited();

            FavoritesPageObject page = new FavoritesPageObject(TestProperties.driver);

            foreach (var product in page.GetFavoritedList())
            {
                if (product.Text.ToString() == FavoriteHelper.FavoritedProduct)
                {
                    Assert.That(product.Text.ToString, Is.EqualTo(FavoriteHelper.FavoritedProduct));
                    Console.WriteLine("The product you have added is in your favorite list");
                }
            }

            TestProperties.driver.Manage().Window.Maximize();
            System.Threading.Thread.Sleep(300);
        }