Ejemplo n.º 1
0
        public static void DeleteComment(String comment)
        {
            var commentRootElem = SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(comment));
            var childs          = SeleniumGetMethods.GetChilds(commentRootElem);
            var editeButton     = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetFirstChild((IWebElement)childs[3]));
            var delete          = SeleniumGetMethods.GetNextSibling(editeButton);

            delete.Click();
        }
Ejemplo n.º 2
0
        public static void GetRole(UserRole userRole)
        {
            const int SELECT_ROLE_INDEX_IN_DOM = 4;
            const int SAVE_BUTTON_INDEX_IN_DOM = 5;
            var       tr     = SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(userRole.Username)));
            var       select = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SELECT_ROLE_INDEX_IN_DOM, tr));

            SeleniumSetMethods.SelectDropDown(select, userRole.Role);
            Sincronize.Wait(2000);
            var save = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(SAVE_BUTTON_INDEX_IN_DOM, tr));

            save.Click();
        }
Ejemplo n.º 3
0
        public void TestUserStory1()
        {
            try
            {
                const String INPUT_FILE = "SignUpTest.xml";
                SignUpUser   user       = XML.DeserializeObject <SignUpUser>(FileUtils.CreateInputPath(INPUT_FILE));

                PropertiesCollection.OpenURL(Constants.START_URL);
                Panel.Log_Click();
                SeleniumGetMethods.GetWebElementInnerHTML("Inregistrati-va").Click();
                Authentication.SignUp(user);
            }
            catch (Exception ex)
            {
                Logger.LogException("", ex);
                Assert.Fail(ex.Message);
            }
        }
Ejemplo n.º 4
0
        //For FireFox
        public static void WaitLoadElementByInnerHTML(String innerHTML, int seconds)
        {
            int time = 0;

            try
            {
                var element = SeleniumGetMethods.GetWebElementInnerHTML(innerHTML);
            }
            catch (NoSuchElementException ex)
            {
                time = time + 600;
                System.Threading.Thread.Sleep(100);
                if (time < seconds)
                {
                    WaitLoadElementByInnerHTML(innerHTML, seconds);
                }
            }
        }
Ejemplo n.º 5
0
        public static void EditeComment(String originalComment, String newComment, bool append)
        {
            var commentRootElem = SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(originalComment));
            var childs          = SeleniumGetMethods.GetChilds(commentRootElem);
            var editeButton     = SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetFirstChild((IWebElement)childs[3]));

            editeButton.Click();
            var textarea = SeleniumGetMethods.GetWebElementByName("ctl00$MainContent$AddMessageLoginView$EditMessageTB");

            if (!append)
            {
                textarea.Clear();
            }
            else
            {
            }
            textarea.SendKeys(newComment);
            var addCommentButton = SeleniumGetMethods.GetWebElementByAttribut("value", "Salveaza");

            addCommentButton.Click();
        }
Ejemplo n.º 6
0
 public static void Contact_Click()
 {
     SeleniumGetMethods.GetWebElementInnerHTML("Contact").Click();
 }
Ejemplo n.º 7
0
 public static void Galerie_Click()
 {
     SeleniumGetMethods.GetWebElementInnerHTML("Galerie").Click();
 }
Ejemplo n.º 8
0
 public static void Administrare_Click()
 {
     SeleniumGetMethods.GetWebElementInnerHTML("Administrare").Click();
 }
Ejemplo n.º 9
0
 public static void NavigateToSubject(String subject)
 {
     SeleniumGetMethods.Parent(SeleniumGetMethods.Parent(SeleniumGetMethods.GetWebElementInnerHTML(subject))).Click();
 }
Ejemplo n.º 10
0
        public static void NavigateToCategory(String category)
        {
            var title = SeleniumGetMethods.Parent(SeleniumGetMethods.GetParentNode(SeleniumGetMethods.GetWebElementInnerHTML(category)));

            SeleniumGetMethods.GetFirstChild(SeleniumGetMethods.GetChild(2, title)).Click();
        }
Ejemplo n.º 11
0
 public static void ProfilulMeu_Click()
 {
     SeleniumGetMethods.GetWebElementInnerHTML("Profilul meu").Click();
 }