| 1 | efrain | 1 | @mod @mod_folder @core_completion
 | 
        
           |  |  | 2 | Feature: View activity completion information in the folder activity
 | 
        
           |  |  | 3 |   In order to have visibility of folder completion requirements
 | 
        
           |  |  | 4 |   As a student
 | 
        
           |  |  | 5 |   I need to be able to view my folder completion progress
 | 
        
           |  |  | 6 |   | 
        
           |  |  | 7 |   Background:
 | 
        
           |  |  | 8 |     Given the following "users" exist:
 | 
        
           |  |  | 9 |       | username | firstname | lastname | email                |
 | 
        
           |  |  | 10 |       | student1 | Vinnie    | Student1 | student1@example.com |
 | 
        
           |  |  | 11 |       | teacher1 | Darrell   | Teacher1 | teacher1@example.com |
 | 
        
           |  |  | 12 |     And the following "courses" exist:
 | 
        
           |  |  | 13 |       | fullname | shortname | enablecompletion | showcompletionconditions |
 | 
        
           |  |  | 14 |       | Course 1 | C1        | 1                | 1                        |
 | 
        
           |  |  | 15 |       | Course 2 | C2        | 1                | 0                        |
 | 
        
           |  |  | 16 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 17 |       | user | course | role           |
 | 
        
           |  |  | 18 |       | student1 | C1 | student        |
 | 
        
           |  |  | 19 |       | teacher1 | C1 | editingteacher |
 | 
        
           |  |  | 20 |       | student1 | C2 | student        |
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |   Scenario: View automatic completion items
 | 
        
           |  |  | 23 |     Given the following "activity" exists:
 | 
        
           |  |  | 24 |       | activity       | folder        |
 | 
        
           |  |  | 25 |       | course         | C1            |
 | 
        
           |  |  | 26 |       | idnumber       | mh1           |
 | 
        
           |  |  | 27 |       | name           | Music history |
 | 
        
           |  |  | 28 |       | section        | 1             |
 | 
        
           |  |  | 29 |       | completion     | 2             |
 | 
        
           |  |  | 30 |       | completionview | 1             |
 | 
        
           |  |  | 31 |     # Teacher view.
 | 
        
           |  |  | 32 |     And I am on the "Music history" "folder activity" page logged in as teacher1
 | 
        
           |  |  | 33 |     And "Music history" should have the "View" completion condition
 | 
        
           |  |  | 34 |     And I log out
 | 
        
           |  |  | 35 |     # Student view.
 | 
        
           |  |  | 36 |     When I am on the "Music history" "folder activity" page logged in as student1
 | 
        
           |  |  | 37 |     Then the "View" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 |   @javascript
 | 
        
           |  |  | 40 |   Scenario: Use manual completion
 | 
        
           |  |  | 41 |     Given the following "activity" exists:
 | 
        
           |  |  | 42 |       | activity       | folder        |
 | 
        
           |  |  | 43 |       | course         | C1            |
 | 
        
           |  |  | 44 |       | idnumber       | mh1           |
 | 
        
           |  |  | 45 |       | name           | Music history |
 | 
        
           |  |  | 46 |       | section        | 1             |
 | 
        
           |  |  | 47 |       | completion     | 1             |
 | 
        
           |  |  | 48 |     And I am on the "Music history" "folder activity" page logged in as teacher1
 | 
        
           |  |  | 49 |     # Teacher view.
 | 
        
           |  |  | 50 |     And the manual completion button for "Music history" should be disabled
 | 
        
           |  |  | 51 |     And I log out
 | 
        
           |  |  | 52 |     # Student view.
 | 
        
           |  |  | 53 |     When I am on the "Music history" "folder activity" page logged in as student1
 | 
        
           |  |  | 54 |     Then the manual completion button of "Music history" is displayed as "Mark as done"
 | 
        
           |  |  | 55 |     And I toggle the manual completion state of "Music history"
 | 
        
           |  |  | 56 |     And the manual completion button of "Music history" is displayed as "Done"
 | 
        
           |  |  | 57 |   | 
        
           |  |  | 58 |   @javascript
 | 
        
           |  |  | 59 |   Scenario: The manual completion button will be shown on the course page for Inline on a course page display mode
 | 
        
           |  |  | 60 |     Given the following "activity" exists:
 | 
        
           |  |  | 61 |       | activity   | folder        |
 | 
        
           |  |  | 62 |       | course     | C2            |
 | 
        
           |  |  | 63 |       | idnumber   | mh2           |
 | 
        
           |  |  | 64 |       | name       | Music history |
 | 
        
           |  |  | 65 |       | section    | 1             |
 | 
        
           |  |  | 66 |       | completion | 1             |
 | 
        
           |  |  | 67 |       | display    | 1             |
 | 
        
           |  |  | 68 |     When I am on the "Course 2" course page logged in as student1
 | 
        
           |  |  | 69 |     Then the manual completion button for "Music history" should exist
 | 
        
           |  |  | 70 |     And the manual completion button of "Music history" is displayed as "Mark as done"
 | 
        
           |  |  | 71 |     And I toggle the manual completion state of "Music history"
 | 
        
           |  |  | 72 |     And the manual completion button of "Music history" is displayed as "Done"
 |