public static bool ModificarRedSocial(string id, string nombre, string url, string icono, bool status)
        {
            HomePageBL homePageBL = new HomePageBL();
            bool       ok         = false;

            if (id == "")
            {
                ok = false;
            }
            else
            {
                RedSocialBE objRS = new RedSocialBE
                {
                    IdRedSocial = Convert.ToInt32(id),
                    Nombre      = nombre,
                    Url         = url,
                    IdIcono     = Convert.ToInt32(icono),
                    Activo      = status
                };

                ok = homePageBL.updateRS(objRS);
            }

            return(ok);
        }
        public static bool ActualizarContacto(string id, string nombre, string icono)
        {
            HomePageBL homePageBL = new HomePageBL();
            bool       ok         = false;

            if (id == "")
            {
                ok = false;
            }
            else
            {
                ContactoBE objContacto = new ContactoBE
                {
                    IdContacto = Convert.ToInt32(id),
                    Nombre     = nombre,
                    IdIcono    = Convert.ToInt32(icono)
                };

                bool resp = homePageBL.updateContacto(objContacto);

                ok = true;
            }

            return(ok);
        }
        private void modificarAbout()
        {
            AboutBE    aboutBE    = new AboutBE();
            HomePageBL homePageBL = new HomePageBL();

            try
            {
                aboutBE.IdAbout     = Convert.ToInt32(txtId.Text);
                aboutBE.Titulo      = txtTitulo.Text;
                aboutBE.Descripcion = txtDesc.Text;

                aboutBE.Logo = subirImagen();

                aboutBE.ImagenFondo = subirImagenBg();


                homePageBL.updateAbout(aboutBE);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "randomtext", "alertError('" + ex.Message + "')", true);
            }
            finally
            {
                ClientScript.RegisterStartupScript(this.GetType(), "randomtext", "alertUpdateSuccess('Se modifico con exito')", true);
                limpiarCamposAbout();
            }
        }
示例#4
0
        public void EmptyShoppingCartDropDownTest()
        {
            HomePageBL homePage = new HomePageBL(webDriver);

            string actualMessage = homePage.OpenEmptyShoppingCartDropDown().NoItemsTitle.Text;

            Assert.AreEqual(TestsData.emptyShoppingCartDropDownMessage, actualMessage);
        }
示例#5
0
        private void verContacto()
        {
            HomePageBL homePageBL = new HomePageBL();

            DataSet ds = homePageBL.allContactosRp();

            rpContacto.DataSource = ds.Tables[0];
            rpContacto.DataBind();
        }
示例#6
0
        private void verRedSocial()
        {
            HomePageBL homePageBL = new HomePageBL();

            DataSet ds = homePageBL.allRSActive();

            rpRs.DataSource = ds.Tables[0];
            rpRs.DataBind();
        }
        public static bool DeleteContacto(string id)
        {
            HomePageBL homePageBL = new HomePageBL();


            bool resp = homePageBL.deleteContacto(Convert.ToInt32(id));

            return(true);
        }
        public void SearchTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .GetSearchComponentBL()
            .SearchText("Tank");
            new SearchPageBL(webDriver)
            .GetListOfProductNames();
        }
示例#9
0
        public void TotalPriceShoppingCartDropDownTest()
        {
            HomePageBL homePageBL = new HomePageBL(webDriver);

            double actualTotalPrice = homePageBL
                                      .SearchingAndAddingToCartProducts(TestsData.productsNames)
                                      .OpenNotEmptyShoppingCartDropDown()
                                      .GetTotalPrice();

            Assert.AreEqual(TestsData.totalPriceOfProducts, actualTotalPrice);
        }
        public void RegistrationTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnCreateAnAccountButton()
            .CreateAnAccount();

            var expectedResult = "My Account";
            var actualResult   = new SuccessfulRegistrationPageBL(webDriver).GetMyAccountTitle();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
        public void AuthorizationTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount();

            var expectedResult = "Welcome";
            var actualResult   = new SuccessfulLoginPageBL(webDriver).GetWelcomeMessage();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
示例#12
0
        public void CounterItemsShoppingCartDropDownTest()
        {
            HomePageBL homePageBL = new HomePageBL(webDriver);

            int actualCounter = homePageBL
                                .SearchingAndAddingToCartProducts(TestsData.productsNames).
                                OpenNotEmptyShoppingCartDropDown()
                                .GetProductsNumber();

            int expectedCounter = TestsData.productsNames.Count;

            Assert.AreEqual(expectedCounter, actualCounter);
        }
        private void verDatosRS()
        {
            DataSet    ds         = new DataSet();
            HomePageBL homePageBL = new HomePageBL();

            ds = homePageBL.allRS();

            if (ds.Tables.Count > 0)
            {
                rpRS.DataSource = ds.Tables[0];
                rpRS.DataBind();
            }
        }
        public void TryToRegistrationWithEmptyFieldsTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnCreateAnAccountButton()
            .TryToCreateAnAccountWithEmptyFields();

            var expectedResult = "This is a required field";
            var actualResult   = new RegistrationPageBL(webDriver).GetErrorMessage();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
        //END ABOUT US

        // CONTACTO
        private void verDatosContacto()
        {
            DataSet    ds         = new DataSet();
            HomePageBL homePageBL = new HomePageBL();

            ds = homePageBL.allContactos();

            if (ds.Tables.Count > 0)
            {
                rpContacto.DataSource = ds.Tables[0];
                rpContacto.DataBind();
            }
        }
        public void AddProductToCompareListIconTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .AddProductToCompareList();

            var expectedResult = "You added product";
            var actualResult   = new SuccessfulLoginPageBL(webDriver).GetSuccessfulAddedProductMessage();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
示例#17
0
        public void AddingProductsToShoppingCartDropDownTest()
        {
            HomePageBL homePageBL = new HomePageBL(webDriver);

            List <string> actualProductNameList = homePageBL
                                                  .SearchingAndAddingToCartProducts(TestsData.productsNames)
                                                  .OpenNotEmptyShoppingCartDropDown()
                                                  .GetProductsNames();

            foreach (string element in TestsData.productsNames)
            {
                Assert.Contains(element, actualProductNameList);
            }
        }
        public void OpenCompareProductsPageThroughLinkTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .AddProductToCompareList()
            .GoToCompareProductsPage();

            var expectedResult = "Compare Products";
            var actualResult   = new CompareProductsPageBL(webDriver).GetCompareProductsPageTitle();

            Assert.AreEqual(expectedResult, actualResult);
        }
        private void iconoContactoRs()
        {
            HomePageBL homePageBL = new HomePageBL();
            DataSet    ds         = new DataSet();

            ds = homePageBL.allIcons();

            if (ds.Tables[0].Rows.Count > 0)
            {
                ddlIcon.DataSource     = ds.Tables[0];
                ddlIcon.DataTextField  = "Nombre";
                ddlIcon.DataValueField = "IdIcono";
                ddlIcon.DataBind();
            }
        }
        public void TryToRegistrationWithWrongFormateDataTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnCreateAnAccountButton()
            .TryToCreateAnAccountWithWrongFormatData();

            var expectedResult = "Minimum of different classes of characters in password is 3." +
                                 " Classes of characters: Lower Case, Upper Case, Digits, Special Characters.";

            var actualResult = new RegistrationPageBL(webDriver).GetErrorMessageWrongPasswordFormat();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
示例#21
0
        private void aboutUs()
        {
            HomePageBL homePageBL = new HomePageBL();
            DataSet    ds         = new DataSet();

            ds = homePageBL.getIdAbout(1);
            if (ds.Tables[0].Rows.Count > 0)
            {
                hTitle.InnerText = ds.Tables[0].Rows[0]["Titulo"].ToString();
                pDesc.InnerText  = ds.Tables[0].Rows[0]["Descripcion"].ToString();
                imgLogo.Src      = ds.Tables[0].Rows[0]["Logo"].ToString();
                string imgFondo = ds.Tables[0].Rows[0]["ImagenFondo"].ToString();
                about.Attributes.Add("style", "background: url(" + imgFondo + ") no-repeat center center fixed;");
            }
        }
        // ABOUT US

        // VER DATATABLE
        private void verDatosAbout()
        {
            DataSet    ds         = new DataSet();
            HomePageBL homePageBL = new HomePageBL();

            ds = homePageBL.allAbout();

            if (ds.Tables.Count > 0)
            {
                txtId.Text       = ds.Tables[0].Rows[0]["ID"].ToString();
                txtTitulo.Text   = ds.Tables[0].Rows[0]["Titulo"].ToString();
                txtDesc.Text     = ds.Tables[0].Rows[0]["Descripcion"].ToString();
                imgLogo.ImageUrl = ds.Tables[0].Rows[0]["Logo"].ToString();
                imgBg.ImageUrl   = ds.Tables[0].Rows[0]["ImagenFondo"].ToString();
            }
        }
        public static bool EliminarRedSocial(string id)
        {
            HomePageBL homePageBL = new HomePageBL();
            bool       ok         = false;

            if (id == "")
            {
                ok = false;
            }
            else
            {
                ok = homePageBL.deleteRS(Convert.ToInt32(id));
            }

            return(ok);
        }
        public void AddFromCompareListToShoppingCartTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .AddProductToCompareList()
            .GoToCompareProductsPage()
            .AddProductToCart();

            var expectedResult = "shopping cart";
            var actualResult   = new CompareProductsPageBL(webDriver).GetAddedProductToCartMessage();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
        public void OpenCompareProductsPageTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .ClickOnProductContainer()
            .ClickOnAddToCompareButton()
            .GoToMyAccountPage()
            .ClickOnCompareButton();

            var expectedResult = "Compare Products";
            var actualResult   = new CompareProductsPageBL(webDriver).GetCompareProductsPageTitle();

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void ClearAllCompareListTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .ClickOnProductContainer()
            .ClickOnAddToCompareButton()
            .GoToMyAccountPage()
            .ClearCompareProductsList();

            var expectedResult = "You cleared the comparison list.";
            var actualResult   = new MyAccountPageBL(webDriver).GetClearedListMessage();

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void RemoveComparedProductXTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .ClickOnProductContainer()
            .ClickOnAddToCompareButton()
            .GoToMyAccountPage()
            .DeleteCompareProductX();

            var expectedResult = "You removed product";
            var actualResult   = new MyAccountPageBL(webDriver).GetDeletedProductMessage();

            Assert.IsTrue(actualResult.Contains(expectedResult));
        }
        public void AddFromCompareListToWishListTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .AddProductToCompareList()
            .GoToCompareProductsItemsPage()
            .AddProductToWishList();

            var firstExpectedResult  = "My Wish List";
            var secondExpectedResult = "added to your Wish List";

            var firstActualResult  = new WishListPageBL(webDriver).GetWishListTitle();
            var secondActualResult = new WishListPageBL(webDriver).GetAddedProductToWishListMessage();

            Assert.AreEqual(firstExpectedResult, firstActualResult);
            Assert.IsTrue(secondActualResult.Contains(secondExpectedResult));
        }
示例#29
0
        public void RemoveProductTest()
        {
            HomePageBL homePageBL = new HomePageBL(webDriver);

            List <string> actualProductList = homePageBL
                                              .SearchingAndAddingToCartProducts(TestsData.productsNames)
                                              .OpenNotEmptyShoppingCartDropDown()
                                              .OpenShoppingCartPage()
                                              .RemoveProduct(TestsData.removedProductName)
                                              .GetProductsNames();

            List <string> expectedProductList = TestsData.productsNames;

            expectedProductList.Remove(TestsData.removedProductName);

            foreach (string element in expectedProductList)
            {
                Assert.Contains(element, actualProductList);
            }
        }
        public void RemoveComparedProductTest()
        {
            var homePage = new HomePageBL(webDriver);

            homePage
            .ClickOnMainSignInButton()
            .LogIntoAccount()
            .AddProductToCompareList()
            .GoToCompareProductsItemsPage()
            .DeleteItemFromProductPage();

            var firstExpectedResult  = "You have no items to compare.";
            var secondExpectedResult = "You removed product";

            var firstActualResult  = new CompareProductsPageBL(webDriver).GetEmptyListMessage();
            var secondActualResult = new CompareProductsPageBL(webDriver).GetDeletedProductMessage();

            Assert.AreEqual(firstExpectedResult, firstActualResult);
            Assert.IsTrue(secondActualResult.Contains(secondExpectedResult));
        }