예제 #1
0
 public void ClickOnMenu_RequestsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(requests_btn, 20);
     Klick.On(requests_btn);
 }
예제 #2
0
        public bool ClickOnMenu_HierarchyBtn()
        {
            Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
            Pages.PearlRedMenuPage.ClickOnMainMenuBtn();

            WaitFind.FindElem(hierarchy_btn, 20);
            //  Driver.ngDriver.FindElement(hierarchy_btn);
            Klick.On(hierarchy_btn);
            //  Driver.ngDriver.WaitForAngular();


            if (!Pages.IsAt(PageName.PearlHierarchyPage))
            {
                Console.WriteLine("Not at Hierarchy Page-Trying again and Ignore the exception");
                Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
                Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
                WaitFind.FindElem(hierarchy_btn, 20);
                Klick.On(hierarchy_btn);
                //      Console.WriteLine("After trying again");
                //   Driver.ngDriver.WaitForAngular();

                //   Thread.Sleep(KortextGlobals.s);
                if (!Pages.IsAt(PageName.PearlHierarchyPage))
                {
                    Console.WriteLine("Unable to reach Hierarchy page");
                    return(false);
                }
                return(true);
                //   Driver.Instance.Navigate().Refresh();
            }
            return(true);
        }
예제 #3
0
 public void ClickOnMenu_PermissionsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(permissions_btn, 20);
     Klick.On(permissions_btn);
 }
예제 #4
0
 public void ClickOnMenu_AcquisitionsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(acquisitions_btn, 20);
     Klick.On(acquisitions_btn);
 }
예제 #5
0
 public void ClickOnMenu_NoticesBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(notices_btn, 20);
     Klick.On(notices_btn);
 }
예제 #6
0
        public bool ClickOnMenu_UserBtn()
        {
            Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
            Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
            WaitFind.FindElem(user_btn, 20);
            Klick.On(user_btn);

            if (!Pages.IsAt(PageName.PearlUserPage))
            {
                Console.WriteLine("Not at Users Page-Trying again and Ignore the exception");
                Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
                Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
                WaitFind.FindElem(user_btn, 20);
                Klick.On(user_btn);
                //      Console.WriteLine("After trying again");

                Thread.Sleep(KortextGlobals.s);
                if (!Pages.IsAt(PageName.PearlUserPage))
                {
                    Console.WriteLine("Unable to reach Users page");
                    return(false);
                }
                return(true);
                //   Driver.Instance.Navigate().Refresh();
            }
            return(true);
        }
예제 #7
0
 public void ClickOnMenu_SettingsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(settings_btn, 20);
     Klick.On(settings_btn);
 }
예제 #8
0
 public void ClickOnMenu_MaterialsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(materials_btn, 20);
     Klick.On(materials_btn);
 }
예제 #9
0
 public void ClickOnMenu_AboutBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(about_btn, 20);
     Klick.On(about_btn);
 }
예제 #10
0
/****************************************************************
 * Accessing the sidebar menu items. Validation that they worked is left
 *  to the calling function.
 *
 *  ****************************************************************/
        public void ClickOnLoginBtn()
        {
            Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
            Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
            WaitFind.FindElem(login_btn, 20);
            Klick.On(login_btn);
        }
예제 #11
0
        public void AddNewRole(string searchtext, string desctext)
        {
            Thread.Sleep(KortextGlobals.s);
            Klick.On(NewUserTypeButton);
            Thread.Sleep(KortextGlobals.s);

            Klick.On(RoleName);
            Thread.Sleep(KortextGlobals.s);
            WaitFind.FindElem(TypeNameDescTextField, 10).Clear();
            Klick.On(TypeNameDescTextField);
            Thread.Sleep(KortextGlobals.s);
            TypeNameDescTextField.SendKeys(searchtext);
            Thread.Sleep(KortextGlobals.s);
            Klick.On(NameDescSubmitButton);

            Klick.On(RoleDesc);
            Thread.Sleep(KortextGlobals.s);
            WaitFind.FindElem(TypeNameDescTextField, 10).Clear();
            Klick.On(TypeNameDescTextField);
            Thread.Sleep(KortextGlobals.s);
            TypeNameDescTextField.SendKeys(desctext);
            Thread.Sleep(KortextGlobals.s);
            Klick.On(NameDescSubmitButton);
            statusreturntext = Pages.PearlEditBuffer.StatusMessage();
            if (statusreturntext != "User type created")
            {
                Console.WriteLine("Error while Creating a User Role." + statusreturntext);
            }
            else
            {
                Console.WriteLine("User Role Created Successful");
            }
            SearchRoles(searchtext);
        }
예제 #12
0
        /// <summary>
        /// Perform Login actions
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        private void PerformLogin(string username, string password)
        {
            try
            {
                Thread.Sleep(KortextGlobals.s);
                //   Console.WriteLine("Clicking main menu btn");
                // Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
                // Console.WriteLine("after Clicking main menu btn");
                Pages.LandingPage.ClickOnLoginBtn();
                //  Console.WriteLine("Clicking login");
                // Klick.On(MenuLogin);

                WaitFind.FindElem(UsernameTxtBox, 10).Clear();
                UsernameTxtBox.SendKeys(username);
                PasswordTxtBox.Clear();
                PasswordTxtBox.SendKeys(password);
                WaitFind.FindElem(loginButton, 10).Click();
                //  Klick.On(loginButton);
                //   Console.WriteLine(ToasterText.GetStatusMessage());
                Thread.Sleep(KortextGlobals.s);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception in PerformLogin: " + e.Message);
            }
        }
예제 #13
0
 private string SearchAndReturnNewTagName(string username)
 {
     //search for TestUser and increment suffix until you find one that hasn't been created yet.
     //Return that user name to be added.
     usernameappend = 1;
     for (int i = 0; i < i + 1; i++)
     {
         UserNameText = username + usernameappend;
         WaitFind.FindElem(FilterTagTextField, 10).Clear();
         Klick.On(FilterTagTextField);
         Thread.Sleep(KortextGlobals.s);
         FilterTagTextField.SendKeys(UserNameText);
         Thread.Sleep(KortextGlobals.s);
         try
         {
             List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection")));
             if (TagsSearched.Count > 0)
             {
                 usernameappend = usernameappend + 1;
             }
             else
             {
                 Console.WriteLine("Username found" + UserNameText);
                 return(UserNameText);
             }
         }
         catch (Exception e)
         {
             Console.WriteLine("Search -" + UserNameText + " User Not Found; Using this username " + e.Message);
             return(UserNameText);
         }
     }
     return(UserNameText);
 }
예제 #14
0
        public void SearchMaterial(string searchtext)
        {
            WaitFind.FindElem(MaterialNameSearchTextField, 10).Clear();
            Klick.On(MaterialNameSearchTextField);
            Thread.Sleep(KortextGlobals.s);
            MaterialNameSearchTextField.SendKeys(searchtext);
            Thread.Sleep(KortextGlobals.s);
            Klick.On(MaterialNameSearchButton);
            Thread.Sleep(KortextGlobals.l);

            List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection")));

            //IList<IWebElement> MaterialsSearchResults = Driver.Instance.FindElements(MaterialSearchResults_locator);
            if (MaterialsSearched.Count > 0)
            {
                Console.WriteLine("Materials present for the Searched text");

                /*
                 * foreach(IWebElement MaterialSearched in MaterialsSearched)
                 * {
                 *  ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched);
                 *  IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator);
                 *  Driver.HighlightElement(MaterialTitle);
                 *  Console.WriteLine("Material Title: " + MaterialTitle.Text);
                 * }
                 */
            }
            else
            {
                Console.WriteLine("No Materials present for the Searched text");
            }
        }
예제 #15
0
 private string SearchAndReturnNewNoticeName(string username)
 {
     //search for TestUser and increment suffix until you find one that hasn't been created yet.
     //Return that user name to be added.
     usernameappend = 1;
     for (int i = 0; i < i + 1; i++)
     {
         int found_flag = 0;
         UserNameText = username + usernameappend;
         Thread.Sleep(KortextGlobals.s);
         IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator);
         if (SearchNoticeField.Count > 0)
         {
             WaitFind.FindElem(SearchNoticeField[1], 10).Clear();
             Klick.On(SearchNoticeField[1]);
             Thread.Sleep(KortextGlobals.s);
             SearchNoticeField[1].SendKeys(UserNameText);
             Thread.Sleep(KortextGlobals.s);
             try
             {
                 List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection")));
                 if (NoticesSearched.Count > 0)
                 {
                     foreach (IWebElement NoticeSearched in NoticesSearched)
                     {
                         Driver.HighlightElement(NoticeSearched);
                         IWebElement NoticeName = NoticeSearched.FindElement(NoticeName_locator);
                         if (NoticeName.Text == UserNameText)
                         {
                             found_flag     = 1;
                             usernameappend = usernameappend + 1;
                             break;
                         }
                     }
                     if (found_flag == 0)
                     {
                         Console.WriteLine("Notice Name found." + UserNameText);
                         return(UserNameText);
                     }
                 }
                 else
                 {
                     Console.WriteLine("Notice Name found." + UserNameText);
                     return(UserNameText);
                 }
             }
             catch (Exception e)
             {
                 Console.WriteLine("Search -" + UserNameText + " Notice Not Found; Using this Notice Name " + e.Message);
                 return(UserNameText);
             }
         }
         else
         {
             Console.WriteLine("Could not find the Search Field in SearchName function.");
         }
     }
     return(UserNameText);
 }
예제 #16
0
 public void Do_Logout()
 {
     Thread.Sleep(KortextGlobals.s);
     //    Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(LogOut, 20);
     Klick.On(LogOut);
 }
예제 #17
0
        public void ClickOnBrowseBtn()
        {
            //   var browseButton = TestBase.driver.FindElement(By.Id("navbar-browse"));
            //   Instance.FindElement(By.Id("wp-submit"));
            //   browseButton.Click();

            WaitFind.FindElem(browse_icon, 20);
            Klick.On(browse_icon);
        }
예제 #18
0
/*************************************************************************************************
 *
 *          SEARCH FUNCTIONS
 *
 ************************************************************************************************/
        public string SearchRebus(string searchstr)
        {
            Thread.Sleep(KortextGlobals.s);
            //make sure search box on screen then clear it
            WaitFind.FindElem(searchinputbox, 10).Clear();
            searchinputbox.SendKeys(searchstr);
            Thread.Sleep(KortextGlobals.l);
            WaitFind.FindElem(SearchResultString, 30);
            Driver.HighlightElement(SearchResultString);
            Console.WriteLine("searchresults: " + SearchResultString.Text);
            return(SearchResultString.Text);
        }
예제 #19
0
 public string GetMessage()
 {
     try
     {
         WaitFind.FindElem(LoginError, 20);
         return(LoginError.Text);
     }
     catch (Exception e)
     {
         Console.WriteLine("Exception in GetMessage: " + e.Message);
         return(null);
     }
 }
예제 #20
0
        public void ViewNotice(string searchtext)
        {
            Driver.Instance.Navigate().Refresh();
            Thread.Sleep(KortextGlobals.l);

            IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator);

            if (SearchNoticeField.Count > 0)
            {
                WaitFind.FindElem(SearchNoticeField[1], 10).Clear();
                Klick.On(SearchNoticeField[1]);
                Thread.Sleep(KortextGlobals.s);
                SearchNoticeField[1].SendKeys(searchtext);
                Thread.Sleep(KortextGlobals.s);

                List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection")));
                if (NoticesSearched.Count > 0)
                {
                    foreach (IWebElement NoticeSearched in NoticesSearched)
                    {
                        IWebElement NoticeNameField = NoticeSearched.FindElement(NoticeName_locator);
                        if (NoticeNameField.Text == searchtext)
                        {
                            IWebElement NoticeViewButton = NoticeSearched.FindElement(ViewNotice_locator);
                            Klick.On(NoticeViewButton);
                            if (ViewNoticeHeader.Displayed)
                            {
                                Console.WriteLine("Viewing Notice Successful." + searchtext);
                                Klick.On(NoticeCancelButton);
                                break;
                            }
                            else
                            {
                                Console.WriteLine("Error while Viewing Notice." + searchtext);
                                Driver.Instance.Navigate().Refresh();
                                Thread.Sleep(KortextGlobals.l);
                                break;
                            }
                        }
                    }
                }
                else
                {
                    Console.WriteLine(searchtext + " Notice not found to be Viewed");
                }
            }
            else
            {
                Console.WriteLine("Could not find the Search Field in View Notice function.");
            }
        }
예제 #21
0
 //compares the first list in the search results to the page that comes up when you click it.
 public bool TraveltoFirstResult()
 {
     if (SearchResultString.Text != "Displaying 0 of 0 results found")
     {
         WaitFind.FindElem(SearchResultTableFirst, 10);
         var liststring = SearchResultTableFirst.Text;
         Console.WriteLine("String is: " + liststring);
         Klick.On(SearchResultTableFirst);
         Thread.Sleep(KortextGlobals.ll);
         Console.WriteLine("Title is: " + listtitle.Text);
         //compare the string
         return(listtitle.Text.Contains(liststring));
     }
     return(false);
 }
예제 #22
0
        public void UpdateTag(string oldtagname, string newtagname)
        {
            WaitFind.FindElem(FilterTagTextField, 10).Clear();
            Klick.On(FilterTagTextField);
            Thread.Sleep(KortextGlobals.s);
            FilterTagTextField.SendKeys(oldtagname);
            Thread.Sleep(KortextGlobals.s);

            List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection")));

            if (TagsSearched.Count > 0)
            {
                foreach (IWebElement TagSearched in TagsSearched)
                {
                    IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator);
                    if (TagTitle.Text == oldtagname)
                    {
                        Klick.On(TagTitle);
                        WaitFind.FindElem(TagUpdateTextField, 10).Clear();
                        Klick.On(TagUpdateTextField);
                        Thread.Sleep(KortextGlobals.s);
                        TagUpdateTextField.SendKeys(newtagname);

                        Klick.On(TagUpdateSubmit);
                        statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                        if (statusreturntext == "Tag updated")
                        {
                            Console.WriteLine("Tag Update Successful from " + oldtagname + " to " + newtagname);
                            FilterTags(oldtagname);
                            FilterTags(newtagname);
                        }
                        else
                        {
                            Console.WriteLine("Error while updating tag from " + oldtagname + " to " + newtagname + "." + statusreturntext);
                            FilterTags(oldtagname);
                            FilterTags(newtagname);
                        }
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine(oldtagname + " Tag not found to be updated");
            }
        }
예제 #23
0
        public void DeleteTags(string searchtext)
        {
            WaitFind.FindElem(FilterTagTextField, 10).Clear();
            Klick.On(FilterTagTextField);
            Thread.Sleep(KortextGlobals.s);
            FilterTagTextField.SendKeys(searchtext);
            Thread.Sleep(KortextGlobals.s);

            List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection")));

            if (TagsSearched.Count > 0)
            {
                foreach (IWebElement TagSearched in TagsSearched)
                {
                    IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator);
                    if (TagTitle.Text == searchtext)
                    {
                        try
                        {
                            IWebElement TagFindList = TagSearched.FindElement(TagFindPage_locator);
                        }
                        catch
                        {
                            IWebElement TagDeleteButton = TagSearched.FindElement(TagDelete_locator);
                            Klick.On(TagDeleteButton);
                            statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                            if (statusreturntext != "Tag deleted")
                            {
                                Console.WriteLine("Error while Deleting Tag." + statusreturntext);
                            }
                            else
                            {
                                Console.WriteLine("Deleting Tag Successful");
                            }
                            break;
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine(searchtext + " Tag not found to be deleted");
            }
            Console.WriteLine("Searching Tag after Deleting");
            FilterTags(searchtext);
        }
예제 #24
0
        public void AddNewNotice(string noticetype, string searchtext)
        {
            Thread.Sleep(KortextGlobals.s);
            Klick.On(CreateNoticeButton);
            Thread.Sleep(KortextGlobals.s);
            if (noticetype == "Alert")
            {
                new SelectElement(NoticeTypeList).SelectByIndex(1);
            }
            else if (noticetype == "News")
            {
                new SelectElement(NoticeTypeList).SelectByIndex(2);
            }
            else
            {
                Console.WriteLine("Incorrect Notice Type Passed. Selecting NEWS to continue.");
                new SelectElement(NoticeTypeList).SelectByIndex(2);
            }

            WaitFind.FindElem(NoticeSubjectTextField, 10).Clear();
            Klick.On(NoticeSubjectTextField);
            Thread.Sleep(KortextGlobals.s);
            NoticeSubjectTextField.SendKeys(searchtext);
            Thread.Sleep(KortextGlobals.s);

            WaitFind.FindElem(NoticeBodyTextField, 10).Clear();
            Klick.On(NoticeBodyTextField);
            Thread.Sleep(KortextGlobals.s);
            NoticeBodyTextField.SendKeys("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()?<>,.:;");
            Thread.Sleep(KortextGlobals.s);

            Klick.On(NoticeSaveButton);
            statusreturntext = Pages.PearlEditBuffer.StatusMessage();
            if (statusreturntext != "Message added")
            {
                Console.WriteLine("Error while Creating New Notice." + statusreturntext);
            }
            else
            {
                Console.WriteLine("Creating Notice Successful");
            }
            Thread.Sleep(KortextGlobals.s);
            Console.WriteLine("Searching Notices after Creation.");
            SearchNotices(searchtext);
        }
예제 #25
0
        public void SearchNotices(string searchtext)
        {
            int i = 0;

            Driver.Instance.Navigate().Refresh();
            Thread.Sleep(KortextGlobals.l);

            IList <IWebElement> SearchNoticeField = Driver.Instance.FindElements(SearchField_locator);

            if (SearchNoticeField.Count > 0)
            {
                WaitFind.FindElem(SearchNoticeField[1], 10).Clear();
                Klick.On(SearchNoticeField[1]);
                Thread.Sleep(KortextGlobals.s);
                SearchNoticeField[1].SendKeys(searchtext);
                Thread.Sleep(KortextGlobals.s);

                List <NgWebElement> NoticesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSysMess.displayedCollection")));
                if (NoticesSearched.Count > 0)
                {
                    foreach (IWebElement NoticeSearched in NoticesSearched)
                    {
                        IWebElement NoticeName = NoticeSearched.FindElement(NoticeName_locator);
                        if (NoticeName.Text == searchtext)
                        {
                            Console.WriteLine(searchtext + " Notice found");
                            i = 1;
                            break;
                        }
                    }
                    if (i == 0)
                    {
                        Console.WriteLine(searchtext + " Notice not found");
                    }
                }
                else
                {
                    Console.WriteLine(searchtext + " Notice not found");
                }
            }
            else
            {
                Console.WriteLine("Could not find the Search Field in Search function.");
            }
        }
예제 #26
0
        public void EditGlobalTags(string searchtext)
        {
            SearchMaterial(searchtext);
            List <NgWebElement> MaterialsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminSearch.displayedCollection")));

            if (MaterialsSearched.Count > 0)
            {
                Console.WriteLine("Edit Global Tags Material. Materials present for the Searched text");
                foreach (IWebElement MaterialSearched in MaterialsSearched)
                {
                    ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", MaterialSearched);
                    Driver.HighlightElement(MaterialSearched);
                    IWebElement TagsMaterialButton = MaterialSearched.FindElement(MaterialTags_locator);
                    if (TagsMaterialButton.Displayed)
                    {
                        IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator);
                        Console.WriteLine("Edit Global Tags Material Button found for : " + MaterialTitle.Text);
                        Klick.On(TagsMaterialButton);
                        Thread.Sleep(KortextGlobals.s);
                        WaitFind.FindElem(AddTagTextField, 10);
                        AddTagTextField.SendKeys("GlobalTag");
                        AddTagTextField.SendKeys(Keys.Tab);
                        Thread.Sleep(KortextGlobals.s);
                        Klick.On(TagItemsButton);
                        Thread.Sleep(KortextGlobals.s);
                        List <NgWebElement> TagSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("tag in globalTagsCtrl.item.tags_global track by tag.id")));
                        if (TagSearched.Count == 1)
                        {
                            Console.WriteLine("Edit Global Tags Material Successful");
                            break;
                        }
                        else
                        {
                            Console.WriteLine("Edit Global Tags Material Not Successful." + TagSearched.Count);
                            break;
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("Edit Global Tags Material. No Materials present for the Searched text");
            }
        }
예제 #27
0
 public void AddNewTag(string searchtext)
 {
     WaitFind.FindElem(TagNameSearchTextField, 10).Clear();
     Klick.On(TagNameSearchTextField);
     Thread.Sleep(KortextGlobals.s);
     TagNameSearchTextField.SendKeys(searchtext);
     Thread.Sleep(KortextGlobals.s);
     Klick.On(TagNameSearchButton);
     statusreturntext = Pages.PearlEditBuffer.StatusMessage();
     if (statusreturntext != "Tag created")
     {
         Console.WriteLine("Error while Creating a New Global Tag." + statusreturntext);
     }
     else
     {
         Console.WriteLine("Creating a New Global Tag Successful");
     }
     Thread.Sleep(KortextGlobals.s);
     Console.WriteLine("Searching Tag after Creation");
     FilterTags(searchtext);
 }
예제 #28
0
        public bool PurgeAllLocalStorage()
        {
            ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");
            Thread.Sleep(KortextGlobals.s);
            IList <IWebElement> LinksinAboutPage = Driver.Instance.FindElements(PurgeName_locator);

            if (LinksinAboutPage.Count > 0)
            {
                foreach (IWebElement LinkinAboutPage in LinksinAboutPage)
                {
                    if (LinkinAboutPage.Text == "Purge Local Storage")
                    {
                        Klick.On(LinkinAboutPage);
                        Thread.Sleep(KortextGlobals.s);
                        WaitFind.FindElem(PurgeButton, 10);
                        Klick.On(PurgeButton);

                        statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                        if (statusreturntext == "Local storage purged")
                        {
                            Console.WriteLine("Purging All Local Storage Successful.");
                            return(true);
                        }
                        else
                        {
                            Console.WriteLine("Error while Purging Local Storage." + statusreturntext);
                            return(false);
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("Error Loading About Page.");
                return(false);
            }
            Console.WriteLine("Could Not find Purge link in About Page.");
            return(false);
        }
예제 #29
0
        public void FilterTags(string searchtext)
        {
            int i = 0;

            Driver.Instance.Navigate().Refresh();
            Thread.Sleep(KortextGlobals.ll);
            WaitFind.FindElem(FilterTagTextField, 10).Clear();
            Klick.On(FilterTagTextField);
            Thread.Sleep(KortextGlobals.s);
            FilterTagTextField.SendKeys(searchtext);
            Thread.Sleep(KortextGlobals.s);

            List <NgWebElement> TagsSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminTags.displayedCollection")));

            if (TagsSearched.Count > 0)
            {
                foreach (IWebElement TagSearched in TagsSearched)
                {
                    IWebElement TagTitle = TagSearched.FindElement(TagTitle_locator);
                    if (TagTitle.Text == searchtext)
                    {
                        Console.WriteLine(searchtext + " Tag found");
                        i = 1;
                        break;
                    }
                }
                if (i == 0)
                {
                    Console.WriteLine(searchtext + " Tag not found");
                }
            }
            else
            {
                Console.WriteLine(searchtext + " Tag not found");
            }
        }
예제 #30
0
        public void UpdateRole(string rolenm, string rolefield, string newtext)
        {
            Driver.Instance.Navigate().Refresh();
            Thread.Sleep(KortextGlobals.l);

            List <NgWebElement> UserTypesSearched = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("usertype in usertypes.US.allUsertypes track by usertype.id")));

            if (UserTypesSearched.Count > 0)
            {
                foreach (IWebElement UserTypeSearched in UserTypesSearched)
                {
                    Driver.HighlightElement(UserTypeSearched);
                    IWebElement UserTypeTitle = UserTypeSearched.FindElement(TitleUserTypeName_locator);
                    if (UserTypeTitle.Text == (rolenm + " expand_more"))
                    {
                        Klick.On(UserTypeTitle);
                        Thread.Sleep(KortextGlobals.s);
                        ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle);
                        Thread.Sleep(KortextGlobals.s);

                        if (rolefield == "Name")
                        {
                            IWebElement UserTypeName = UserTypeSearched.FindElement(UserTypeName_locator);
                            Klick.On(UserTypeName);
                            Thread.Sleep(KortextGlobals.s);
                            WaitFind.FindElem(TypeNameDescTextField, 10).Clear();
                            Klick.On(TypeNameDescTextField);
                            Thread.Sleep(KortextGlobals.s);
                            TypeNameDescTextField.SendKeys(newtext);
                            Thread.Sleep(KortextGlobals.s);
                            Klick.On(NameDescSubmitButton);
                            statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                            if (statusreturntext != "User type updated")
                            {
                                Console.WriteLine("Error while Updating User Role Name." + statusreturntext);
                            }
                            else
                            {
                                Console.WriteLine("User Role Name Update Successful");
                            }
                        }
                        else if (rolefield == "Description")
                        {
                            IWebElement UserTypeDesc = UserTypeSearched.FindElement(UserTypeDesc_locator);
                            Klick.On(UserTypeDesc);
                            Thread.Sleep(KortextGlobals.s);
                            WaitFind.FindElem(TypeNameDescTextField, 10).Clear();
                            Klick.On(TypeNameDescTextField);
                            Thread.Sleep(KortextGlobals.s);
                            TypeNameDescTextField.SendKeys(newtext);
                            Thread.Sleep(KortextGlobals.s);
                            Klick.On(NameDescSubmitButton);
                            statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                            if (statusreturntext != "User type updated")
                            {
                                Console.WriteLine("Error while Updating User Role Description." + statusreturntext);
                            }
                            else
                            {
                                Console.WriteLine("User Role Description Update Successful");
                            }
                        }
                        else
                        {
                            Console.WriteLine("Incorrect Role Field passed to the function.");
                        }
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine(rolenm + " Role not found to be updated");
            }
        }