1 |
efrain |
1 |
@block @block_comments
|
|
|
2 |
Feature: Add a comment to the comments block
|
|
|
3 |
In order to comment on a conversation or a topic
|
|
|
4 |
As a user
|
|
|
5 |
In need to add comments to courses
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | First | teacher1@example.com |
|
|
|
14 |
| student1 | Student | First | student1@example.com |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "blocks" exist:
|
|
|
20 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
21 |
| comments | Course | C1 | course-view-* | side-pre |
|
|
|
22 |
And I am on the "Course 1" course page logged in as student1
|
|
|
23 |
|
|
|
24 |
@javascript
|
|
|
25 |
Scenario: Add a comment with Javascript enabled
|
|
|
26 |
When I add "I'm a comment from student1" comment to comments block
|
|
|
27 |
Then I should see "I'm a comment from student1"
|
|
|
28 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
29 |
And I should see "I'm a comment from student1"
|
|
|
30 |
|
|
|
31 |
Scenario: Add a comment with Javascript disabled
|
|
|
32 |
When I follow "Show comments"
|
|
|
33 |
And I add "I'm a comment from student1" comment to comments block
|
|
|
34 |
Then I should see "I'm a comment from student1"
|
|
|
35 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
36 |
And I follow "Show comments"
|
|
|
37 |
And I should see "I'm a comment from student1"
|
|
|
38 |
|
|
|
39 |
@javascript
|
|
|
40 |
Scenario: Test comment block pagination
|
|
|
41 |
When I add "Super test comment 01" comment to comments block
|
|
|
42 |
And I change window size to "1024x4096"
|
|
|
43 |
And I add "Super test comment 02" comment to comments block
|
|
|
44 |
And I add "Super test comment 03" comment to comments block
|
|
|
45 |
And I add "Super test comment 04" comment to comments block
|
|
|
46 |
And I add "Super test comment 05" comment to comments block
|
|
|
47 |
And I add "Super test comment 06" comment to comments block
|
|
|
48 |
And I add "Super test comment 07" comment to comments block
|
|
|
49 |
And I add "Super test comment 08" comment to comments block
|
|
|
50 |
And I add "Super test comment 09" comment to comments block
|
|
|
51 |
And I add "Super test comment 10" comment to comments block
|
|
|
52 |
And I add "Super test comment 11" comment to comments block
|
|
|
53 |
And I add "Super test comment 12" comment to comments block
|
|
|
54 |
And I add "Super test comment 13" comment to comments block
|
|
|
55 |
And I add "Super test comment 14" comment to comments block
|
|
|
56 |
And I add "Super test comment 15" comment to comments block
|
|
|
57 |
And I add "Super test comment 16" comment to comments block
|
|
|
58 |
And I add "Super test comment 17" comment to comments block
|
|
|
59 |
And I add "Super test comment 18" comment to comments block
|
|
|
60 |
And I add "Super test comment 19" comment to comments block
|
|
|
61 |
And I add "Super test comment 20" comment to comments block
|
|
|
62 |
And I add "Super test comment 21" comment to comments block
|
|
|
63 |
And I add "Super test comment 22" comment to comments block
|
|
|
64 |
And I add "Super test comment 23" comment to comments block
|
|
|
65 |
And I add "Super test comment 24" comment to comments block
|
|
|
66 |
And I add "Super test comment 25" comment to comments block
|
|
|
67 |
And I add "Super test comment 26" comment to comments block
|
|
|
68 |
And I add "Super test comment 27" comment to comments block
|
|
|
69 |
And I add "Super test comment 28" comment to comments block
|
|
|
70 |
And I add "Super test comment 29" comment to comments block
|
|
|
71 |
And I add "Super test comment 30" comment to comments block
|
|
|
72 |
And I add "Super test comment 31" comment to comments block
|
|
|
73 |
Then I should see "Super test comment 01"
|
|
|
74 |
And I should see "Super test comment 31"
|
|
|
75 |
And I am on "Course 1" course homepage
|
|
|
76 |
And I should not see "Super test comment 01"
|
|
|
77 |
And I should not see "Super test comment 02"
|
|
|
78 |
And I should not see "Super test comment 16"
|
|
|
79 |
And I should see "Super test comment 17"
|
|
|
80 |
And I should see "Super test comment 31"
|
|
|
81 |
And I should see "1" in the ".block_comments .comment-paging" "css_element"
|
|
|
82 |
And I should see "2" in the ".block_comments .comment-paging" "css_element"
|
|
|
83 |
And I should see "3" in the ".block_comments .comment-paging" "css_element"
|
|
|
84 |
And I should not see "4" in the ".block_comments .comment-paging" "css_element"
|
|
|
85 |
And I click on "2" "link" in the ".block_comments .comment-paging" "css_element"
|
|
|
86 |
And I should not see "Super test comment 01"
|
|
|
87 |
And I should see "Super test comment 02"
|
|
|
88 |
And I should see "Super test comment 16"
|
|
|
89 |
And I should not see "Super test comment 17"
|
|
|
90 |
And I should not see "Super test comment 31"
|
|
|
91 |
And I click on "3" "link" in the ".block_comments .comment-paging" "css_element"
|
|
|
92 |
And I should see "Super test comment 01"
|
|
|
93 |
And I should not see "Super test comment 02"
|
|
|
94 |
And I should not see "Super test comment 16"
|
|
|
95 |
And I should not see "Super test comment 17"
|
|
|
96 |
And I should not see "Super test comment 31"
|
|
|
97 |
And I click on "1" "link" in the ".block_comments .comment-paging" "css_element"
|
|
|
98 |
And I should not see "Super test comment 01"
|
|
|
99 |
And I should not see "Super test comment 02"
|
|
|
100 |
And I should not see "Super test comment 16"
|
|
|
101 |
And I should see "Super test comment 17"
|
|
|
102 |
And I should see "Super test comment 31"
|