コード例 #1
0
        public void Can_Search_Posts()
        {
            #region Manual test case
            //Go to login page
            //Login as “admin” user with correct password “ha tran”
            //Click Login button
            //Hover mouse on the “Posts” menu on the left navigation panel
            //Click “All Posts” menu
            //Enter a search string that matches to at least a post title to the Search text box
            //Click “Search Posts” button
            //Verify that the matching post titles show up in the list
            #endregion Manual test case

            //Create a new post
            PostCreator.CreatePost();

            //Go to list posts
            ListPostsPage.GoTo(PostType.Posts);

            //Search for posts
            ListPostsPage.SearchForPosts(PostCreator.PreviousTitle);

            //Check that post show up in results
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));
        }
コード例 #2
0
        public void Added_Post_Show_Up()
        {
            #region Manual test case
            //Go to login page
            //Login as “admin” user with correct password “ha tran”
            //Click Login button
            //Hover mouse on the “Posts” menu on the left navigation panel
            //Click “All Posts” menu
            //Observe and record the posts count at the top right corner of the posts list
            //Add a new post and publish it
            //Go to All Posts list
            //Verify that the posts count increase by 1
            //Verify that the added post exists in the list
            #endregion Manual test case
            //Go to Posts, get post count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            //Add a new post
            PostCreator.CreatePost();
            //Go to Posts, get new post count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostsCount + 1, ListPostsPage.CurrentPostsCount, "Count of posts didn't increase");

            //Check for added post
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            //Trash post(clean up)
            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostsCount, ListPostsPage.CurrentPostsCount, "Couldn't trash post");
        }
コード例 #3
0
        public void Can_Edit_A_Page()
        {
            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #4
0
        public void Can_Search_Posts()
        {
            PostCreator.CreatePost();

            ListPostsPage.SearchForPost(PostCreator.PreviousTitle);

            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));
        }
コード例 #5
0
        public void Can_Edit_A_Page()
        {
            ListPostsPage.GoTo(ListPostsPage.PostType.Page); // general purpose class this will work for both posts and pages
            ListPostsPage.SelectPost("Sample Page");         // or you could add an index [0] or [1] for the 1st or 2nd post of that page

            //Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Edit Page Add New", NewPostPage.Header(), "Header did not match");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #6
0
        public void CanEditAPage()
        {
            Wordpress.StartApplication();

            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(NewPostPage.IsInEditMode(), "Page not in Edit Mode.");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #7
0
        public void Can_Search_Posts()
        {
            //create a new post
            PostCreator.CreatePost();

            //search for post
            ListPostsPage.SearchForPost(PostCreator.PreviousTitle);
            //check the post shows up in the results
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));
        }
コード例 #8
0
ファイル: PageTests.cs プロジェクト: djhmateer/githubscratch
        public void Can_Edit_A_Page()
        {
            // Pages are just a type of Post - so creating a general purpose class to work with
            // posts and pages, and sending in a type to differentiate
            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #9
0
        public void Can_Edit_A_Page()
        {
            LoginPage.GoTo();
            LoginPage.LoginAs("admin").WithPassword("password").Login();

            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #10
0
        public void CanSearchPosts()
        {
            Wordpress.StartApplication();
            //Add a new post
            PostCreater.CreatePost();

            //Search for posts
            ListPostsPage.SearchForPost(PostCreater.PreviousTitle);

            //check for post up in the results
            Assert.IsTrue(ListPostsPage.DoesPostExistsWithTitle(PostCreater.PreviousTitle));
        }
コード例 #11
0
        public void Can_Create_A_Basic_Post()
        {
            LoginPage.GoTo("");
            LoginPage.LoginAs("trebevic_admin").WithPassword("baG!Rf7yp6jWhkl&wP").Login();

            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(
                NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title did not match");
        }
コード例 #12
0
        public void CanEditAPage()
        {
            LoginPage.Goto();
            LoginPage
            .LoginAs("selenium_user")
            .WithPassword("q*y12rVMn7NJ8Jjxw@")
            .Login();

            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.True(NewPostPage.IsInEditMode(), "Isn't in Edit mode");
            Assert.Equal("Sample Page", NewPostPage.Title);
        }
コード例 #13
0
        public void Can_Search_Posts()
        {
            // Create a new post
            PostCreator.CreatePost();

            // Search for post
            ListPostsPage.SearchForPost(PostCreator.PreviousTitle);

            // Check that post shows up in results
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            // Cleanup (Trash post)
            // Automatically clean up by WordpressTests class
        }
コード例 #14
0
        public void Added_Posts_Show_Up()
        {
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            PostCreator.CreatePost();

            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of posts did not increase");

            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #15
0
ファイル: PageTests.cs プロジェクト: AVoitsik/POframework
        public void Can_Edit_A_Page()
        {
            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");

            Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual(NewPostPage.Title, "Sample Page", "Title did not match");



            //NewPostPage.GoTo();
            //NewPostPage.CreatePost("This is the test post title").WithBody("Hi, this is the body...").Publish();

            //NewPostPage.GotoNewPost();
            //Assert.AreEqual(PostPage.Title, "This is the test post title", "Title did not match new post");
        }
コード例 #16
0
        public void Can_Search_Posts()
        {
            PostCreator.CreatePost();
            //NewPostPage.GoTo();
            //NewPostPage.CreatePost("Searching posts, title")
            //    .WithBody("Searching posts, body")
            //    .Publish();

            //ListPostsPage.GoTo(PostType.Post);  change to Is At

            ListPostsPage.SearchForPost(PostCreator.PreviousTitle);

            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            //Trash post(clean up)  - moved to PostCreator in TestCleanup(WOrdpressTests)
            //ListPostsPage.TrashPost(PostCreator.PreviousTitle);
        }
コード例 #17
0
        public void Can_Edit_A_Page()
        {
            #region Manual test case
            //Go to login page
            //Login as “admin” user with correct password “ha tran”
            //Click Login button
            //Hover mouse on the “Pages” menu on the left navigation panel
            //Click “All Pages” menu
            //Click on the page post having title “Sample Page”
            //Verify that the page post is edit mode by checking visibility of the “View Page” button
            //Verify that the page title is “Sample Page”
            #endregion

            ListPostsPage.GoTo(PostType.Page);
            ListPostsPage.SelectPost("Sample Page");
            Assert.IsTrue(NewPostPage.IsInEditMode(), "Wasn't in edit mode");
            Assert.AreEqual("Sample Page", NewPostPage.Title, "Title didn't match");
        }
コード例 #18
0
        public void Added_Posts_Show_Up()
        {
            // Go to posts, get post count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            // Add a new post
            PostCreator.CreatePost();

            // Check for count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count is wrong of posts on page");

            // Check for added post
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            // Trash post (clean up)
            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #19
0
        public void Can_Search_Posts()
        {
            // Create new post
            NewPostPage.GoTo();
            NewPostPage.CreatePost("Searching posts, title")
            .WithBody("Seraching posts, body")
            .Publish();

            // Go to lists posts
            ListPostsPage.GoTo(PostType.Posts);

            // Search for the post
            ListPostsPage.SearchForPost("Searching posts, title");

            // Check that posts shows up in the results
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle("Searching posts, title"));

            // Cleanup (Trash post)
            ListPostsPage.TrashPost("Searching posts, title");
        }
コード例 #20
0
        public void AddedPostsShowUp()
        {
            // Go to posts, get post count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            // Add a new post
            PostCreator.CreatePost();

            //Go to posts, get new post count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Post was not publish");

            // Check for added post
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            // Delete post
            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Post was not deleted");
        }
コード例 #21
0
        public void Added_Posts_Show_Up()
        {
            // Go to posts, get post count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            // Add a new post
            PostCreator.CreatePost();

            // Go to posts, get new post count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of current posts didn't increase");

            // Check for added post
            Assert.IsTrue(ListPostsPage.DoesPostExistsWithTitle(PostCreator.PreviousTitle));

            // Trash post(clean up)
            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Thread.Sleep(1000);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash the post");
        }
コード例 #22
0
        public void CreatePostUsingWorkflow()
        {
            Wordpress.StartApplication();
            //Go to posts, get post count and store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StorePostsCount();

            //Add a new post
            PostCreater.CreatePost();

            //Go to posts, get new posts count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of posts did not match");

            //Check for added posts
            Assert.IsTrue(ListPostsPage.DoesPostExistsWithTitle(PostCreater.PreviousTitle), "");

            //Trash Post (Clean up)
            ListPostsPage.TrashPost(PostCreater.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #23
0
        public void Added_Posts_Show_Up()
        {
            // Go to posts, get posts count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            // Go back to Dashboard
            DashboardPage.GoTo();

            // Add a new post
            PostCreator.CreatePost();

            // Go to posts, get new posts count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of posts did not increase");

            // Check for the added post
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            // Trash post (clean up)
            PostCreator.TrashPost();
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #24
0
        public void Added_Posts_Show_Up()
        {
            // Go to posts, get post count, store
            ListPostsPage.GoTo(ListPostsPage.PostType.Posts);
            ListPostsPage.StoreCount();

            // Add a new post
            NewPostPage.GoTo();
            NewPostPage.CreatePost("Added posts show up, title")
            .WithBody("Added posts show up, body")
            .Publish();

            // Go to posts, get new post count
            ListPostsPage.GoTo(ListPostsPage.PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of posts did not increase");

            // Check for added post
            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle("Added posts show up, title"));

            // Trash post (clean up)
            ListPostsPage.TrashPost("Added posts show up, title");
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #25
0
        public void Added_Posts_Show_Up()
        {
            // go to posts, het post count, store
            ListPostsPage.GoTo(PostType.Posts);
            ListPostsPage.StoreCount();

            // add a new post
            PostCreator.CreatePost();


            //go to post, get new post count
            ListPostsPage.GoTo(PostType.Posts);
            Assert.AreEqual(ListPostsPage.PreviousPostCount + 1, ListPostsPage.CurrentPostCount, "Count of posts did not increase");


            // check for added post

            Assert.IsTrue(ListPostsPage.DoesPostExistWithTitle(PostCreator.PreviousTitle));

            //trash post (clean up)
            ListPostsPage.TrashPost(PostCreator.PreviousTitle);
            Assert.AreEqual(ListPostsPage.PreviousPostCount, ListPostsPage.CurrentPostCount, "Couldn't trash post");
        }
コード例 #26
0
 public void Can_create_a_new_post()
 {
     ListPostsPage.GoTo(WordpressAutomation.ListPostsPage.PostType.Page);
     ListPostsPage.Selectpost();
 }
コード例 #27
0
 private static void TrashPost()
 {
     ListPostsPage.TrashPost(PreviousTitle);
     Initialize();
 }