Esempio n. 1
0
 public void ClickOnMenu_NoticesBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(notices_btn, 20);
     Klick.On(notices_btn);
 }
Esempio n. 2
0
 public void ClickOnMenu_RequestsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(requests_btn, 20);
     Klick.On(requests_btn);
 }
Esempio n. 3
0
 public void ClickOnMenu_AcquisitionsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(acquisitions_btn, 20);
     Klick.On(acquisitions_btn);
 }
Esempio n. 4
0
        public void FindMaterialsAssociated()
        {
            Driver.Instance.Navigate().Refresh();
            Thread.Sleep(KortextGlobals.ll);
            Klick.On(Select50perPage);
            Thread.Sleep(KortextGlobals.s);

            IList <IWebElement> TagSelectPages = Driver.Instance.FindElements(MaterialsSelectPage_locator);

            if (TagSelectPages.Count > 0)
            {
                foreach (IWebElement TagSelectPage in TagSelectPages)
                {
                    MaterialsAssociated_function();
                    if (materialsiconfound_flag == 1)
                    {
                        materialsiconfound_flag = 0;
                        break;
                    }
                }
            }
            else
            {
                MaterialsAssociated_function();
            }
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
 public void ClickOnMenu_PermissionsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(permissions_btn, 20);
     Klick.On(permissions_btn);
 }
Esempio n. 7
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);
        }
Esempio n. 8
0
        public void ViewDigi(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("ViewDigi 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 ViewDigiMaterialButton = MaterialSearched.FindElement(MaterialViewDigi_locator);
                    if (ViewDigiMaterialButton.Displayed)
                    {
                        IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator);
                        Console.WriteLine("ViewDigi Material Button found for : " + MaterialTitle.Text);
                        Klick.On(ViewDigiMaterialButton);
                        Console.WriteLine("ViewDigi Material Successful");
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine("ViewDigi Material. No Materials present for the Searched text");
            }
        }
Esempio n. 9
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);
 }
Esempio n. 10
0
 public void ClickOnMenu_AboutBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(about_btn, 20);
     Klick.On(about_btn);
 }
Esempio n. 11
0
 public void ClickOnMenu_SettingsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(settings_btn, 20);
     Klick.On(settings_btn);
 }
Esempio n. 12
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");
            }
        }
Esempio n. 13
0
 public PearlLoginPage LoginAs(string password)
 {
     PasswordTxtBox.SendKeys(password);
     //loginButton.Click();
     Klick.On(loginButton);
     return(this);
 }
Esempio n. 14
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);
        }
Esempio n. 15
0
 public void ClickOnMenu_MaterialsBtn()
 {
     Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(materials_btn, 20);
     Klick.On(materials_btn);
 }
Esempio n. 16
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);
        }
 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);
 }
Esempio n. 18
0
 public void Do_Logout()
 {
     Thread.Sleep(KortextGlobals.s);
     //    Pages.PearlRedMenuPage.ClickOnRebusLabelBtn();
     Pages.PearlRedMenuPage.ClickOnMainMenuBtn();
     WaitFind.FindElem(LogOut, 20);
     Klick.On(LogOut);
 }
Esempio n. 19
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);
        }
        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.");
            }
        }
Esempio n. 21
0
        public void ViewListsUsed(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("View Lists using 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 ListsMaterialButton = MaterialSearched.FindElement(MaterialLists_locator);
                    if (ListsMaterialButton.Displayed)
                    {
                        IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator);
                        Console.WriteLine("View Lists using Material Button found for : " + MaterialTitle.Text);
                        Klick.On(ListsMaterialButton);
                        Thread.Sleep(KortextGlobals.s);
                        IWebElement ListsPageSubTitle = Driver.Instance.FindElement(locator);
                        if (ListsPageSubTitle.Text == "view_list Lists")
                        {
                            List <NgWebElement> ListsUsed = new List <NgWebElement>(Driver.ngDriver.FindElements(NgBy.Repeater("row in adminLists.ListsService.displayedCollection")));
                            if (ListsUsed.Count > 0)
                            {
                                Thread.Sleep(KortextGlobals.s);
                                Console.WriteLine("View Lists using Material Successful");
                                Driver.Instance.Navigate().Back();
                                break;
                            }
                            else
                            {
                                Console.WriteLine("No List using the Material. Moving to the next Material to check");
                            }
                        }
                        else
                        {
                            Console.WriteLine("Landed to an incorrect page." + ListsPageSubTitle.Text);
                            Driver.Instance.Navigate().Back();
                            break;
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("View Lists using Material. No Materials present for the Searched text");
            }
        }
Esempio n. 22
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);
 }
Esempio n. 23
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");
            }
        }
Esempio n. 24
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);
        }
        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.");
            }
        }
        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);
        }
Esempio n. 27
0
        public bool IsLoggedOut()
        {
            try
            {
                var wait      = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(40));
                var myElement = wait.Until(x => x.FindElement(By.CssSelector("div.navicon-button")));
                Klick.On(myElement);
                Thread.Sleep(KortextGlobals.s);

                // var loginElement = wait.Until(x => x.FindElement(By.Id("logout")));
                return(Pages.LandingPage.LoginButtonIsDisplayed());
            }
            catch (Exception e)
            {
                Console.WriteLine("Error logging out ", e.Message);
                return(false);
            }
        }
Esempio n. 28
0
        public void DeleteRole(string searchtext)
        {
            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 == (searchtext + " expand_more"))
                    {
                        Klick.On(UserTypeTitle);
                        Thread.Sleep(KortextGlobals.s);
                        ((IJavaScriptExecutor)Driver.Instance).ExecuteScript("arguments[0].scrollIntoView(true);", UserTypeTitle);
                        Thread.Sleep(KortextGlobals.s);

                        IWebElement RoleDeleteButton = UserTypeSearched.FindElement(Delete_UserType_locator);
                        Klick.On(RoleDeleteButton);
                        Thread.Sleep(KortextGlobals.s);
                        Klick.On(DeleteConfirmButton);
                        statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                        if (statusreturntext != "User type deleted")
                        {
                            Console.WriteLine("Error while Deleting User Type Role." + statusreturntext);
                        }
                        else
                        {
                            Console.WriteLine("Deleting User Type Role Successful");
                        }
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine(searchtext + " User Type Role not found to be deleted");
            }
            Console.WriteLine("Searching User Type after Deleting");
            SearchRoles(searchtext);
        }
Esempio n. 29
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");
            }
        }
Esempio n. 30
0
 public bool IsLoggedIn()
 {
     //Check for log out button
     try
     {
         var wait      = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(20));
         var myElement = wait.Until(x => x.FindElement(By.Id("navicon-container")));
         Klick.On(myElement);
         //  Thread.Sleep(KortextGlobals.s);
         var logoutElement = wait.Until(x => x.FindElement(By.Id("logout")));
         var MenuBack      = wait.Until(x => x.FindElement(By.CssSelector("div.circle.open")));
         Klick.On(MenuBack);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine("Error logging in ", e.Message);
         return(false);
     }
 }