Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_recentlyaccessedcourses @javascript
2
Feature: The recently accessed courses block allows users to easily access their most recently accessed courses
3
  In order to access the most recently accessed courses
4
  As a user
5
  I can use the Recently accessed courses block in my dashboard
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 "categories" exist:
12
      | name        | category | idnumber |
13
      | Category A  | 0        | CATA     |
14
    And the following "courses" exist:
15
      | fullname | shortname | category |
16
      | Course 1 | C1        | 0        |
17
      | Course 2 | C2        | 0        |
18
      | Course 3 | C3        | 0        |
19
      | Course 4 | C4        | CATA     |
20
      | Course 5 | C5        | 0        |
21
    And the following "course enrolments" exist:
22
      | user     | course | role    |
23
      | student1 | C1     | student |
24
      | student1 | C2     | student |
25
      | student1 | C3     | student |
26
      | student1 | C4     | student |
27
      | student1 | C5     | student |
28
    And the following "blocks" exist:
29
      | blockname               | contextlevel | reference | pagetypepattern | defaultregion |
30
      | recentlyaccessedcourses | System       | 1         | my-index        | content       |
31
 
32
  Scenario: User has not accessed any course
33
    Given I log in as "student1"
34
    Then I should see "No recent courses" in the "Recently accessed courses" "block"
35
 
36
  Scenario: User has accessed two courses
37
    Given I log in as "student1"
38
    And I should not see "Course 1" in the "Recently accessed courses" "block"
39
    And I should not see "Course 2" in the "Recently accessed courses" "block"
40
    When I am on "Course 1" course homepage
41
    And I am on "Course 2" course homepage
42
    And I follow "Dashboard"
43
    And I change window size to "large"
44
    Then I should see "Course 1" in the "Recently accessed courses" "block"
45
    And I should see "Course 2" in the "Recently accessed courses" "block"
46
    And I should not see "Course 3" in the "Recently accessed courses" "block"
47
    And I should not see "Course 4" in the "Recently accessed courses" "block"
48
    And I should not see "Course 5" in the "Recently accessed courses" "block"
49
 
50
  Scenario: Show course category name
51
    Given the following config values are set as admin:
52
      | displaycategories | 1 | block_recentlyaccessedcourses |
53
    And I log in as "student1"
54
    And I am on "Course 1" course homepage
55
    And I am on "Course 4" course homepage
56
    And I follow "Dashboard"
57
    And I should see "Category 1" in the "Recently accessed courses" "block"
58
    And I should see "Category A" in the "Recently accessed courses" "block"
59
 
60
  Scenario: Hide course category name
61
    Given the following config values are set as admin:
62
      | displaycategories | 0 | block_recentlyaccessedcourses |
63
    And I log in as "student1"
64
    And I am on "Course 1" course homepage
65
    And I am on "Course 4" course homepage
66
    And I follow "Dashboard"
67
    And I should not see "Category 1" in the "Recently accessed courses" "block"
68
    And I should not see "Category A" in the "Recently accessed courses" "block"
69
 
70
  Scenario: Show short course name
71
    Given the following config values are set as admin:
72
      | courselistshortnames | 1 |
73
    And I log in as "student1"
74
    And I am on "Course 1" course homepage
75
    And I am on "Course 4" course homepage
76
    And I follow "Dashboard"
77
    And I should see "C1" in the "Recently accessed courses" "block"
78
    And I should see "C4" in the "Recently accessed courses" "block"
79
 
80
  Scenario: Hide short course name
81
    Given the following config values are set as admin:
82
      | courselistshortnames | 0 |
83
    And I log in as "student1"
84
    And I am on "Course 1" course homepage
85
    And I am on "Course 4" course homepage
86
    And I follow "Dashboard"
87
    And I should not see "C1" in the "Recently accessed courses" "block"
88
    And I should not see "C4" in the "Recently accessed courses" "block"