Skip to content

Commit

Permalink
CTP-4026 Add test coverage for newly supported activities
Browse files Browse the repository at this point in the history
  • Loading branch information
aydevworks committed Jan 16, 2025
1 parent 5bc69f9 commit 1e38a8a
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
run: |
moodle-plugin-ci add-plugin -b main --clone https://aspark21:"$GHA_MOODLE_READ_ACCESS"@github.com/ucl-isd/moodle-block_portico_enrolments.git
moodle-plugin-ci add-plugin -b main --clone https://aspark21:"$GHA_MOODLE_READ_ACCESS"@github.com/ucl-isd/moodle-block_lifecycle.git
moodle-plugin-ci add-plugin -b main --clone https://aspark21:"$GHA_MOODLE_READ_ACCESS"@github.com/ucl-isd/moodle-mod_coursework.git
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
Expand Down
36 changes: 36 additions & 0 deletions tests/behat/marks_transfer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,39 @@ Feature: Marks transfer from Moodle to SITS
And I run all adhoc tasks
And I reload the page
Then I should see "0" marks to transfer for "72hr take-home examination (3000 words)"

@javascript @_file_upload
Scenario: Transfer marks for coursework to SITS
Given the "mod_coursework" plugin is installed
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | allowearlyfinalisation | numberofmarkers |
| coursework | Coursework 1 | CW1 desc | C1 | coursework1 | 1 | 1 | 1 |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/coursework:publish | Allow | editingteacher | Course | C1 |
And I am on the "Course 1" course page logged in as student1
And I follow "Coursework 1"
And I press "Upload your submission"
And I upload "lib/tests/fixtures/empty.txt" file to "Upload a file" filemanager
And I press "Submit"
And I press "Finalise your submission"
And I press "Yes"
And I log out
And I am on the "Course 1" course page logged in as teacher1
And I follow "Coursework 1"
And I click on "Add final feedback" "link"
And I press "Save and finalise"
And I reload the page
And I press "Release all grades"
And I press "Continue"
And the "mod" "coursework1" is mapped to "72hr take-home examination (3000 words)"
And I am on the "Course 1" course page logged in as teacher1
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I select "SITS Marks Transfer" from secondary navigation
And I should see "1" marks to transfer for "72hr take-home examination (3000 words)"
And I click on the "Transfer marks" button for "72hr take-home examination (3000 words)"
And I press "Confirm"
And I run the scheduled task "\local_sitsgradepush\task\pushtask"
And I run all adhoc tasks
And I reload the page
Then I should see "0" marks to transfer for "72hr take-home examination (3000 words)"
38 changes: 38 additions & 0 deletions tests/behat/reassess_marks_transfer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,41 @@ Feature: Marks transfer from Moodle to SITS for re-assessment
And I run all adhoc tasks
And I reload the page
Then I should see "0" marks to transfer for "Coursework 4000 word written case studies"

@javascript @_file_upload
Scenario: Transfer marks for a re-assessment coursework to SITS
Given the "mod_coursework" plugin is installed
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | allowearlyfinalisation | numberofmarkers |
| coursework | Coursework 1 | CW1 desc | C1 | coursework1 | 1 | 1 | 1 |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/coursework:publish | Allow | editingteacher | Course | C1 |
And I am on the "Course 1" course page logged in as student1
And I follow "Coursework 1"
And I press "Upload your submission"
And I upload "lib/tests/fixtures/empty.txt" file to "Upload a file" filemanager
And I press "Submit"
And I press "Finalise your submission"
And I press "Yes"
And I log out
And I am on the "Course 1" course page logged in as teacher1
And I follow "Coursework 1"
And I click on "Add final feedback" "link"
And I press "Save and finalise"
And I reload the page
And I press "Release all grades"
And I press "Continue"
And the "mod" "coursework1" is a re-assessment and mapped to "Coursework 4000 word written case studies"
And I am on the "Course 1" course page logged in as teacher1
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I select "SITS Marks Transfer" from secondary navigation
And I click on the marks transfer types dropdown menu and select "Re-assessment"
And I should see "Re-assessment" in the "tertiary-navigation" "region"
And I should see "1" marks to transfer for "Coursework 4000 word written case studies"
And I click on the "Transfer marks" button for "Coursework 4000 word written case studies"
And I press "Confirm"
And I run the scheduled task "\local_sitsgradepush\task\pushtask"
And I run all adhoc tasks
And I reload the page
Then I should see "0" marks to transfer for "Coursework 4000 word written case studies"
21 changes: 18 additions & 3 deletions tests/behat/reassess_select_source.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ Feature: Map Moodle source to SITS assessment component for re-assessment
| local/sitsgradepush:mapassessment | Allow | editingteacher | Course | C1 |
And the course "C1" is set up for marks transfer
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Assign 1 | A1 desc | C1 | assign1 | 1 |
| quiz | Quiz 1 | Q1 desc | C1 | quiz1 | 1 |
| activity | name | intro | course | idnumber | section |
| assign | Assign 1 | A1 desc | C1 | assign1 | 1 |
| quiz | Quiz 1 | Q1 desc | C1 | quiz1 | 1 |
| coursework | Coursework 1 | CW1 desc | C1 | coursework1 | 1 |
And the following "grade items" exist:
| itemname | course | idnumber |
| Grade Item 1 | C1 | gradeitem1 |
Expand Down Expand Up @@ -93,3 +94,17 @@ Feature: Map Moodle source to SITS assessment component for re-assessment
And I click on the "Select" button for "Grade category 1"
And I press "Confirm"
Then I should see "Grade category 1" is mapped to "Coursework 4000 word written case studies"

@javascript
Scenario: Map a re-assessment coursework to a SITS assessment component
Given the "mod_coursework" plugin is installed
And I am on the "Course 1" course page logged in as teacher1
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I select "SITS Marks Transfer" from secondary navigation
And I click on the marks transfer types dropdown menu and select "Re-assessment"
And I should see "Re-assessment" in the "tertiary-navigation" "region"
And I click on the "Select source" button for "Coursework 4000 word written case studies"
And I click on the "Select" button for "Coursework 1"
And I press "Confirm"
Then I should see "Coursework 1" is mapped to "Coursework 4000 word written case studies"

18 changes: 15 additions & 3 deletions tests/behat/select_source.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ Feature: Map Moodle source to SITS assessment component
| local/sitsgradepush:mapassessment | Allow | editingteacher | Course | C1 |
And the course "C1" is set up for marks transfer
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Assign 1 | A1 desc | C1 | assign1 | 1 |
| quiz | Quiz 1 | Q1 desc | C1 | quiz1 | 1 |
| activity | name | intro | course | idnumber | section |
| assign | Assign 1 | A1 desc | C1 | assign1 | 1 |
| quiz | Quiz 1 | Q1 desc | C1 | quiz1 | 1 |
| coursework | Coursework 1 | CW1 desc | C1 | coursework1 | 1 |
And the following "grade items" exist:
| itemname | course | idnumber |
| Grade Item 1 | C1 | gradeitem1 |
Expand Down Expand Up @@ -83,3 +84,14 @@ Feature: Map Moodle source to SITS assessment component
And I click on the "Select" button for "Grade category 1"
And I press "Confirm"
Then I should see "Grade category 1" is mapped to "72hr take-home examination (3000 words)"

@javascript
Scenario: Map a coursework to a SITS assessment component
Given the "mod_coursework" plugin is installed
And I am on the "Course 1" course page logged in as teacher1
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I select "SITS Marks Transfer" from secondary navigation
And I click on the "Select source" button for "72hr take-home examination (3000 words)"
And I click on the "Select" button for "Coursework 1"
And I press "Confirm"
Then I should see "Coursework 1" is mapped to "72hr take-home examination (3000 words)"

0 comments on commit 1e38a8a

Please sign in to comment.