1 |
efrain |
1 |
@mod @mod_forum @javascript
|
|
|
2 |
Feature: Guest and not logged users could see the option to add new post or reply
|
|
|
3 |
In order to guide users to create an account
|
|
|
4 |
As a guest or not logged user
|
|
|
5 |
I want to see the option to add new post or reply
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following config values are set as admin:
|
|
|
9 |
| enrol_guest | Yes |
|
|
|
10 |
And the following "users" exist:
|
|
|
11 |
| username | firstname | lastname | email |
|
|
|
12 |
| teacher | Teacher | 1 | teacher@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher | C1 | editingteacher |
|
|
|
19 |
And I am on the "Course 1" "enrolment methods" page logged in as teacher
|
|
|
20 |
And I click on "Enable" "link" in the "Guest access" "table_row"
|
|
|
21 |
|
|
|
22 |
Scenario Outline: As a not enrolled guest I don't see the option to add a new discussion
|
|
|
23 |
Given the following "activities" exist:
|
|
|
24 |
| activity | name | course | idnumber | type |
|
|
|
25 |
| forum | Forum | C1 | forum | <type> |
|
|
|
26 |
And the following "mod_forum > discussions" exist:
|
|
|
27 |
| user | forum | name | message |
|
|
|
28 |
| teacher | forum | Forum discussion 1 | How awesome is this forum discussion? |
|
|
|
29 |
And I log out
|
|
|
30 |
And I am on "Course 1" course homepage
|
|
|
31 |
When I press "Access as a guest"
|
|
|
32 |
And I am on the "Forum" "forum activity" page
|
|
|
33 |
Then I should not see "Add discussion topic"
|
|
|
34 |
And I should see "Forum discussion 1"
|
|
|
35 |
And I click on "Forum discussion 1" "link"
|
|
|
36 |
And I should not see "Reply"
|
|
|
37 |
|
|
|
38 |
Examples:
|
|
|
39 |
| type |
|
|
|
40 |
| general |
|
|
|
41 |
| eachuser |
|
|
|
42 |
| qanda |
|
|
|
43 |
|
|
|
44 |
Scenario: As a not enrolled guest I don't see the option to add a new discussion in a single forum
|
|
|
45 |
Given the following "activities" exist:
|
|
|
46 |
| activity | name | course | idnumber | type |
|
|
|
47 |
| forum | Forum (single discussion) | C1 | forum | single |
|
|
|
48 |
And I log out
|
|
|
49 |
And I am on "Course 1" course homepage
|
|
|
50 |
When I press "Access as a guest"
|
|
|
51 |
And I am on the "Forum (single discussion)" "forum activity" page
|
|
|
52 |
Then I should not see "Add discussion topic"
|
|
|
53 |
And I should see "Forum (single discussion)"
|
|
|
54 |
And I should not see "Reply"
|
|
|
55 |
|
|
|
56 |
Scenario: As a not enrolled guest I don't see the option to add a new discussion in a blog type forum
|
|
|
57 |
Given the following "activities" exist:
|
|
|
58 |
| activity | name | course | idnumber | type |
|
|
|
59 |
| forum | Forum | C1 | forum | blog |
|
|
|
60 |
And the following "mod_forum > discussions" exist:
|
|
|
61 |
| user | forum | name | message |
|
|
|
62 |
| teacher | forum | Forum discussion 1 | How awesome is this forum discussion? |
|
|
|
63 |
And I log out
|
|
|
64 |
And I am on "Course 1" course homepage
|
|
|
65 |
When I press "Access as a guest"
|
|
|
66 |
And I am on the "Forum" "forum activity" page
|
|
|
67 |
Then I should not see "Add discussion topic"
|
|
|
68 |
And I should see "Forum discussion 1"
|
|
|
69 |
And I should not see "Reply"
|
|
|
70 |
|
|
|
71 |
Scenario Outline: As an enrolled guest I see the option to add a new discussion
|
|
|
72 |
Given I am on the "Course 1" "enrolment methods" page logged in as teacher
|
|
|
73 |
And I click on "Enable" "link" in the "Self enrolment" "table_row"
|
|
|
74 |
And the following "activities" exist:
|
|
|
75 |
| activity | name | course | idnumber | type |
|
|
|
76 |
| forum | Forum | C1 | forum | <type> |
|
|
|
77 |
And the following "mod_forum > discussions" exist:
|
|
|
78 |
| user | forum | name | message |
|
|
|
79 |
| teacher | forum | Forum discussion 1 | How awesome is this forum discussion? |
|
|
|
80 |
And I log out
|
|
|
81 |
And I am on "Course 1" course homepage
|
|
|
82 |
When I press "Access as a guest"
|
|
|
83 |
And I am on the "Forum" "forum activity" page
|
|
|
84 |
Then I should see "Add discussion topic"
|
|
|
85 |
And I click on "Add discussion topic" "link"
|
|
|
86 |
And I should see "Only logged in users can post to this forum"
|
|
|
87 |
And I click on "Cancel" "button"
|
|
|
88 |
And I should see "Forum discussion 1"
|
|
|
89 |
And I click on "Forum discussion 1" "link"
|
|
|
90 |
And I should see "Reply"
|
|
|
91 |
And I click on "Reply" "link"
|
|
|
92 |
And I should see "Only logged in users can post to this forum"
|
|
|
93 |
And I click on "Log in" "button"
|
|
|
94 |
And I should see "Log in"
|
|
|
95 |
|
|
|
96 |
Examples:
|
|
|
97 |
| type |
|
|
|
98 |
| general |
|
|
|
99 |
| eachuser |
|
|
|
100 |
| qanda |
|
|
|
101 |
|
|
|
102 |
Scenario: As an enrolled guest I see the option to reply in a single forum
|
|
|
103 |
Given I am on the "Course 1" "enrolment methods" page logged in as teacher
|
|
|
104 |
And I click on "Enable" "link" in the "Self enrolment" "table_row"
|
|
|
105 |
And the following "activities" exist:
|
|
|
106 |
| activity | name | course | idnumber | type |
|
|
|
107 |
| forum | Forum (single discussion) | C1 | forum | single |
|
|
|
108 |
And I log out
|
|
|
109 |
And I am on "Course 1" course homepage
|
|
|
110 |
When I press "Access as a guest"
|
|
|
111 |
And I am on the "Forum (single discussion)" "forum activity" page
|
|
|
112 |
And I should see "Forum (single discussion)"
|
|
|
113 |
Then I should see "Reply"
|
|
|
114 |
And I click on "Reply" "link"
|
|
|
115 |
And I should see "Only logged in users can post to this forum"
|
|
|
116 |
And I click on "Cancel" "button"
|
|
|
117 |
And I should see "Reply"
|
|
|
118 |
And I click on "Reply" "link"
|
|
|
119 |
And I click on "Log in" "button"
|
|
|
120 |
And I should see "Log in"
|
|
|
121 |
|
|
|
122 |
Scenario: As an enrolled guest I see the option to reply in a blog type forum
|
|
|
123 |
Given I am on the "Course 1" "enrolment methods" page logged in as teacher
|
|
|
124 |
And I click on "Enable" "link" in the "Self enrolment" "table_row"
|
|
|
125 |
And the following "activities" exist:
|
|
|
126 |
| activity | name | course | idnumber | type |
|
|
|
127 |
| forum | Forum | C1 | forum | blog |
|
|
|
128 |
And the following "mod_forum > discussions" exist:
|
|
|
129 |
| user | forum | name | message |
|
|
|
130 |
| teacher | forum | Forum discussion 1 | How awesome is this forum discussion? |
|
|
|
131 |
And I log out
|
|
|
132 |
And I am on "Course 1" course homepage
|
|
|
133 |
When I press "Access as a guest"
|
|
|
134 |
And I am on the "Forum" "forum activity" page
|
|
|
135 |
Then I should see "Add discussion topic"
|
|
|
136 |
And I click on "Add discussion topic" "link"
|
|
|
137 |
And I should see "Only logged in users can post to this forum"
|
|
|
138 |
And I click on "Cancel" "button"
|
|
|
139 |
And I should see "Forum discussion 1"
|
|
|
140 |
And I click on "Add discussion topic" "link"
|
|
|
141 |
And I should see "Only logged in users can post to this forum"
|
|
|
142 |
And I click on "Log in" "button"
|
|
|
143 |
And I should see "Log in"
|