| 1 | 
           efrain | 
           1 | 
           @core @core_completion @javascript
  | 
        
        
            | 
            | 
           2 | 
           Feature: Show activity completion status or activity completion configuration on the course page
  | 
        
        
            | 
            | 
           3 | 
             In order to understand the configuration or status of an activity's completion
  | 
        
        
            | 
            | 
           4 | 
             As a user
  | 
        
        
            | 
            | 
           5 | 
             I need to see the appropriate completion information for each activity in the course homepage
  | 
        
        
            | 
            | 
           6 | 
              | 
        
        
            | 
            | 
           7 | 
             Background:
  | 
        
        
            | 
            | 
           8 | 
               Given the following "courses" exist:
  | 
        
        
            | 
            | 
           9 | 
                 | fullname | shortname | category | enablecompletion |
  | 
        
        
            | 
            | 
           10 | 
                 | Course 1 | C1        | 0        | 1                |
  | 
        
        
            | 
            | 
           11 | 
               And the following "users" exist:
  | 
        
        
            | 
            | 
           12 | 
                 | username | firstname | lastname | email |
  | 
        
        
            | 
            | 
           13 | 
                 | teacher1 | Teacher   | First    | teacher1@example.com |
  | 
        
        
            | 
            | 
           14 | 
                 | teacher2 | Teacher   | Second   | teacher2@example.com |
  | 
        
        
            | 
            | 
           15 | 
                 | student1 | Student   | First    | student1@example.com |
  | 
        
        
            | 
            | 
           16 | 
               And the following "course enrolments" exist:
  | 
        
        
            | 
            | 
           17 | 
                 | user | course | role |
  | 
        
        
            | 
            | 
           18 | 
                 | teacher1 | C1 | editingteacher |
  | 
        
        
            | 
            | 
           19 | 
                 | teacher2 | C1 | teacher |
  | 
        
        
            | 
            | 
           20 | 
                 | student1 | C1 | student |
  | 
        
        
            | 
            | 
           21 | 
               And the following "activities" exist:
  | 
        
        
            | 
            | 
           22 | 
                 | activity | course | idnumber | name                 | intro                       | completion | completionview | completionexpected |
  | 
        
        
            | 
            | 
           23 | 
                 | assign   | C1     | assign1  | Test assignment name | Test assignment description | 2          | 1              | 0                  |
  | 
        
        
            | 
            | 
           24 | 
                 | quiz     | C1     | quiz1    | Test quiz name       | Test quiz description       | 0          | 0              | 0                  |
  | 
        
        
            | 
            | 
           25 | 
                 | forum    | C1     | forum1   | Test forum name      |                             | 1          | 0              | 0                  |
  | 
        
        
            | 
            | 
           26 | 
              | 
        
        
            | 
            | 
           27 | 
             Scenario: Show completion status to students
  | 
        
        
            | 
            | 
           28 | 
               Given I am on the "Course 1" course page logged in as student1
  | 
        
        
            | 
            | 
           29 | 
               And the manual completion button of "Test forum name" is displayed as "Mark as done"
  | 
        
        
            | 
            | 
           30 | 
               And the "View" completion condition of "Test assignment name" is displayed as "todo"
  | 
        
        
            | 
            | 
           31 | 
               And there should be no completion information shown for "Test quiz name"
  | 
        
        
            | 
            | 
           32 | 
              | 
        
        
            | 
            | 
           33 | 
             Scenario: Show completion configuration to editing teachers
  | 
        
        
            | 
            | 
           34 | 
               Given I am on the "Course 1" course page logged in as teacher1
  | 
        
        
            | 
            | 
           35 | 
               And "Test forum name" should have the "Mark as done" completion condition
  | 
        
        
            | 
            | 
           36 | 
               And "Test assignment name" should have the "View" completion condition
  | 
        
        
            | 
            | 
           37 | 
               And there should be no completion information shown for "Test quiz name"
  | 
        
        
            | 
            | 
           38 | 
               And I am on "Course 1" course homepage with editing mode on
  | 
        
        
            | 
            | 
           39 | 
               And "Test forum name" should have the "Mark as done" completion condition
  | 
        
        
            | 
            | 
           40 | 
               And "Test assignment name" should have the "View" completion condition
  | 
        
        
            | 
            | 
           41 | 
               And there should be no completion information shown for "Test quiz name"
  | 
        
        
            | 
            | 
           42 | 
              | 
        
        
            | 
            | 
           43 | 
             Scenario: Show completion configuration to non-editing teachers
  | 
        
        
            | 
            | 
           44 | 
               Given I am on the "Course 1" course page logged in as teacher2
  | 
        
        
            | 
            | 
           45 | 
               And "Test forum name" should have the "Mark as done" completion condition
  | 
        
        
            | 
            | 
           46 | 
               And "Test assignment name" should have the "View" completion condition
  | 
        
        
            | 
            | 
           47 | 
               And there should be no completion information shown for "Test quiz name"
  |