Skip to content

Commit

Permalink
Fix behat failures: OU personal blog #199106
Browse files Browse the repository at this point in the history
  • Loading branch information
Quang Le authored and sammarshallou committed Jun 15, 2017
1 parent fcd799a commit 6f06c68
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions tests/behat/personalblog.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Test Post and Comment on Personal OUBlog

Scenario: Admin edits the blog options
Given I log in as "admin"
And I am on homepage
And I am on site homepage
And I follow "Personal Blogs"
And I follow "Blog options"
Then I should see "Blog name"
Expand Down Expand Up @@ -70,6 +70,7 @@ Feature: Test Post and Comment on Personal OUBlog

# Admin changes post to world visibility.
Given I log in as "admin"
And I am on site homepage
And I follow "Personal Blogs"
And I follow "Edit"
And I set the following fields to these values:
Expand Down Expand Up @@ -113,6 +114,7 @@ Feature: Test Post and Comment on Personal OUBlog

# Admin confirm moderated comment.
Given I log in as "admin"
And I am on site homepage
And I follow "Personal Blogs"
And I follow "2 comments, 1 awaiting approval"
When I press "Approve this comment"
Expand Down Expand Up @@ -230,15 +232,15 @@ Feature: Test Post and Comment on Personal OUBlog
| Message | Admin Persblog post19 content |
| Who can read this | Visible to anyone in the world |
And I press "Add post"
Then ".oublog-paging .current-page" "css_element" should not exist
Then ".oublog-paging" "css_element" should not exist
Given I press "New blog post"
And I set the following fields to these values:
| Title | Personal OUBlog post20 |
| Message | Admin Persblog post20 content |
When I press "Add post"
Then ".oublog-paging .current-page" "css_element" should exist
And ".oublog-paging .next" "css_element" should exist
And ".oublog-paging .previous" "css_element" should not exist
Then ".oublog-paging" "css_element" should exist
And I should see "Next" in the ".oublog-paging" "css_element"
And I should not see "Previous" in the ".oublog-paging" "css_element"
Given I follow "2"
Then I should see "Personal OUBlog post01"
Given I follow "View site entries"
Expand All @@ -259,8 +261,8 @@ Feature: Test Post and Comment on Personal OUBlog
| Tags (separated by commas) | Taggy1 |
And I press "Add post"
And I follow "Next"
And ".oublog-paging .previous" "css_element" should exist
And ".oublog-paging .next" "css_element" should not exist
And I should see "Previous" in the ".oublog-paging" "css_element"
And I should not see "Next" in the ".oublog-paging" "css_element"
Then I should see "Personal OUBlog post02" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I should not see "Personal OUBlog post22" in the "div.oublog-post-top-details h2.oublog-title" "css_element"

Expand All @@ -272,8 +274,8 @@ Feature: Test Post and Comment on Personal OUBlog
| Message | Admin Persblog post01 content edited for return url test|
And I press "Save changes"
# Confirm return to correct page after edit
And ".oublog-paging .previous" "css_element" should exist
And ".oublog-paging .next" "css_element" should not exist
And I should see "Previous" in the ".oublog-paging" "css_element"
And I should not see "Next" in the ".oublog-paging" "css_element"
And I should see "Personal OUBlog post02" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I should not see "Personal OUBlog post22" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
# 'Delete' post01, 3rd post on second page
Expand All @@ -283,14 +285,14 @@ Feature: Test Post and Comment on Personal OUBlog
Given I press "Cancel"
And I wait to be redirected
# Confirm return to correct page after cancel
And ".oublog-paging .previous" "css_element" should exist
And I should see "Previous" in the ".oublog-paging" "css_element"
And I should see "Personal OUBlog post02" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I should not see "Personal OUBlog post22" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I click on "Delete" "link" in the ".oublog-post:nth-child(3) .oublog-post-links" "css_element"
And I press "Delete"
And I wait to be redirected
# Confirm return to correct page after delete
And ".oublog-paging .previous" "css_element" should exist
And I should see "Previous" in the ".oublog-paging" "css_element"
And I should see "Personal OUBlog post02" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I should see "Personal OUBlog post01 edited" in the "div.oublog-post.oublog-deleted div.oublog-post-top-details h2.oublog-title" "css_element"
And ".oublog-deleted" "css_element" should exist
Expand All @@ -299,12 +301,12 @@ Feature: Test Post and Comment on Personal OUBlog
And I follow "View site entries"
Then I should see "Personal OUBlog post22"
Then I should not see "Personal OUBlog post01 WorldVis"
And ".oublog-paging .next" "css_element" should exist
And ".oublog-paging .previous" "css_element" should not exist
And I should see "Next" in the ".oublog-paging" "css_element"
And I should not see "Previous" in the ".oublog-paging" "css_element"
Given I follow "taggy1"
Then I should see "Personal OUBlog post22"
And I should not see "Personal OUBlog post21"
And ".oublog-paging .next" "css_element" should not exist
And I should not see "Next" in the ".oublog-paging" "css_element"
# 'Edit' the "taggy" post22
And I click on "Edit" "link" in the ".oublog-post-links" "css_element"
And I wait to be redirected
Expand All @@ -315,12 +317,12 @@ Feature: Test Post and Comment on Personal OUBlog
# Confirm return to correct page after "taggy" edit
Then I should see "Personal OUBlog post22 edited" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And I should not see "Personal OUBlog post21" in the "div.oublog-post-top-details h2.oublog-title" "css_element"
And ".oublog-paging .next" "css_element" should not exist
And I should not see "Next" in the ".oublog-paging" "css_element"

# New scenario tests the Socialmedia widgets availability
Scenario: Admin tests the blog tweet facility
Given I log in as "admin"
And I am on homepage
And I am on site homepage
And I follow "Personal Blogs"

# Admin adds a Private post Tweet not available
Expand Down Expand Up @@ -371,7 +373,7 @@ Feature: Test Post and Comment on Personal OUBlog

Scenario: Admin follows the link to the main page and back
Given I log in as "admin"
And I am on homepage
And I am on site homepage
And I follow "Personal Blogs"
And I follow "Blog options"
Then I should see "Blog name"
Expand Down

0 comments on commit 6f06c68

Please sign in to comment.