Beispiel #1
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");
            }
        }
Beispiel #2
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");
            }
        }
Beispiel #3
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");
            }
        }
Beispiel #4
0
        public void EditMaterial(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 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 EditMaterialButton = MaterialSearched.FindElement(MaterialEdit_locator);
                    if (EditMaterialButton.Displayed)
                    {
                        IWebElement MaterialTitle = MaterialSearched.FindElement(MaterialTitle_locator);
                        Console.WriteLine("Edit Material Button found for : " + MaterialTitle.Text);
                        Klick.On(EditMaterialButton);
                        Pages.PearlEditBuffer.EditCitation();
                        statusreturntext = Pages.PearlEditBuffer.StatusMessage();
                        if (statusreturntext != "Material changes saved")
                        {
                            Console.WriteLine("Error while Editing Material." + statusreturntext);
                            break;
                        }
                        else
                        {
                            Console.WriteLine("Editing Material Successful");
                            break;
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("Edit Material. No Materials present for the Searched text");
            }
        }