Proyectos de Subversion Moodle

Rev

Rev 1 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@block @block_myoverview
1 efrain 2
Feature: Zero state on my overview block
3
  In order to know what should be the next step
4
  As a user
5
  I should see the proper information based on my capabilities
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                | idnumber |
10
      | user     | User      | X        | user@example.com     | U1       |
11
      | manager  | Manager   | X        | manager@example.com  | M1       |
12
    And the following "role assigns" exist:
13
      | user    | role    | contextlevel | reference |
14
      | manager | manager | System       |           |
15
 
16
  Scenario: Users with no permissions don't see any CTA
17
    Given I am on the "My courses" page logged in as "user"
1441 ariadna 18
    When I should see "You're not enrolled in any courses."
1 efrain 19
    Then I should see "Once you're enrolled in a course, it will appear here."
20
    And I should not see "Create course"
21
    And I should not see "Request a course"
22
 
23
  Scenario: Users with permissions to request a course should see a Request course button
24
    Given the following "permission overrides" exist:
25
      | capability            | permission | role  | contextlevel | reference |
26
      | moodle/course:request | Allow      | user  | System       |           |
27
    When I am on the "My courses" page logged in as "user"
28
    Then I should see "Request your first course"
29
    And "Moodle documentation" "link" should exist
30
    And "Quickstart guide" "link" should exist
31
    And "Request a course" "button" should exist
32
    And I click on "Request a course" "button"
33
    And I should see "Details of the course"
1441 ariadna 34
    # Quickstart guide link should not be displayed when $CFG->coursecreationguide is empty.
35
    But the following config values are set as admin:
36
      | coursecreationguide | |
37
    And I am on the "My courses" page
38
    And "Moodle documentation" "link" should exist
39
    And "Quickstart guide" "link" should not exist
1 efrain 40
 
41
  Scenario: Users with permissions to create a course when there is no course created
42
    Given I am on the "My courses" page logged in as "manager"
43
    When I should see "Create your first course"
44
    Then "Moodle documentation" "link" should exist
1441 ariadna 45
    And "Quickstart guide" "link" should exist
46
    And "Manage courses" "button" should not exist
47
    And "Manage course categories" "button" should exist
1 efrain 48
    And "Create course" "button" should exist
49
    And I click on "Create course" "button"
50
    And I should see "Add a new course"
1441 ariadna 51
    # Quickstart guide link should not be displayed when $CFG->coursecreationguide is empty.
52
    But the following config values are set as admin:
53
      | coursecreationguide | |
54
    And I am on the "My courses" page
55
    And "Moodle documentation" "link" should exist
56
    And "Quickstart guide" "link" should not exist
1 efrain 57
 
58
  Scenario: Users with permissions to create a course but is not enrolled in any existing course
59
    Given the following "course" exists:
60
      | fullname         | Course 1 |
61
      | shortname        | C1       |
62
    When I am on the "My courses" page logged in as "manager"
1441 ariadna 63
    Then I should see "You're not enrolled in any courses."
1 efrain 64
    Then I should see "Once you're enrolled in a course, it will appear here."
65
    And "Manage courses" "button" should exist
66
    And "Create course" "button" should exist
67
    And I click on "Create course" "button"
68
    And I should see "Add a new course"
69
    And I am on the "My courses" page
70
    And I click on "Manage courses" "button"
71
    And I should see "Course 1"
72
 
73
  Scenario: Users with permissions to create but not to manage courses and is not enrolled in any existing course
74
    Given the following "permission overrides" exist:
75
      | capability             | permission | role     | contextlevel | reference |
76
      | moodle/category:manage | Prohibit   | manager  | System       |           |
77
    And the following "course" exists:
78
      | fullname         | Course 1 |
79
      | shortname        | C1       |
80
    When I am on the "My courses" page logged in as "manager"
1441 ariadna 81
    Then I should see "You're not enrolled in any courses."
1 efrain 82
    Then I should not see "To view all courses on this sie, go to Manage courses"
83
    And "Manage courses" "button" should not exist
84
    And "Create course" "button" should exist
85
    And I click on "Create course" "button"
86
    And I should see "Add a new course"
87
 
1441 ariadna 88
  @javascript @accessibility
1 efrain 89
  Scenario: Evaluate the accessibility of the My courses (zero state)
90
    When I am on the "My courses" page logged in as "manager"
91
    Then the page should meet accessibility standards