public static void LoginWithYourUser(string username, string password)
        {
            IWebElement LoginButton     = DriverForChrome.FindElement(By.Id("myAccount"));
            IWebElement LoginButtonLink = DriverForChrome.FindElement(By.Id("login"));


            LoginButton.Click();
            LoginButtonLink.Click();

            try
            {
                Base.WhereIAm("LoginPage");
                IWebElement LoginPageHeader = DriverForChrome.FindElement(By.ClassName("login-container"));
                IWebElement LoginButtonas   = DriverForChrome.FindElement(By.CssSelector("button[class*='btn-login-submit']"));


                Task.Delay(2000).Wait();
                IWebElement Email = DriverForChrome.FindElement(By.Id("email"));
                IWebElement Pwd   = DriverForChrome.FindElement(By.Id("password"));

                Email.SendKeys(username);
                Pwd.SendKeys(password);
                LoginButtonas.Click();
            }
            catch (Exception)
            {
                Assert.Fail("Login Page açilamadı");
            }
        }
        public static void CheckSellerAndClickTheCheckBoxes(int count)
        {
            IWebElement         SellerFilter     = DriverForChrome.FindElement(By.CssSelector("li[class*='box-container satici']"));
            IList <IWebElement> SellerCheckBoxes = SellerFilter.FindElements(By.TagName("li"));

            SellerCheckBoxes[count].Click();
            Task.Delay(2000).Wait();
        }
        public static void LoginCheck()
        {
            IWebElement LoginButton = DriverForChrome.FindElement(By.Id("myAccount"));

            try
            {
                LoginButton.Text.Contains("Giriş Yap").ToString();
            }
            catch (Exception)
            {
                Assert.Fail("Login durumdasınız");
            }
        }
Beispiel #4
0
        public static void ClickBasketButton()
        {
            IWebElement ClickTheBasket = DriverForChrome.FindElement(By.Id("CartButton"));

            try
            {
                ClickTheBasket.Click();
            }
            catch (Exception)
            {
                Assert.Fail("Basket butonuna tıklanamadı");
            }
        }
        public static void SearchProducts(string productname)
        {
            IWebElement SearcButton = DriverForChrome.FindElement(By.Id("buttonProductSearch"));
            IWebElement Search      = DriverForChrome.FindElement(By.Id("productSearch"));

            Search.Clear();
            Search.SendKeys(productname);

            try
            {
                SearcButton.Click();
                Base.WhereIAm("SearchResult");
                IWebElement SearchResultPage = DriverForChrome.FindElement(By.ClassName("results-container"));
            }
            catch (Exception)
            {
                Assert.Fail("Search sayfası bulunamadı!");
            }
        }
        public static void ClearFilterSelection()
        {
            IWebElement ClearSelections = DriverForChrome.FindElement(By.Id("btnClearFilters"));

            ClearSelections.Click();
        }