Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_badges
2
Feature: Delete course badge already awarded
3
  As a teacher
4
  I can delete awarded course badge
5
 
6
  Background:
7
    Given the following "users" exist:
8
      | username | firstname | lastname | email                |
9
      | teacher1 | Teacher   | 1        | teacher1@example.com |
10
      | student1 | Student   | 1        | student1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname |
13
      | Course 1 | C1        |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
      | student1 | C1     | student        |
18
 
19
  @javascript
20
  Scenario Outline: Delete course badge already awarded to student
21
    Given the following "core_badges > Badges" exist:
1441 ariadna 22
      | name            | course | description                 | image                        | status | type |
23
      | Testing badge 1 | C1     | Testing badge 1 description | badges/tests/behat/badge.png | active | 2    |
1 efrain 24
    And the following "core_badges > Criterias" exist:
1441 ariadna 25
      | badge           | role           |
26
      | Testing badge 1 | editingteacher |
1 efrain 27
    And the following "core_badges > Issued badges" exist:
1441 ariadna 28
      | badge           | user     |
29
      | Testing badge 1 | student1 |
1 efrain 30
    When I am on the "Course 1" "enrolled users" page logged in as "teacher1"
31
    And I click on "Student 1" "link"
1441 ariadna 32
    Then I should see "Testing badge 1"
1 efrain 33
    And I am on the "Course 1" course page
1441 ariadna 34
    # Navigate to Badges page in order to delete the badge
35
    And I navigate to "Badges" in current page administration
1 efrain 36
    # Delete the badge
1441 ariadna 37
    And I press "Delete" action in the "Testing badge 1" report row
1 efrain 38
    And I press "<deleteoption>"
1441 ariadna 39
    And the following <shouldtable> exist in the "reportbuilder-table" table:
40
      | Name            | Badge status |
41
      | Testing badge 1 | Archived     |
42
    And I <shouldmsg> see "There are no matching badges available for users to earn."
43
    # Confirm that badge is retained in the first case as awarded badge but not in the second.
1 efrain 44
    And I am on the "Course 1" "enrolled users" page
45
    And I click on "Student 1" "link"
1441 ariadna 46
    And I <shouldtable> see "Testing badge 1"
1 efrain 47
 
48
    Examples:
1441 ariadna 49
      | deleteoption                             | shouldtable | shouldmsg  |
50
      | Delete and keep existing issued badges   | should      | should not |
51
      | Delete and remove existing issued badges | should not  | should     |