Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_calendar_month
2
Feature: Enable the calendar block in a course and test it's functionality
3
  In order to enable the calendar block in a course
4
  As a teacher
5
  I can add the calendar block to a course
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | idnumber |
10
      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11
      | student1 | Student | 1 | student1@example.com | S1 |
12
      | student2 | Student | 2 | student2@example.com | S2 |
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
      | teacher1 | C1 | editingteacher |
19
      | student1 | C1 | student |
20
      | student2 | C1 | student |
21
 
22
  Scenario: Add the block to a the course
23
    Given I log in as "teacher1"
24
    And I am on "Course 1" course homepage with editing mode on
25
    When I add the "Calendar" block
26
    Then "Calendar" "block" should exist
27
 
28
  @javascript
29
  Scenario: View a site event in the calendar block
30
    Given I log in as "admin"
31
    And I create a calendar event with form data:
32
      | id_eventtype | Site |
33
      | id_name | Site Event |
34
    And I log out
35
    When I log in as "teacher1"
36
    And I am on "Course 1" course homepage with editing mode on
37
    And I add the "Calendar" block
38
    And I hover over today in the mini-calendar block
39
    Then I should see "Site Event"
40
 
41
  @javascript
42
  Scenario: View a course event in the calendar block
43
    Given I log in as "teacher1"
44
    And I create a calendar event with form data:
45
      | Type of event | course        |
46
      | Course        | Course 1      |
47
      | Event title   | Course Event  |
48
    When I am on "Course 1" course homepage with editing mode on
49
    And I add the "Calendar" block
50
    And I hover over today in the mini-calendar block
51
    Then I should see "Course Event"
52
 
53
  @javascript
54
  Scenario: View a user event in the calendar block
55
    Given the following "blocks" exist:
56
      | blockname      | contextlevel | reference | pagetypepattern | defaultregion |
57
      | calendar_month | Course       | C1        | course-view-*   | side-pre      |
58
    And I log in as "teacher1"
59
    And I create a calendar event with form data:
60
      | id_eventtype | User |
61
      | id_name | User Event |
62
    When I am on "Course 1" course homepage
63
    And I hover over today in the mini-calendar block
64
    Then I should see "User Event"
65
 
66
  @javascript
67
  Scenario: View a group event in the calendar block
68
    Given the following "groups" exist:
69
      | name    | course | idnumber |
70
      | Group 1 | C1     | G1       |
71
      | Group 2 | C1     | G2       |
72
    And the following "group members" exist:
73
      | user     | group   |
74
      | student1 | G1 |
75
      | student2 | G2 |
76
    When I am on the "Course 1" "course editing" page logged in as teacher1
77
    And I set the following fields to these values:
78
      | id_groupmode | Separate groups |
79
      | id_groupmodeforce | Yes |
80
    And I press "Save and display"
81
    And I turn editing mode on
82
    And I add the "Calendar" block
83
    And I click on "Course calendar" "link"
84
    And I create a calendar event:
85
      | Type of event | group       |
86
      | Group         | Group 1     |
87
      | Event title   | Group Event |
88
    And I am on the "Course 1" course page logged in as student1
89
    And I hover over today in the mini-calendar block
90
    Then I should see "Group Event"
91
    And I am on the "Course 1" course page logged in as student2
92
    And I should not see "Group Event"