Exemplo n.º 1
0
        public void Checkout_NavigateToCheckoutWithNoItems_URLIsCart()
        {
            AddressTests.RemoveAllAddresses(driver);
            AddressTests.AddDefaultAddresses(driver);
            CartTests.ClearCart(driver);
            driver.Navigate().GoToUrl(homeURL + checkoutURL);
            Assert.AreEqual(driver.Url, homeURL + CartTests.cartURL);
            IWebElement message = driver.FindElement(By.Id("TempMessage"));

            Assert.AreEqual(message.Text, "Unable to checkout with no items in cart.");
        }
Exemplo n.º 2
0
        public void Checkout_NavigateToCheckoutWithNoAddresses_URLIsAddresses()
        {
            AddressTests.RemoveAllAddresses(driver);
            CartTests.ClearCart(driver);
            CartTests.AddFirstGameWithPriceToCart(driver, 20);
            CartTests.SetFirstGameFormat(driver, false);
            IWebElement cart = driver.FindElement(By.LinkText("Cart"));

            cart.Click();
            IWebElement checkout = driver.FindElement(By.Id("Checkout"));

            checkout.Click();
            Assert.AreEqual(driver.Url, homeURL + AddressTests.addressesUrl);
        }
Exemplo n.º 3
0
        public static string SetupValidCartOneGame(CVGSTestContainer container, IWebDriver dri, double gamePrice, bool isDigitalGame = true)
        {
            container.LoginAsMember();
            AddressTests.RemoveAllAddresses(dri);
            AddressTests.AddDefaultAddresses(dri);
            CartTests.ClearCart(dri);
            string result = CartTests.AddFirstGameWithPriceToCart(dri, gamePrice);

            CartTests.SetFirstGameFormat(dri, isDigitalGame);
            IWebElement cart = dri.FindElement(By.LinkText("Cart"));

            cart.Click();
            IWebElement checkout = dri.FindElement(By.Id("Checkout"));

            checkout.Click();
            return(result);
        }