Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
@core @core_badges @_file_upload @javascript
1
@core @core_badges @_file_upload @javascript
2
Feature: Manage badges is not shown when there are no existing badges.
2
Feature: Badges not shown when there are no existing badges.
Línea 3... Línea 3...
3
 
3
 
4
  Scenario: Check navigation at site level with no badges
4
  Scenario: Check navigation at site level with no badges
5
    Given I log in as "admin"
5
    Given I log in as "admin"
6
    When I navigate to "Badges > Manage badges" in site administration
6
    When I navigate to "Badges > Manage badges" in site administration
7
    And I should see "There are currently no badges available for users to earn"
-
 
Línea 8... Línea 7...
8
    Then "Manage badges" "button" should not exist
7
    Then I should see "There are no matching badges available for users to earn."
9
 
8
 
10
  Scenario: Check navigation at course level with no badges
9
  Scenario: Check navigation at course level with no badges
11
    Given the following "users" exist:
10
    Given the following "users" exist:
Línea 18... Línea 17...
18
      | user     | course | role           |
17
      | user     | course | role           |
19
      | teacher | C1     | editingteacher |
18
      | teacher | C1     | editingteacher |
20
    And I log in as "teacher"
19
    And I log in as "teacher"
21
    And I am on "Course 1" course homepage
20
    And I am on "Course 1" course homepage
22
    When I navigate to "Badges" in current page administration
21
    When I navigate to "Badges" in current page administration
23
    Then "Manage badges" "button" should not exist
-
 
24
    And I click on "Add a new badge" "button"
22
    Then I click on "Add a new badge" "button"
25
    And I set the following fields to these values:
23
    And I set the following fields to these values:
26
      | Name | Testing course badge |
24
      | Name | Testing course badge |
27
      | Version | 1.1 |
25
      | Version | 1.1 |
28
      | Language | Basque |
26
      | Language | Basque |
29
      | Description | Testing course badge description |
27
      | Description | Testing course badge description |
30
      | Image author | http://author.example.com |
-
 
31
      | Image caption | Test caption image |
28
      | Image caption | Test caption image |
32
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
29
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
33
    And I click on "Create badge" "button"
30
    And I click on "Create badge" "button"
34
    And I click on "Back" "button"
31
    And I click on "Back" "button"
35
    And I should see "Testing course badge"
32
    And I should see "Testing course badge"
36
    And I click on "Back" "button"
-
 
37
    And "Manage badges" "button" should exist
-
 
38
#    Badge is not enabled so is not listed.
-
 
39
    And I should not see "Testing course badge"
-
 
40
    And I click on "Manage badges" "button"
-
 
41
    And I press "Edit" action in the "Testing course badge" report row
33
    And I press "Edit" action in the "Testing course badge" report row
42
    And I click on "Add criteria" "button"
34
    And I click on "Add criteria" "button"
43
    And I set the field "type" to "Manual issue by role"
35
    And I set the field "type" to "Manual issue by role"
44
    And I expand all fieldsets
36
    And I expand all fieldsets
45
    And I set the field "Teacher" to "1"
37
    And I set the field "Teacher" to "1"
46
    And I click on "Save" "button"
38
    And I click on "Save" "button"
47
    And I click on "Back" "button"
39
    And I click on "Back" "button"
48
    And I should see "Testing course badge"
40
    And I should see "Testing course badge"
49
    And I click on "Back" "button"
-
 
50
    And "Manage badges" "button" should exist
-
 
51
#    Badge is not enabled yet so is not listed.
-
 
52
    And I should not see "Testing course badge"
-
 
53
    And I click on "Manage badges" "button"
-
 
54
    And I press "Enable access" action in the "Testing course badge" report row
41
    And I press "Enable access" action in the "Testing course badge" report row
55
    And I click on "Continue" "button"
42
    And I click on "Enable" "button" in the "Confirm" "dialogue"
56
    And I should see "Testing course badge"
-
 
57
    And I click on "Back" "button"
-
 
58
    And "Manage badges" "button" should exist
-
 
59
#    Badge is already enabled so is listed.
-
 
60
    And I should see "Testing course badge"
43
    And I should see "Testing course badge"
Línea 61... Línea 44...
61
 
44
 
62
  Scenario: Check navigation at course level with no badges as a student
45
  Scenario: Check navigation at course level with no badges as a student
63
    # Create a badge, but leave it not enabled for now.
46
    # Create a badge, but leave it not enabled for now.
Línea 88... Línea 71...
88
    Then "Badges" "link" should not exist in current page administration
71
    Then "Badges" "link" should not exist in current page administration
89
    And I log out
72
    And I log out
90
    # Enable the badge.
73
    # Enable the badge.
91
    And I am on the "C1" "Course" page logged in as "admin"
74
    And I am on the "C1" "Course" page logged in as "admin"
92
    And I navigate to "Badges" in current page administration
75
    And I navigate to "Badges" in current page administration
93
    And I click on "Manage badges" "button"
-
 
94
    And I press "Enable access" action in the "Testing course badge" report row
76
    And I press "Enable access" action in the "Testing course badge" report row
95
    And I press "Continue"
77
    And I click on "Enable" "button" in the "Confirm" "dialogue"
96
    And I log out
78
    And I log out
97
    # Now student should see the Badges link.
79
    # Now student should see the Badges link.
98
    And I am on the "C1" "Course" page logged in as "student1"
80
    And I am on the "C1" "Course" page logged in as "student1"
99
    And I follow "Badges"
81
    And I follow "Badges"
100
    And "Manage badges" "button" should not exist
-
 
101
    And "Add a new badge" "button" should not exist
82
    And "Add a new badge" "button" should not exist
102
    And I should not see "There are currently no badges available for users to earn."
83
    And I should not see "There are no matching badges available for users to earn."
103
    And the following should exist in the "reportbuilder-table" table:
84
    And the following should exist in the "reportbuilder-table" table:
104
      | Name                  | Description                       | Criteria            |
85
      | Name                  | Criteria            |
105
      | Testing course badge  | Testing course badge description  | Awarded by: Teacher |
86
      | Testing course badge  | Awarded by: Teacher |