HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30
System: Linux multiplicar 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64
User: root (0)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /var/www/html/demo.sumarbc.com.py/grade/tests/behat/grade_item_duplication.feature
@core @core_grades
Feature: We can duplicate grade items that already exist.
  In order to quickly create grade items that have similar settings.
  As a teacher
  I need to duplicate an existing grade item and check that its values are properly duplicated.

  Background:
    Given the following "courses" exist:
      | fullname | shortname | format |
      | Course 1 | C1 | topics |
    And the following "grade categories" exist:
      | fullname  | course |
      | Category1 | C1     |
    And the following "activities" exist:
      | activity | course | idnumber | name        | gradecategory |
      | assign   | C1     | a1       | Assignment1 | Category1     |
    And the following "users" exist:
      | username | firstname | lastname | email |
      | teacher1 | Teacher | 1 | teacher1@example.com |
    And the following "course enrolments" exist:
      | user | course | role |
      | teacher1 | C1 | editingteacher |
    And the following "grade items" exist:
      | itemname | course | category  | idnumber | gradetype | grademax | grademin | gradepass | display | decimals | hidden | weightoverride |
      | Item1    | C1     | Category1 | 001      | Value     | 80.00    | 5.00     | 40.00     | 1       | 1        | 0      | 1              |

  Scenario: Ensure the duplicated grade item settings match the original grade item
    Given I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
    And I should not see "Duplicate   Category1"
    And I should not see "Duplicate   Assignment1"
    When I duplicate the grade item "Item1"
    Then I should see "Item1 (copy)"
    And I follow "Edit   Item1 (copy)"
    And the field "Item name" matches value "Item1 (copy)"
    And the field "ID number" matches value ""
    And the field "Grade type" matches value "Value"
    And the field "Maximum grade" matches value "80.00"
    And the field "Minimum grade" matches value "5.00"
    And the field "Grade to pass" matches value "40.00"
    And the field "Grade display type" matches value "Real"
    And the field "Overall decimal places" matches value "1"
    And the field "Hidden" matches value "0"
    And the field "Weight adjusted" matches value "1"