public void EditProductDescription_DescriptionTest_ShouldReturnProductWithChangedDescription()
        {
            Driver.Navigate().GoToUrl(_url);
            var helper = new LoginHelper(Driver);

            helper.LoginToSystem();

            var firstEditButton =
                Driver.FindElements(By.CssSelector("a button")).First();

            firstEditButton.Click();

            var editName = "DescriptionTest";

            var editPage = new EditProductPage(Driver);

            editPage.FillDescriptionTextField(editName);
            editPage.ClickSubmitButton();

            var firstProductDescription =
                Driver.FindElements(By.TagName("h6")).First();

            Assert.Contains(editName, firstProductDescription.Text);
            Assert.Equal(_url + "/admin/products/save", Driver.Url);
        }
        public void EditProductDescription_Empty_ShouldReturnErrorMessage()
        {
            Driver.Navigate().GoToUrl(_url);
            var helper = new LoginHelper(Driver);

            helper.LoginToSystem();

            var firstEditButton =
                Driver.FindElements(By.CssSelector("a button")).First();

            firstEditButton.Click();

            var editName = "";

            var editPage = new EditProductPage(Driver);

            editPage.FillDescriptionTextField(editName);
            editPage.ClickSubmitButton();

            var errorMessage = Driver.FindElement(By.Id("Description-error")).Text;

            Assert.Contains("Description is required", errorMessage);
        }
        public void EditProductPrice_PriceIsText_ShouldReturnErrorMessage()
        {
            Driver.Navigate().GoToUrl(_url);
            var helper = new LoginHelper(Driver);

            helper.LoginToSystem();

            var firstEditButton =
                Driver.FindElements(By.CssSelector("a button")).First();

            firstEditButton.Click();

            var editName = "abcds";

            var editPage = new EditProductPage(Driver);

            editPage.FillPriceTextField(editName);
            editPage.ClickSubmitButton();

            var errorMessage = Driver.FindElement(By.Id("Price-error")).Text;

            Assert.Contains($"The value '{editName}' is not valid for Price.", errorMessage);
        }