[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/grade/tests/behat/ -> grade_item_validation.feature (source)

   1  @core_grades
   2  Feature: Editing a grade item
   3    In order to ensure validation is provided to the teacher
   4    As a teacher
   5    I need to know why I can not add/edit values on the grade item form
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | student1 | Student | 1 | student1@example.com |
  11        | teacher1 | Teacher | 1 | teacher1@example.com |
  12      And the following "courses" exist:
  13        | fullname | shortname | category | groupmode |
  14        | Course 1 | C1 | 0 | 1 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And I log in as "admin"
  20      And I navigate to "Scales" node in "Site administration > Grades"
  21      And I press "Add a new scale"
  22      And I set the following fields to these values:
  23        | Name  | ABCDEF |
  24        | Scale | F,E,D,C,B,A |
  25      And I press "Save changes"
  26      And I press "Add a new scale"
  27      And I set the following fields to these values:
  28        | Name  | Letter scale |
  29        | Scale | Disappointing, Good, Very good, Excellent |
  30      And I press "Save changes"
  31      And I am on site homepage
  32      And I follow "Course 1"
  33      And I navigate to "Gradebook setup" node in "Course administration"
  34      And I press "Add grade item"
  35      And I set the following fields to these values:
  36        | Item name | MI 1 |
  37      And I press "Save changes"
  38  
  39    Scenario: Being able to change the grade type, scale and maximum grade for a manual grade item when there are no grades
  40      Given I click on "Edit" "link" in the "MI 1" "table_row"
  41      When I click on "Edit settings" "link" in the "MI 1" "table_row"
  42      Then I should not see "Some grades have already been awarded, so the grade type"
  43      And I set the field "Grade type" to "Scale"
  44      And I press "Save changes"
  45      And I should see "Scale must be selected"
  46      And I set the field "Scale" to "ABCDEF"
  47      And I press "Save changes"
  48      And I should not see "You cannot change the type, as grades already exist for this item"
  49      And I click on "Edit" "link" in the "MI 1" "table_row"
  50      And I click on "Edit settings" "link" in the "MI 1" "table_row"
  51      And I should not see "Some grades have already been awarded, so the grade type"
  52      And I set the field "Scale" to "Letter scale"
  53      And I press "Save changes"
  54      And I should not see "You cannot change the scale, as grades already exist for this item"
  55  
  56    Scenario: Attempting to change a manual item's grade type when grades already exist
  57      Given I navigate to "Grader report" node in "Grade administration"
  58      And I turn editing mode on
  59      And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1"
  60      And I press "Save changes"
  61      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  62      And I click on "Edit" "link" in the "MI 1" "table_row"
  63      When I click on "Edit settings" "link" in the "MI 1" "table_row"
  64      Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
  65      And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'Value')]" "xpath_element" should exist
  66  
  67    Scenario: Attempting to change a manual item's scale when grades already exist
  68      Given I click on "Edit" "link" in the "MI 1" "table_row"
  69      And I click on "Edit settings" "link" in the "MI 1" "table_row"
  70      And I set the field "Grade type" to "Scale"
  71      And I set the field "Scale" to "ABCDEF"
  72      And I press "Save changes"
  73      And I navigate to "Grader report" node in "Grade administration"
  74      And I turn editing mode on
  75      And I give the grade "C" to the user "Student 1" for the grade item "MI 1"
  76      And I press "Save changes"
  77      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  78      And I click on "Edit" "link" in the "MI 1" "table_row"
  79      When I click on "Edit settings" "link" in the "MI 1" "table_row"
  80      Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed."
  81      And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
  82  
  83    Scenario: Attempting to change a manual item's maximum grade when no rescaling option has been chosen
  84      Given I navigate to "Grader report" node in "Grade administration"
  85      And I turn editing mode on
  86      And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1"
  87      And I press "Save changes"
  88      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  89      And I click on "Edit" "link" in the "MI 1" "table_row"
  90      And I click on "Edit settings" "link" in the "MI 1" "table_row"
  91      And I set the field "Maximum grade" to "50"
  92      When I press "Save changes"
  93      Then I should see "You must choose whether to rescale existing grades or not."


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1