Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_blog_menu @block_blog_recent
2
Feature: Students can use the recent blog entries block to view recent entries on a course page
3
  In order to enable the recent blog entries block a course page
4
  As a teacher
5
  I can add the recent blog entries block to a course page
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | idnumber |
10
      | student1 | Student | 1 | student1@example.com | S1 |
11
      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1 | 0 |
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
      | blog_menu   | Course       | C1        | course-view-*   | side-pre      |
22
      | blog_recent | Course       | C1        | course-view-*   | side-pre      |
23
    And the "multilang" filter is "on"
24
    And the "multilang" filter applies to "content and headings"
25
 
26
  Scenario: Students use the recent blog entries block to view blogs
27
    Given I am on the "Course 1" course page logged in as student1
28
    And I follow "Add an entry about this course"
29
    When I set the following fields to these values:
30
      | Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
31
      | Blog entry body | This is my awesome blog! |
32
    And I press "Save changes"
33
    Then I should see "S1 First Blog ENGLISH"
34
    And I should see "This is my awesome blog!"
35
    And I am on "Course 1" course homepage
36
    And I should see "S1 First Blog ENGLISH"
37
    And I follow "S1 First Blog"
38
    And I should see "This is my awesome blog!"
39
 
40
  Scenario: Students only see a few entries in the recent blog entries block
41
    Given I am on the "Course 1" course page logged in as student1
42
    And I follow "Add an entry about this course"
43
    # Blog 1 of 5
44
    And I set the following fields to these values:
45
      | Entry title | S1 First Blog |
46
      | Blog entry body | This is my awesome blog! |
47
    And I press "Save changes"
48
    And I wait "1" seconds
49
    And I am on "Course 1" course homepage
50
    And I follow "Add an entry about this course"
51
    # Blog 2 of 5
52
    And I set the following fields to these values:
53
      | Entry title | S1 Second Blog |
54
      | Blog entry body | This is my awesome blog! |
55
    And I press "Save changes"
56
    And I wait "1" seconds
57
    And I should see "S1 Second Blog"
58
    And I should see "This is my awesome blog!"
59
    And I am on "Course 1" course homepage
60
    And I follow "Add an entry about this course"
61
    # Blog 3 of 5
62
    And I set the following fields to these values:
63
      | Entry title | S1 Third Blog |
64
      | Blog entry body | This is my awesome blog! |
65
    And I press "Save changes"
66
    And I wait "1" seconds
67
    And I should see "S1 Third Blog"
68
    And I should see "This is my awesome blog!"
69
    And I am on "Course 1" course homepage
70
    And I follow "Add an entry about this course"
71
    # Blog 4 of 5
72
    And I set the following fields to these values:
73
      | Entry title | S1 Fourth Blog |
74
      | Blog entry body | This is my awesome blog! |
75
    And I press "Save changes"
76
    And I wait "1" seconds
77
    And I should see "S1 Fourth Blog"
78
    And I should see "This is my awesome blog!"
79
    And I am on "Course 1" course homepage
80
    And I follow "Add an entry about this course"
81
    # Blog 5 of 5
82
    And I set the following fields to these values:
83
      | Entry title | S1 Fifth Blog |
84
      | Blog entry body | This is my awesome blog! |
85
    And I press "Save changes"
86
    And I should see "S1 Fifth Blog"
87
    And I should see "This is my awesome blog!"
88
    When I am on "Course 1" course homepage
89
    And I should not see "S1 First Blog"
90
    And I should see "S1 Second Blog"
91
    And I should see "S1 Third Blog"
92
    And I should see "S1 Fourth Blog"
93
    And I should see "S1 Fifth Blog"
94
    And I follow "S1 Fifth Blog"
95
    And I should see "This is my awesome blog!"
96
    Then I log out
97
    And I log in as "teacher1"
98
    And I am on "Course 1" course homepage with editing mode on
99
    And I configure the "Recent blog entries" block
100
    And I set the following fields to these values:
101
      | config_numberofrecentblogentries | 2 |
102
    And I press "Save changes"
103
    And I should see "S1 Fourth Blog"
104
    And I should see "S1 Fifth Blog"