[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/grade/report/singleview/tests/behat/ -> singleview.feature (source)

   1  @core @core_grades @gradereport_singleview
   2  Feature: We can use Single view
   3    As a teacher
   4    In order to view and edit grades
   5    For users and activities for a course.
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category |
  10        | Course 1 | C1 | 0 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email | idnumber | alternatename |
  13        | teacher1 | Teacher | 1 | [email protected] | t1 | fred |
  14        | student1 | Student | 1 | [email protected] | s1 | james |
  15        | student2 | Student | 2 | [email protected] | s2 | holly |
  16        | student3 | Student | 3 | [email protected] | s3 | anna |
  17        | student4 | Student | 4 | [email protected] | s4 | zac |
  18      And the following "scales" exist:
  19        | name | scale |
  20        | Test Scale | Disappointing, Good, Very good, Excellent |
  21      And the following "grade items" exist:
  22        | itemname | course | gradetype | scale |
  23        | new grade item 1 | C1 | Scale | Test Scale |
  24      And the following "scales" exist:
  25        | name       | scale                                     |
  26        | Test Scale | Disappointing, Good, Very good, Excellent |
  27      And the following "course enrolments" exist:
  28        | user | course | role |
  29        | teacher1 | C1 | editingteacher |
  30        | student1 | C1 | student |
  31        | student2 | C1 | student |
  32        | student3 | C1 | student |
  33        | student4 | C1 | student |
  34      And the following "grade categories" exist:
  35        | fullname | course |
  36        | Sub category 1 | C1|
  37        | Sub category 2 | C1|
  38      And the following "activities" exist:
  39        | activity | course | idnumber | name | intro | grade |
  40        | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
  41        | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
  42        | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
  43        | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
  44      And the following "grade items" exist:
  45        | itemname | course | gradetype |
  46        | Test grade item | C1 | Scale |
  47      And I log in as "teacher1"
  48      And I follow "Course 1"
  49      And I follow "Grades"
  50  
  51    @javascript
  52    Scenario: I can update grades, add feedback and exclude grades.
  53      Given I click on "Single view" "option"
  54      And I click on "Student 4" "option"
  55      And I click on "Override for Test assignment one" "checkbox"
  56      When I set the following fields to these values:
  57          | Grade for Test assignment one | 10.00 |
  58          | Feedback for Test assignment one | test data |
  59      And I click on "Exclude for Test assignment four" "checkbox"
  60      And I press "Update"
  61      Then I should see "Grades were set for 2 items"
  62      And I press "Continue"
  63      And the following should exist in the "generaltable" table:
  64          | Test assignment four |
  65          | excluded |
  66      And the following should exist in the "generaltable" table:
  67          | Test assignment one |
  68          | 10.00 |
  69      And I click on "Show grades for Test assignment three" "link"
  70      And I click on "Override for james (Student) 1" "checkbox"
  71      And I set the following fields to these values:
  72          | Grade for james (Student) 1 | 12.05 |
  73          | Feedback for james (Student) 1 | test data2 |
  74      And I click on "Exclude for holly (Student) 2" "checkbox"
  75      And I press "Update"
  76      Then I should see "Grades were set for 2 items"
  77      And I press "Continue"
  78      And the following should exist in the "generaltable" table:
  79          | Test assignment three |
  80          | 12.05 |
  81          | Excluded |
  82      And I click on "Single view" "link"
  83      And I click on "new grade item 1" "option"
  84      And I click on "Very good" "option"
  85      And I press "Update"
  86      Then I should see "Grades were set for 1 items"
  87      And I press "Continue"
  88      And the following should exist in the "generaltable" table:
  89          | Grade for james (Student) 1 | "Very good" |
  90  
  91    Scenario: Single view links work on grade report.
  92      Given I follow "Single view for Test assignment one"
  93      Then I should see "Test assignment one"
  94      Then I follow "Grader report"
  95      And I follow "Single view for Student 1"
  96      Then I should see "Student 1"
  97  
  98    @javascript
  99    Scenario: I can bulk update grades.
 100      Given I follow "Single view for Student 1"
 101      Then I should see "Student 1"
 102      When I click on "All grades" "option"
 103      And I set the field "Insert value" to "1.0"
 104      And I click on "Perform bulk insert" "checkbox"
 105      And I press "Update"
 106      Then I should see "Grades were set for 9 items"
 107  
 108    Scenario: Navigation works in the Single view.
 109      Given I follow "Single view for Student 1"
 110      Then I should see "Student 1"
 111      And I follow "Student 2"
 112      Then I should see "Student 2"
 113      And I follow "Student 1"
 114      Then I should see "Student 1"
 115      And I click on "Show grades for Test assignment four" "link"
 116      Then I should see "Test assignment four"
 117      And I follow "Test assignment three"
 118      Then I should see "Test assignment three"
 119      And I follow "Test assignment four"
 120      Then I should see "Test assignment four"
 121  
 122    Scenario: Activities are clickable only when
 123      it has a valid activity page.
 124      Given I follow "Single view for Student 1"
 125      And "new grade item 1" "link" should not exist in the "//tbody//tr[position()=1]//td[position()=2]" "xpath_element"
 126      Then "Category total" "link" should not exist in the "//tbody//tr[position()=2]//td[position()=2]" "xpath_element"
 127      And "Course total" "link" should not exist in the "//tbody//tr[position()=last()]//td[position()=2]" "xpath_element"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1