sort_threaded_comments.feature 4.15 KB
Newer Older
1
@javascript @core @core_artefact @core_content @artefact_comment
2 3 4
Feature: Threaded comments
   In order to see earliest/latest threaded comments to a page
   As a mahara user I should see threaded comments in the right order
5
   So I can easily follow these comments
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Background:
    Given the following "institutions" exist:
     | name | displayname | commentthreaded | allowinstitutionpublicviews |
     | instone | inst1 | 1 | 1 |
    Given the following "users" exist:
     | username | password | email | firstname | lastname | institution | authname | role |
     | pageowner | password | test01@example.com | Paige | Owner | instone | internal | admin |
    Given the following "pages" exist:
     | title | description | ownertype | ownername |
     | page1 | page1 | user | pageowner |

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
22
    And I fill in "Comment #1" in editor "Message"
23
    And I press "Comment"
24
    And I fill in "Comment #2" in editor "Message"
25
    And I press "Comment"
26
    And I fill in "Comment #3" in editor "Message"
27
    And I press "Comment"
28
    And I fill in "Comment #4" in editor "Message"
29
    And I press "Comment"
30
    And I fill in "Comment #5" in editor "Message"
31
    And I press "Comment"
32
    And I fill in "Comment #6" in editor "Message"
33
    And I press "Comment"
34
    And I fill in "Comment #7" in editor "Message"
35
    And I press "Comment"
36
    And I fill in "Comment #8" in editor "Message"
37
    And I press "Comment"
38
    And I fill in "Comment #9" in editor "Message"
39
    And I press "Comment"
40
    And I fill in "Comment #10" in editor "Message"
41
    And I press "Comment"
42
    And I fill in "Comment #11" in editor "Message"
43
    And I press "Comment"
44
    And I fill in "Comment #12" in editor "Message"
45 46
    And I press "Comment"
    # Go to the first page
47
    And I scroll to the base of id "comment-form"
48 49 50 51 52 53
    And I follow "1"
    And I should see "Comment #1"
    And I should see "Comment #10"
    And "Comment #2" "text" should appear before "Comment #3" "text"
    And I should not see "Comment #11"
    # Go to the second page
54
    And I scroll to the base of id "comment-form"
55 56 57 58 59
    And I follow "2"
    And I should see "Comment #11"
    And "Comment #11" "text" should appear before "Comment #12" "text"
    And I should not see "Comment #10"
    # Reply to a comment
60
    And I scroll to the base of id "comment-form"
61
    And I follow "1"
62
    And I scroll to the base of id "main-nav"
63
    And I click on "Reply" in "Comment #1" row
64
    And I fill in "Comment #1/1" in editor "Message"
65 66
    And I press "Comment"
    And "Comment #1/1" "text" should appear before "Comment #2" "text"
67
    And I scroll to the id "feedbacktable"
68
    And I click on "Reply" in "Comment #1/1" row
69
    And I fill in "Comment #1/1/1" in editor "Message"
70
    And I press "Comment"
71
    And I scroll to the id "feedbacktable"
72
    And I click on "Reply" in "Comment #1/1" row
73
    And I fill in "Comment #1/1/2" in editor "Message"
74
    And I press "Comment"
75
    And I scroll to the id "feedbacktable"
76
    And I click on "Reply" in "Comment #1/1/1" row
77
    And I fill in "Comment #1/1/1/1" in editor "Message"
78
    And I press "Comment"
79
    And I scroll to the id "feedbacktable"
80
    And I click on "Reply" in "Comment #1/1/1/1" row
81
    And I fill in "Comment #1/1/1/1/1" in editor "Message"
82
    And I press "Comment"
83
    And I scroll to the id "feedbacktable"
84
    And I click on "Reply" in "Comment #1/1/1/1" row
85
    And I fill in "Comment #1/1/1/1/2" in editor "Message"
86
    And I press "Comment"
87
    And I scroll to the id "feedbacktable"
88
    And I click on "Reply" in "Comment #1/1" row
89
    And I fill in "Comment #1/1/3" in editor "Message"
90
    And I press "Comment"
91
    And I scroll to the base of id "feedbacktable"
92
    And I click on "Reply" in "Comment #1/1/2" row
93
    And I fill in "Comment #1/1/2/1" in editor "Message"
94 95 96 97
    And I press "Comment"
    And "Comment #1/1/1/1/1" "text" should appear before "Comment #1/1/1/1/2" "text"
    And "Comment #1/1/1/1/2" "text" should appear before "Comment #1/1/2" "text"
    And "Comment #1/1/2/1" "text" should appear before "Comment #1/1/3" "text"