Exemple #1
0
        public PageOfPressReleases ClickLoadMore()
        {
            for (int i = 0; i <= Config.CountOfClickMoreLoad - 1; i++)
            {
                WDriver.WaitForIsVisible(By.XPath("//button[contains(@class, 'load-more-button')]"));
                this.LoadMore.Click();
            }

            return(this);
        }
Exemple #2
0
        public List <PressRelease> FilterPressReleasesByDate(string dateFrom, string dateTo)
        {
            var pressReleases = new List <PressRelease>();

            WDriver.SetValueByScript("Id", this.calendarFromId, dateFrom);
            WDriver.SetValueByScript("Id", this.calendarToId, dateTo);

            // Sometimes test failed because of button isn't clickable.
            WDriver.GetDriver().ExecuteScript("scroll(250, 0)");
            this.FilterButtonApply.Click();

            // Need handling of case when search found 0 items. There aren't press-releases.
            // For this to wait loading of page and to count found items.
            WDriver.WaitForIsVisible(By.XPath("//div[contains(@class,'text-right')]"));

            if (PageOfPressReleases.TitleOfPressReleases.FindElements(PageOfPressReleases.TitleOfPressReleases.Locator).Count != 0)
            {
                // Wait loading of DOM with new elements.
                PageOfPressReleases.TitleOfPressReleases.IsVisible();
                return(this.PressReleasesWithDate());
            }

            return(pressReleases);
        }
Exemple #3
0
        public int CountOfPressReleasesOnList()
        {
            WDriver.WaitForIsVisible(By.XPath("//div[@role='tablist']"));

            return(this.TableOfPressReleases.FindElements(By.XPath("//div[@role='tablist']")).Count);
        }
Exemple #4
0
        private void AssertIsOpen()
        {
            var label = new BaseElement(this.TitleLocator, this.Title);

            WDriver.WaitForIsVisible(this.TitleLocator);
        }