1+ # This file is part of Moodle - http://moodle.org/
2+ #
3+ # Moodle is free software: you can redistribute it and/or modify
4+ # it under the terms of the GNU General Public License as published by
5+ # the Free Software Foundation, either version 3 of the License, or
6+ # (at your option) any later version.
7+ #
8+ # Moodle is distributed in the hope that it will be useful,
9+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ # GNU General Public License for more details.
12+ #
13+ # You should have received a copy of the GNU General Public License
14+ # along with Moodle. If not, see <http://www.gnu.org/licenses/>.
15+ #
16+ # Tests for course resource and activity editing features.
17+ #
18+ # @package mod_hsuforum
19+ # @copyright Copyright (c) 2017 Open LMS (http://www.openlms.net)
20+ # @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21+
122@mod @mod_hsuforum @core_tag
2- Feature : Edited Open Forum posts handle tags correctly
3- In order to get forum posts properly labelled
4- As a user
5- I need to introduce the tags while editing
23+ Feature : Open forum posts and new discussions handle tags correctly, in order to get forum posts or discussions labelled .
24+ As a user I need to introduce the tags while creating, editing, or replying.
625
726 Background :
827 Given the following "users" exist:
@@ -25,6 +44,13 @@ Feature: Edited Open Forum posts handle tags correctly
2544 | Subject | Teacher post subject |
2645 | Message | Teacher post message |
2746 And I log out
47+ Given I log in as "admin"
48+ And I navigate to "Appearance > Manage tags" in site administration
49+ And I follow "Default collection"
50+ And I follow "Add standard tags"
51+ And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
52+ And I press "Continue"
53+ And I log out
2854
2955 @javascript
3056 Scenario : Forum post edition of custom tags works as expected
@@ -41,13 +67,6 @@ Feature: Edited Open Forum posts handle tags correctly
4167
4268 @javascript
4369 Scenario : Forum post edition of standard tags works as expected
44- Given I log in as "admin"
45- And I navigate to "Appearance > Manage tags" in site administration
46- And I follow "Default collection"
47- And I follow "Add standard tags"
48- And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
49- And I press "Continue"
50- And I log out
5170 And I log in as "teacher1"
5271 And I am on "Course 1" course homepage
5372 And I follow "Test forum"
@@ -70,3 +89,22 @@ Feature: Edited Open Forum posts handle tags correctly
7089 And I should see "OT1" in the ".form-autocomplete-selection" "css_element"
7190 And I should see "OT3" in the ".form-autocomplete-selection" "css_element"
7291 And I should not see "OT2" in the ".form-autocomplete-selection" "css_element"
92+
93+ @javascript
94+ Scenario : Tags are displayed in a discussion that was just created.
95+ Given I log in as "teacher1"
96+ And I am on "Course 1" course homepage
97+ And I follow "Test forum"
98+ And I click on "Add a new discussion" "button"
99+ And I follow "Use advanced editor and additional options"
100+ And I expand all fieldsets
101+ And I click on ".form-autocomplete-downarrow" "css_element"
102+ And I should see "OT1" in the ".form-autocomplete-suggestions" "css_element"
103+ And I should see "OT2" in the ".form-autocomplete-suggestions" "css_element"
104+ And I should see "OT3" in the ".form-autocomplete-suggestions" "css_element"
105+ And I set the field "Subject" to "Subject test"
106+ And I set the field "Message" to "Message test"
107+ And I set the field "Tags" to "OT1"
108+ And I press "Post to forum"
109+ And I follow "Subject test"
110+ And I should see "OT1"
0 commit comments