示例#1
0
 public void WishlistSortingTest()
 {
     TestAction(() =>
     {
         string currentTestName = "WishlistSortingTest";
         log.Debug("Starting " + currentTestName + " Test;");
         log.Debug("For user " + user.FirstName + user.LastName + ";");
         HomePage home = new HomePage(driverForRun, false);
         //SignInPage signin = new SignInPage(driverForRun);
         //Assume.That(signin.Login(user), "Failed login, test will not run");
         //Assume.That(ValidateUser(user), "Logged-in account is not a user");
         SmallSleep();
         ProductHandler handler       = new ProductHandler(driverForRun, home);
         int[] selectedProductIndexes = new int[] { 1, 2, 3, 4, 5, 6, 7 };
         try
         {
             handler.BuildProductCollection(selectedProductIndexes, ProductCategories.Top_deals);
             handler.AddProdutRangeToContainer(selectedProductIndexes, ProductContainer.WishList, ProductCategories.Top_deals);
             handler.SortProducts(ProductContainer.WishList, SortingMethods.Brand);
             handler.ValidateProductSorting(SortingMethods.Brand);
             handler.SortProducts(ProductContainer.WishList, SortingMethods.Price, true);
             handler.ValidateProductSorting(SortingMethods.Price);
             handler.SortProducts(ProductContainer.WishList, SortingMethods.Rating);
             handler.ValidateProductSorting(SortingMethods.Rating);
         }
         finally
         {
             List <Product> cleanUpCollection = handler.GetCurrentProductsList(ProductContainer.WishList);
             foreach (var product in cleanUpCollection)
             {
                 handler.RemoveProductFromContainer(ProductContainer.WishList, InterctionControlSet.Product_Title, product);
             }
         }
     });
 }