예제 #1
0
        internal bool HasNote(ExampleWpis exampleText)
        {
            //var note = _browser.FindElements(By.TagName("article"));
            //var myNote = note
            //     .Where(c => c.FindElement(By.CssSelector(".entry-title")).Text == exampleText.Title)
            //     .Where(c => c.FindElement(By.CssSelector(".entry-content > p")).Text == exampleText.ContentWpis);

            var x = _browser.FindElement(By.CssSelector(".entry-title"));
            var y = _browser.FindElement(By.CssSelector(".entry-content > p"));

            return(x.Text == exampleText.Title && y.Text == exampleText.ContentWpis);

            // return myNote.Count() == 1;
        }
예제 #2
0
        public void Can_publish_new_note()
        {
            var blogStartPage  = LoginPage.Open(GetBrowser());
            var blogPage       = blogStartPage.EnterUserDataAndLogin();
            var AdminPage      = blogPage.AddNote();
            var AdminPageWpisy = blogPage.AddNewNote();
            var exampleText    = new ExampleWpis();
            var link           = AdminPageWpisy.AddWpis(exampleText);

            blogPage.LogOut();
            var PageResult = new NotePage(GetBrowser());

            PageResult.GoTo(link);

            Assert.True(PageResult.HasNote(exampleText));
        }
예제 #3
0
        public string AddWpis(ExampleWpis exampleWpis)
        {
            var AddNewWpis = _browser.FindElement(By.Id("title"));

            AddNewWpis.SendKeys(exampleWpis.Title);

            var AddNewWpisContent = _browser.FindElement(By.Id("content"));

            AddNewWpisContent.SendKeys(exampleWpis.ContentWpis);

            WaitForClickable(By.CssSelector(".edit-slug"), 5);

            var PublishWpisButton = _browser.FindElement(By.Id("publishing-action"));

            PublishWpisButton.Click();

            WaitForClickable(By.CssSelector("#sample-permalink > a"), 5);

            var link      = _browser.FindElement(By.CssSelector("#sample-permalink > a"));
            var linktekst = link.GetAttribute("href");

            return(linktekst);
        }