Skip to content

Commit

Permalink
Merge pull request #202 from lucaboesch/fixpluginci
Browse files Browse the repository at this point in the history
Adopt Moodle Plugin CI tests to current versions.
  • Loading branch information
ndunand authored Jan 5, 2024
2 parents 6d551ad + 020cbf5 commit 50cf472
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:

services:
postgres:
image: postgres:10
image: postgres:13
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
mariadb:
image: mariadb:10.5
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
Expand All @@ -27,8 +27,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4', '8.0']
moodle-branch: ['MOODLE_400_STABLE']
php: ['8.0', '8.1', '8.2']
moodle-branch: ['MOODLE_402_STABLE', 'MOODLE_403_STABLE']
database: [pgsql, mariadb]

steps:
Expand Down
152 changes: 146 additions & 6 deletions tests/behat/choicegroup_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,49 @@ Feature: View activity completion information in the choicegroup activity
And I log out

@javascript
Scenario: View automatic completion items for view
Given I log in as "teacher1"
Scenario: View automatic completion items for view for Moodle ≥ 4.3
Given the site is running Moodle version 4.3 or higher
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
And I set the following fields to these values:
| Group choice name | Choose your group |
| Description | Group choice description |
| Add requirements | 1 |
| View the activity | 1 |
And I set the field "availablegroups" to "Group A"
And I press "Add Group"
And I set the field "availablegroups" to "Group B"
And I press "Add Group"
And I press "Save and return to course"
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "View" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
And "Vinnie Student1, Choose your group: Not completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And I log out
# Student 1 view.
And I log in as "student1"
And I am on the "Choose your group" "choicegroup activity" page logged in as student1
And the "View" completion condition of "Choose your group" is displayed as "done"
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "View" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
Then "Vinnie Student1, Choose your group: Completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

@javascript
Scenario: View automatic completion items for view for Moodle ≤ 4.2
Given the site is running Moodle version 4.2 or lower
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
Expand Down Expand Up @@ -74,8 +115,9 @@ Feature: View activity completion information in the choicegroup activity
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

@javascript
Scenario: View automatic completion items for choose
Given I log in as "teacher1"
Scenario: View automatic completion items for choose for Moodle ≤ 4.2
Given the site is running Moodle version 4.2 or lower
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
Expand Down Expand Up @@ -117,8 +159,53 @@ Feature: View activity completion information in the choicegroup activity
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

@javascript
Scenario: View automatic completion items for both choose and view
Given I log in as "teacher1"
Scenario: View automatic completion items for choose for Moodle ≥ 4.3
Given the site is running Moodle version 4.3 or higher
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
And I set the following fields to these values:
| Group choice name | Choose your group |
| Description | Group choice description |
| Add requirements | 1 |
| View the activity | 0 |
| Show as complete when user makes a choice | 1 |
And I set the field "availablegroups" to "Group A"
And I press "Add Group"
And I set the field "availablegroups" to "Group B"
And I press "Add Group"
And I press "Save and return to course"
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "Choose a group" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
And "Vinnie Student1, Choose your group: Not completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And I log out
# Student 1 choose.
And I log in as "student1"
And I am on the "Choose your group" "choicegroup activity" page logged in as student1
And the "Choose a group" completion condition of "Choose your group" is displayed as "todo"
And I set the field "Group A" to "1"
And I press "Save my choice"
And the "Choose a group" completion condition of "Choose your group" is displayed as "done"
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "Choose a group" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
Then "Vinnie Student1, Choose your group: Completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

@javascript
Scenario: View automatic completion items for both choose and view for Moodle ≤ 4.2
Given the site is running Moodle version 4.2 or lower
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
Expand Down Expand Up @@ -167,3 +254,56 @@ Feature: View activity completion information in the choicegroup activity
And I click on "Activity completion" "link"
Then "Vinnie Student1, Choose your group: Completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

@javascript
Scenario: View automatic completion items for both choose and view for Moodle ≥ 4.3
Given the site is running Moodle version 4.3 or higher
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Group choice" "link" in the "Add an activity or resource" "dialogue"
And I set the following fields to these values:
| Group choice name | Choose your group |
| Description | Group choice description |
| Add requirements | 1 |
| View the activity | 1 |
| Show as complete when user makes a choice | 1 |
And I set the field "availablegroups" to "Group A"
And I press "Add Group"
And I set the field "availablegroups" to "Group B"
And I press "Add Group"
And I press "Save and return to course"
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "View" completion condition
And "Choose your group" should have the "Choose a group" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
And "Vinnie Student1, Choose your group: Not completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And I log out
# Student 1 choose.
And I log in as "student1"
And I am on the "Choose your group" "choicegroup activity" page logged in as student1
And the "View" completion condition of "Choose your group" is displayed as "done"
And the "Choose a group" completion condition of "Choose your group" is displayed as "todo"
And I set the field "Group A" to "1"
And I press "Save my choice"
And the "Choose a group" completion condition of "Choose your group" is displayed as "done"
And I log out
# Student 2 view.
And I log in as "student2"
And I am on the "Choose your group" "choicegroup activity" page logged in as student2
And the "View" completion condition of "Choose your group" is displayed as "done"
And the "Choose a group" completion condition of "Choose your group" is displayed as "todo"
And I log out
# Teacher view.
And I am on the "Choose your group" "choicegroup activity" page logged in as teacher1
And "Choose your group" should have the "Choose a group" completion condition
And I am on "Course 1" course homepage
And I navigate to "Reports" in current page administration
And I click on "Activity completion" "link"
Then "Vinnie Student1, Choose your group: Completed" "icon" should exist in the "Vinnie Student1" "table_row"
And "Ann Student2, Choose your group: Not completed" "icon" should exist in the "Ann Student2" "table_row"

0 comments on commit 50cf472

Please sign in to comment.