1 |
efrain |
1 |
@mod @mod_forum @javascript
|
|
|
2 |
Feature: As a teacher, you can manually lock individual discussions when viewing the discussion
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email |
|
|
|
7 |
| student1 | Student | 1 | student1@example.com |
|
|
|
8 |
And the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "course enrolments" exist:
|
|
|
12 |
| user | course | role |
|
|
|
13 |
| student1 | C1 | student |
|
|
|
14 |
And the following "activity" exists:
|
|
|
15 |
| course | C1 |
|
|
|
16 |
| activity | forum |
|
|
|
17 |
| name | Test forum name |
|
|
|
18 |
| idnumber | forum1 |
|
|
|
19 |
And the following "mod_forum > discussions" exist:
|
|
|
20 |
| user | forum | name | message |
|
|
|
21 |
| admin | forum1 | Discussion 1 | Discussion contents 1, first message |
|
|
|
22 |
| admin | forum1 | Discussion 2 | Discussion contents 2, first message |
|
|
|
23 |
And the following "mod_forum > posts" exist:
|
|
|
24 |
| user | parentsubject | subject | message |
|
|
|
25 |
| admin | Discussion 1 | Reply 1 to discussion 1 | Discussion contents 1, second message |
|
|
|
26 |
| admin | Discussion 2 | Reply 1 to discussion 2 | Discussion contents 2, second message |
|
|
|
27 |
|
|
|
28 |
Scenario: Lock a discussion and view
|
|
|
29 |
Given I am on the "Course 1" course page logged in as admin
|
|
|
30 |
And I navigate to post "Discussion 1" in "Test forum name" forum
|
|
|
31 |
And I press "Settings"
|
|
|
32 |
Then "Lock this discussion" "link" should be visible
|
|
|
33 |
And I follow "Lock this discussion"
|
|
|
34 |
Then I should see "This discussion has been locked so you can no longer reply to it."
|
|
|
35 |
And I press "Settings"
|
|
|
36 |
Then "Lock this discussion" "link" should not be visible
|
|
|
37 |
Then "Unlock this discussion" "link" should be visible
|
|
|
38 |
And I press "Settings"
|
|
|
39 |
And I follow "Discussion 2"
|
|
|
40 |
Then I should not see "This discussion has been locked so you can no longer reply to it."
|
|
|
41 |
And I am on the "Course 1" course page logged in as student1
|
|
|
42 |
And I navigate to post "Discussion 1" in "Test forum name" forum
|
|
|
43 |
Then I should see "This discussion has been locked so you can no longer reply to it."
|
|
|
44 |
And "Reply" "link" should not be visible
|
|
|
45 |
|
|
|
46 |
@accessibility
|
|
|
47 |
Scenario: A locked discussion must be accessible
|
|
|
48 |
Given I am on the "Course 1" course page logged in as admin
|
|
|
49 |
And I navigate to post "Discussion 1" in "Test forum name" forum
|
|
|
50 |
When I reply "Discussion 1" post from "Test forum name" forum with:
|
|
|
51 |
| Subject | Discussion 1: Hello world! |
|
|
|
52 |
| Message | Discussion contents 1, hello world! |
|
|
|
53 |
# Check discussion view accessibility with success notification shown on post.
|
|
|
54 |
Then the page should meet accessibility standards with "wcag143" extra tests
|
|
|
55 |
And I press "Settings"
|
|
|
56 |
When I follow "Lock this discussion"
|
|
|
57 |
# Check discussion view accessibility with info notification shown when discussion is locked.
|
|
|
58 |
And the page should meet accessibility standards with "wcag143" extra tests
|
|
|
59 |
And I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
60 |
# Check discussion list accessibility with danger pill shown when discussion is locked.
|
|
|
61 |
And the page should meet accessibility standards with "wcag143" extra tests
|
|
|
62 |
And I follow "Preferences" in the user menu
|
|
|
63 |
And I click on "Forum preferences" "link"
|
|
|
64 |
And I set the following fields to these values:
|
|
|
65 |
| Use experimental nested discussion view | Yes |
|
|
|
66 |
And I press "Save changes"
|
|
|
67 |
And I am on "Course 1" course homepage
|
|
|
68 |
And I navigate to post "Discussion 1" in "Test forum name" forum
|
|
|
69 |
# Check experimental discussion view accessibility with danger pill shown when discussion is locked.
|
|
|
70 |
And the page should meet accessibility standards with "wcag143" extra tests
|