Ejemplo n.º 1
0
        public void ShoulCommentDeleteButtonHaveProperLink()
        {
            PageAccess.LogInToAdmin(Driver);
            IWebElement firstArticleDetails = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/table/tbody/tr[1]/td[2]/a[3]"));

            firstArticleDetails.Click();
            IWebElement commentDeleteButton = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/div[3]/table/tbody/tr[1]/td[3]/a[2]"));

            commentDeleteButton.Click();
            IWebElement deleteLink       = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/div/form"));
            String      deleteActionLink = deleteLink.GetAttribute("action");

            Assert.AreEqual("https://127.0.0.1:5001/Comments/Delete/31", deleteActionLink);
        }
Ejemplo n.º 2
0
        public void ShoulGoToCommentDeleteButtonAndBackToCommentsPage()
        {
            PageAccess.LogInToAdmin(Driver);
            IWebElement firstArticleDetails = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/table/tbody/tr[1]/td[2]/a[3]"));

            firstArticleDetails.Click();
            IWebElement commentDeleteButton = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/div[3]/table/tbody/tr[1]/td[3]/a[2]"));

            commentDeleteButton.Click();
            IWebElement backToArticlesPageButton = Driver.FindElement(By.CssSelector(".main-content > div:nth-child(3) > form:nth-child(4) > a:nth-child(3)"));

            backToArticlesPageButton.Click();
            IWebElement commentLabel = Driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/h1"));

            Assert.AreEqual("My Comments", commentLabel.Text);
        }
Ejemplo n.º 3
0
        public void CrawlThroughtCommentEndPoint()
        {
            List <string> titleList = new List <string>();

            PageAccess.LogInToAdmin(Driver);
            Driver.Url = "https://localhost:5001/Comments";
            titleList.Add(Driver.Title);
            Driver.Url = "https://localhost:5001/Comments/Edit/2";
            titleList.Add(Driver.Title);
            Driver.Url = "https://localhost:5001/Comments/Details/2";
            titleList.Add(Driver.Title);
            Driver.Url = "https://localhost:5001/Comments/Delete/2";
            titleList.Add(Driver.Title);
            Driver.Url = "https://localhost:5001/Comments/Create";
            titleList.Add(Driver.Title);
            Assert.That(titleList, Is.All.Contains("MyDiary"));
        }
Ejemplo n.º 4
0
        public void CrawlThroughtArticleEndPoint()
        {
            List <string> titleList = new List <string>();

            PageAccess.LogInToAdmin(Driver);
            Driver.Url = "https://127.0.0.1:5001/Articles";
            titleList.Add(Driver.Title);
            Driver.Url = "https://127.0.0.1:5001/Articles/Edit/9";
            titleList.Add(Driver.Title);
            Driver.Url = "https://127.0.0.1:5001/Articles/Delete/9";
            titleList.Add(Driver.Title);
            Driver.Url = "https://127.0.0.1:5001/Articles/Details/9";
            titleList.Add(Driver.Title);
            Driver.Url = "https://127.0.0.1:5001/Articles/Create";
            titleList.Add(Driver.Title);
            Assert.That(titleList, Is.All.Contains("MyDiary"));
        }