public void TestInitialize()
        {
            driver = WebDriverFactory.CreateDriver(
                MajorWebDriver.Chrome,
                WindowSize.DefaultDesktop);

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton(driver);
            serviceCollection.AddSingleton(new PageSettings
            {
                BaseUrl = new Uri("http://nopcommerce410.local/")
            });

            pageObjectFactory = new PageObjectFactory(serviceCollection);
            var homePage = pageObjectFactory.PreparePage <IHomePage>();

            // This verifies that there are at least two products in the cart.
            cartPage = homePage
                       .Login("*****@*****.**", "admin")
                       .Search("adidas consortium")
                       .GetResults()
                       .First()
                       .GoToProductPage()
                       .SetAttribute(
                term =>
            {
                return(term.TextHelper().InnerText.StartsWith(
                           "size",
                           StringComparison.OrdinalIgnoreCase));
            },
                detail =>
            {
                var select = new SelectElement(
                    detail.FindElement(
                        By.CssSelector("select")));

                select.SelectByIndex(2);
            })
                       .AddToCart()
                       .SetAttribute(
                term =>
            {
                return(term.TextHelper().InnerText.StartsWith(
                           "color",
                           StringComparison.OrdinalIgnoreCase));
            },
                detail =>
            {
                var blueColor = detail.FindElement(
                    By.CssSelector("li:nth-child(2) label"));

                blueColor.Click();
            })
                       .SetQuantity(4)
                       .AddToCart()
                       .GoToShoppingCart();

            orderSummary = cartPage.OrderSummary;
        }
 public TestsForECommerce(IRegistrationAndLogin registrationAndLogin,
                          IBasePageAndNavigation basePageAndNavigation,
                          ICartPage cartPage,
                          ISearchPage searchPage)
 {
     _registrationAndLogin  = registrationAndLogin;
     _basePageAndNavigation = basePageAndNavigation;
     _cartPage   = cartPage;
     _searchPage = searchPage;
 }