Commit 7bbd4282 authored by Pramith Dayananda's avatar Pramith Dayananda Committed by Robert Lyon

Bug 1529718: Behat tests

Change-Id: I148fa1ec0053b2488ee7e1f12b39113feb24ca4b
parent 7535e2e6
......@@ -934,7 +934,7 @@ class ArtefactTypeComment extends ArtefactType {
}
$form['elements']['message'] = array(
'type' => 'wysiwyg',
'title' => get_string('message'),
'title' => get_string('Comment', 'artefact.comment'),
'class' => ($USER->is_logged_in() ? 'hide-label' : ''),
'rows' => 5,
'cols' => 80,
......
......@@ -25,7 +25,7 @@ Scenario: Making adjustments to the mathslate plugin for mahara (Bug 1472446)
And I follow "test"
# Tinymce field adding a math equation
And I scroll to the id "feedbacktable"
And I fill in "\\[\\alpha A\\beta B\\]" in editor "Message"
And I fill in "\\[\\alpha A\\beta B\\]" in editor "Comment"
And I press "Comment"
And I wait "1" seconds
And I choose "Pages and collections" in "Configure site" from administration menu
......
......@@ -17,14 +17,18 @@ Background:
Scenario: Adding and deleting public comments
# Adding
Given I go to portfolio page "page1"
# The label for message text area - anonymous users
And I should see "Comment"
And I fill in "Name" with "Joe Anonymous"
# No TinyMCE editor for anonymous users
And I fill in "Message" with "Public comment by anonymous user"
And I fill in "Comment" with "Public comment by anonymous user"
And I enable the switch "Make public"
And I press "Comment"
And I log in as "pageowner" with password "password"
And I go to portfolio page "page1"
And I fill in "Comment by page owner" in editor "Message"
# The label for message text area - logged in users
And I should see "Add comment"
And I fill in "Comment by page owner" in editor "Comment"
And I press "Comment"
Then I should see "Joe Anonymous"
And I should see "Public comment by anonymous user"
......@@ -59,7 +63,7 @@ Scenario: Comments update the page's mtime
# Public comment updates page last updated
And I go to portfolio page "page1"
And I fill in "Public comment" in editor "Message"
And I fill in "Public comment" in editor "Comment"
And I press "Comment"
And I choose "Dashboard" from main menu
Then I should see "page1" in the ".bt-newviews" element
......@@ -67,7 +71,7 @@ Scenario: Comments update the page's mtime
# Private comment updates page last updated
And I go to portfolio page "page2"
And I fill in "Private comment" in editor "Message"
And I fill in "Private comment" in editor "Comment"
And I disable the switch "Make public"
And I press "Comment"
And I choose "Dashboard" from main menu
......
......@@ -24,7 +24,7 @@ Scenario: Moderating a group comment when approve comments is turned on
# Adding a comment to a group page as a non-group member
Given I log in as "userC" with password "Kupuhipa1"
And I go to portfolio page "Page1"
And I set the field "Message" to "This is a comment from userC"
And I set the field "Comment" to "This is a comment from userC"
And I enable the switch "Make public"
And I press "Comment"
And I wait "1" seconds
......
......@@ -19,40 +19,40 @@ Scenario: Threaded comments should be displayed in correct order
Given I log in as "pageowner" with password "password"
And I go to portfolio page "page1"
# Add 11 comments
And I fill in "Comment #1" in editor "Message"
And I fill in "Comment #1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #2" in editor "Message"
And I fill in "Comment #2" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #3" in editor "Message"
And I fill in "Comment #3" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #4" in editor "Message"
And I fill in "Comment #4" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #5" in editor "Message"
And I fill in "Comment #5" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #6" in editor "Message"
And I fill in "Comment #6" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #7" in editor "Message"
And I fill in "Comment #7" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #8" in editor "Message"
And I fill in "Comment #8" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #9" in editor "Message"
And I fill in "Comment #9" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #10" in editor "Message"
And I fill in "Comment #10" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #11" in editor "Message"
And I fill in "Comment #11" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I fill in "Comment #12" in editor "Message"
And I fill in "Comment #12" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
......@@ -72,43 +72,43 @@ Scenario: Threaded comments should be displayed in correct order
And I scroll to the base of id "feedback_pagination"
And I follow "1"
And I click on "Reply" in "Comment #1" row
And I fill in "Comment #1/1" in editor "Message"
And I fill in "Comment #1/1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And "Comment #1/1" "text" should appear before "Comment #2" "text"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1" row
And I fill in "Comment #1/1/1" in editor "Message"
And I fill in "Comment #1/1/1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1" row
And I fill in "Comment #1/1/2" in editor "Message"
And I fill in "Comment #1/1/2" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1/1" row
And I fill in "Comment #1/1/1/1" in editor "Message"
And I fill in "Comment #1/1/1/1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1/1/1" row
And I fill in "Comment #1/1/1/1/1" in editor "Message"
And I fill in "Comment #1/1/1/1/1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1/1/1" row
And I fill in "Comment #1/1/1/1/2" in editor "Message"
And I fill in "Comment #1/1/1/1/2" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the id "feedbacktable"
And I click on "Reply" in "Comment #1/1" row
And I fill in "Comment #1/1/3" in editor "Message"
And I fill in "Comment #1/1/3" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And I scroll to the base of id "feedbacktable"
And I click on "Reply" in "Comment #1/1/2" row
And I fill in "Comment #1/1/2/1" in editor "Message"
And I fill in "Comment #1/1/2/1" in editor "Comment"
And I press "Comment"
And I go to portfolio page "page1"
And "Comment #1/1/1/1/1" "text" should appear before "Comment #1/1/1/1/2" "text"
......
......@@ -23,7 +23,7 @@ Background:
Scenario: Public comment by page owner, public reply by third party
Given I log in as "pageowner" with password "password"
And I go to portfolio page "page1"
And I fill in "Public comment by pageowner" in editor "Message"
And I fill in "Public comment by pageowner" in editor "Comment"
And I enable the switch "Make public"
And I press "Comment"
And I log out
......@@ -32,7 +32,7 @@ Scenario: Public comment by page owner, public reply by third party
And I click on "Reply" in "Public comment by pageowner" row
# I should see a preview of the reply-to comment below the feedback form
And I should see "Public comment by pageowner" in the ".commentreplyview" "css_element"
And I fill in "Public reply by pagecommenter" in editor "Message"
And I fill in "Public reply by pagecommenter" in editor "Comment"
When I press "Comment"
Then I should see "Public comment by pageowner"
And I should see "Public reply by pagecommenter"
......@@ -40,7 +40,7 @@ Scenario: Public comment by page owner, public reply by third party
Scenario: Public comment by non-owner, owner can private reply, another non-owner cannot private reply
Given I log in as "pagecommenter" with password "password"
And I go to portfolio page "page1"
And I fill in "Public comment by pagecommenter" in editor "Message"
And I fill in "Public comment by pagecommenter" in editor "Comment"
And I enable the switch "Make public"
And I press "Comment"
And I log out
......@@ -48,7 +48,7 @@ Scenario: Public comment by non-owner, owner can private reply, another non-owne
And I go to portfolio page "page1"
And I click on "Reply" in "Public comment by pagecommenter" row
And I disable the switch "Make public"
And I fill in "Private reply by pageowner" in editor "Message"
And I fill in "Private reply by pageowner" in editor "Comment"
And I press "Comment"
And I log out
And I log in as "pagewatcher" with password "password"
......@@ -56,7 +56,7 @@ Scenario: Public comment by non-owner, owner can private reply, another non-owne
And I click on "Reply" in "Public comment by pagecommenter" row
# I should not be able to make a private reply to a comment by someone other than the page owner
And I should see "Public" in the "#add_feedback_form_ispublic_container" "css_element"
When I fill in "Public reply by pagewatcher" in editor "Message"
When I fill in "Public reply by pagewatcher" in editor "Comment"
And I press "Comment"
Then I should see "Public comment by pagecommenter"
And I should not see "Private reply by pageowner"
......@@ -65,7 +65,7 @@ Scenario: Public comment by non-owner, owner can private reply, another non-owne
Scenario: Private comment by commenter, private reply by page owner, private counter-reply by page commenter
Given I log in as "pagecommenter" with password "password"
And I go to portfolio page "page1"
And I fill in "Private comment by pagecommenter" in editor "Message"
And I fill in "Private comment by pagecommenter" in editor "Comment"
And I disable the switch "Make public"
And I press "Comment"
And I press "More..."
......@@ -76,7 +76,7 @@ Scenario: Private comment by commenter, private reply by page owner, private cou
And I click on "Reply" in "Private comment by pagecommenter" row
# There should be no option to make a public reply to a private comment
And I should see "Private" in the "#add_feedback_form_ispublic_container" "css_element"
And I fill in "Private reply by pageowner" in editor "Message"
And I fill in "Private reply by pageowner" in editor "Comment"
And I press "Comment"
And I log out
And I log in as "pagecommenter" with password "password"
......@@ -85,7 +85,7 @@ Scenario: Private comment by commenter, private reply by page owner, private cou
# (An exception to the general rule that only the pageowner can see private comments)
And I should see "Private reply by pageowner"
And I click on "Reply" in "Private reply by pageowner" row
And I fill in "Private counter-reply by pagecommenter" in editor "Message"
And I fill in "Private counter-reply by pagecommenter" in editor "Comment"
When I press "Comment"
Then I should see "Private comment by pagecommenter"
And I should see "Private reply by pageowner"
......@@ -99,7 +99,7 @@ Scenario: No private replies to anonymous comments
Given I go to portfolio page "page1"
And I fill in "Name" with "Anonymous User"
# No WYSIWYG editor for anonymous users
And I fill in "Message" with "Public comment by anonymous user"
And I fill in "Comment" with "Public comment by anonymous user"
And I enable the switch "Make public"
And I press "Comment"
When I log in as "pagecommenter" with password "password"
......@@ -107,7 +107,7 @@ Scenario: No private replies to anonymous comments
And I click on "Reply" in "Public comment by anonymous user" row
# I should not be able to make a private reply to a comment by someone other than the page owner
Then I should see "Public" in the "#add_feedback_form_ispublic_container" "css_element"
And I fill in "Public reply by pagecommenter" in editor "Message"
And I fill in "Public reply by pagecommenter" in editor "Comment"
And I press "Comment"
And I should see "Public comment by anonymous user"
And I should see "Public reply by pagecommenter"
......@@ -115,7 +115,7 @@ Scenario: No private replies to anonymous comments
Scenario: No replies to deleted comments
Given I log in as "pageowner" with password "password"
And I go to portfolio page "page1"
And I fill in "I will delete this comment" in editor "Message"
And I fill in "I will delete this comment" in editor "Comment"
And I enable the switch "Make public"
When I press "Comment"
And I should see "I will delete this comment"
......@@ -133,20 +133,20 @@ Scenario: Deleted comments
# *** Comment #1/2
# * Comment #2
#
And I fill in "Comment 1." in editor "Message"
And I fill in "Comment 1." in editor "Comment"
And I press "Comment"
And I should see "Comment 1."
And I fill in "Comment 2." in editor "Message"
And I fill in "Comment 2." in editor "Comment"
And I press "Comment"
And I should see "Comment 2."
And I click on "Reply" in "Comment 1." row
And I fill in "Comment 1-1." in editor "Message"
And I fill in "Comment 1-1." in editor "Comment"
And I press "Comment"
And I should see "Comment 1-1."
# TODO: fix "I click on" so it automatically scrolls if needed
And I scroll to the base of id "commentreplyto20"
And I click on "Reply" in "Comment 1-1." row
And I fill in "Comment 1-2." in editor "Message"
And I fill in "Comment 1-2." in editor "Comment"
And I press "Comment"
And I should see "Comment 1-2."
......
......@@ -31,10 +31,9 @@ Scenario: As a user leaving a public comment on a group page (Bug 1509129)
| Page title | Group Page 01 |
And I press "Save"
And I follow "Display page"
And I fill in "Adding a comment to this field. Student = Awesome!" in editor "Message"
And I fill in "Adding a comment to this field. Student = Awesome!" in editor "Comment"
# Checking that the make public is on
And the following fields match these values:
| Make public | 1 |
And I enable the switch "Make public"
And I press "Comment"
# Verifying that it saves
Then I should see "Comment submitted"
......
......@@ -29,7 +29,7 @@ Scenario: Adding a comment on a group page (Bug 1426983)
And I follow "Pages and collections (tab)"
# And I click on "Pages"
And I follow "Testing group page 01"
And I fill in "Testing comment notifications" in editor "Message"
And I fill in "Testing comment notifications" in editor "Comment"
And I press "Comment"
# Log out as user 1
And I log out
......
......@@ -39,18 +39,18 @@ Scenario: Testing that views & collections are collated properly
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "C1" panel collection
And I click on "P1A" in "C1" panel collection
And I fill in "I am on P1A" in editor "Message"
And I fill in "I am on P1A" in editor "Comment"
And I press "Comment"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "C1" panel collection
And I click on "P1B" in "C1" panel collection
And I fill in "I am on P1B" in editor "Message"
And I fill in "I am on P1B" in editor "Comment"
And I press "Comment"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click the panel "P2"
And I fill in "I am on P2" in editor "Message"
And I fill in "I am on P2" in editor "Comment"
And I press "Comment"
When I log out
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment