1 |
efrain |
1 |
@mod @mod_forum @javascript
|
|
|
2 |
Feature: Students can choose from 4 discussion display options and their choice is remembered
|
|
|
3 |
In order to read forum posts in a suitable view
|
|
|
4 |
As a user
|
|
|
5 |
I need to select which display method I want to use
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| student1 | C1 | student |
|
|
|
17 |
And the following "activity" exists:
|
|
|
18 |
| course | C1 |
|
|
|
19 |
| activity | forum |
|
|
|
20 |
| name | Test forum name |
|
|
|
21 |
| idnumber | forum |
|
|
|
22 |
And the following "mod_forum > discussions" exist:
|
|
|
23 |
| forum | name | subject | message |
|
|
|
24 |
| forum | Discussion 1 | Discussion 1 | Discussion contents 1, first message |
|
|
|
25 |
| forum | Discussion 2 | Discussion 2 | Discussion contents 2, first message |
|
|
|
26 |
And the following "mod_forum > posts" exist:
|
|
|
27 |
| parentsubject | subject | message |
|
|
|
28 |
| Discussion 1 | Reply 1 to discussion 1 | Discussion contents 1, second message |
|
|
|
29 |
| Discussion 2 | Reply 1 to discussion 2 | Discussion contents 2, second message |
|
|
|
30 |
|
|
|
31 |
Scenario: Display replies flat, with oldest first
|
|
|
32 |
Given I am on the "Course 1" course page logged in as student1
|
|
|
33 |
And I reply "Discussion 1" post from "Test forum name" forum with:
|
|
|
34 |
| Subject | Reply 2 to discussion 1 |
|
|
|
35 |
| Message | Discussion contents 1, third message |
|
|
|
36 |
When I select "Display replies flat, with oldest first" from the "mode" singleselect
|
|
|
37 |
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
|
|
|
38 |
And I should see "Discussion contents 1, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
|
|
|
39 |
And I reply "Discussion 2" post from "Test forum name" forum with:
|
|
|
40 |
| Subject | Reply 2 to discussion 2 |
|
|
|
41 |
| Message | Discussion contents 2, third message |
|
|
|
42 |
And the field "Display mode" matches value "Display replies flat, with oldest first"
|
|
|
43 |
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
|
|
|
44 |
And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
|
|
|
45 |
|
|
|
46 |
Scenario: Display replies flat, with newest first
|
|
|
47 |
Given I am on the "Course 1" course page logged in as student1
|
|
|
48 |
And I reply "Discussion 1" post from "Test forum name" forum with:
|
|
|
49 |
| Subject | Reply 2 to discussion 1 |
|
|
|
50 |
| Message | Discussion contents 1, third message |
|
|
|
51 |
When I select "Display replies flat, with newest first" from the "mode" singleselect
|
|
|
52 |
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
|
|
|
53 |
And I should see "Discussion contents 1, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
|
|
|
54 |
And I reply "Discussion 2" post from "Test forum name" forum with:
|
|
|
55 |
| Subject | Reply 2 to discussion 2 |
|
|
|
56 |
| Message | Discussion contents 2, third message |
|
|
|
57 |
And the field "Display mode" matches value "Display replies flat, with newest first"
|
|
|
58 |
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
|
|
|
59 |
And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
|
|
|
60 |
|
|
|
61 |
Scenario: Display replies in threaded form
|
|
|
62 |
Given I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
63 |
And I follow "Discussion 1"
|
|
|
64 |
When I select "Display replies in threaded form" from the "mode" singleselect
|
|
|
65 |
Then I should see "Discussion contents 1, first message"
|
|
|
66 |
And I should see "Reply 1 to discussion 1" in the "div.forumthread" "css_element"
|
|
|
67 |
And I click on "Test forum name" "link" in the "page-header" "region"
|
|
|
68 |
And I follow "Discussion 2"
|
|
|
69 |
And the field "Display mode" matches value "Display replies in threaded form"
|
|
|
70 |
And I should see "Discussion contents 2, first message"
|
|
|
71 |
And I should see "Reply 1 to discussion 2" in the "div.forumthread" "css_element"
|
|
|
72 |
|
|
|
73 |
Scenario: Display replies in nested form
|
|
|
74 |
Given I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
75 |
And I follow "Discussion 1"
|
|
|
76 |
When I select "Display replies in nested form" from the "mode" singleselect
|
|
|
77 |
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
|
|
|
78 |
And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
|
|
|
79 |
And I click on "Test forum name" "link" in the "page-header" "region"
|
|
|
80 |
And I follow "Discussion 2"
|
|
|
81 |
And the field "Display mode" matches value "Display replies in nested form"
|
|
|
82 |
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
|
|
|
83 |
And I should see "Discussion contents 2, second message" in the "div.indent div.forumpost" "css_element"
|