Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_badgesFeature: Award badges based on cohortIn order to award badges to users based on their cohort membershipAs an adminI need to add cohort criteria to badges in the system@javascriptScenario: Award cohort membership badge for a member of a single cohort.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user2 | CH2 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"And I press "Enable access"When I press "Continue"Then I should see "Recipients (1)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"@javascriptScenario: Award cohort membership badge for a member of all required cohorts.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 || Three Cohort | CH3 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH1 || user2 | CH3 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I expand all fieldsetsAnd I set the field "id_cohort_cohorts" to "One Cohort,Two Cohort"And I set the field "id_agg_1" to "1"And I press "Save"When I press "Enable access"And I press "Continue"Then I should see "Recipients (1)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"@javascriptScenario: Award cohort membership badge for a member of any required cohorts.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 || Three Cohort | CH3 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH1 || user2 | CH3 || user3 | CH2 || user3 | CH3 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"When I press "Enable access"And I press "Continue"Then I should see "Recipients (2)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should see "Site Badge"@javascriptScenario: Award badge based on a single cohort membership and other criteria.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user2 | CH2 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Manager" to "1"And I set the field "Any of the selected roles awards the badge" to "1"And I press "Save"When I press "Enable access"And I press "Continue"And I select "Recipients (0)" from the "jump" singleselectAnd I press "Award badge"And I set the field "potentialrecipients[]" to "First User (first@example.com)"And I press "Award badge"And I set the field "potentialrecipients[]" to "Second User (second@example.com)"And I press "Award badge"And I navigate to "Badges > Manage badges" in site administrationAnd I follow "Site Badge"Then I should see "Recipients (1)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should not see "Site Badge"@javascriptScenario: Award badge based on a single cohort membership or other criteria.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | Third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user2 | CH2 || user3 | CH2 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Manager" to "1"And I set the field "Any of the selected roles awards the badge" to "1"And I press "Save"And I set the field "update" to "Any"When I press "Enable access"And I press "Continue"And I select "Recipients (1)" from the "jump" singleselectAnd I press "Award badge"And I set the field "potentialrecipients[]" to "First User (first@example.com)"And I press "Award badge"And I set the field "potentialrecipients[]" to "Second User (second@example.com)"And I press "Award badge"And I navigate to "Badges > Manage badges" in site administrationAnd I follow "Site Badge"Then I should see "Recipients (2)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user3"And I follow "Profile" in the user menuAnd I should not see "Site Badge"@javascriptScenario: Award badge based on a multiple cohort membership or other criteria.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH2 || user2 | CH2 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Manager" to "1"And I set the field "Any of the selected roles awards the badge" to "1"And I press "Save"And I set the field "update" to "Any"When I press "Enable access"And I press "Continue"And I select "Recipients (1)" from the "jump" singleselectAnd I press "Award badge"And I set the field "potentialrecipients[]" to "First User (first@example.com)"And I press "Award badge"And I set the field "potentialrecipients[]" to "Second User (second@example.com)"And I press "Award badge"And I navigate to "Badges > Manage badges" in site administrationAnd I follow "Site Badge"Then I should see "Recipients (2)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user3"And I follow "Profile" in the user menuAnd I should not see "Site Badge"@javascriptScenario: Award badge based on a multiple cohort membership and other criteria.Given the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | Third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH1 || user3 | CH2 |And the following "core_badges > Badge" exists:| name | Site Badge || status | 0 || description | Site badge description || image | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I expand all fieldsetsAnd I set the field "id_cohort_cohorts" to "One Cohort,Two Cohort"And I set the field "id_agg_1" to "1"And I press "Save"And I set the field "type" to "Manual issue by role"And I expand all fieldsetsAnd I set the field "Manager" to "1"And I set the field "Any of the selected roles awards the badge" to "1"And I press "Save"And I set the field "update" to "All"When I press "Enable access"And I press "Continue"And I select "Recipients (0)" from the "jump" singleselectAnd I press "Award badge"And I set the field "potentialrecipients[]" to "First User (first@example.com)"And I press "Award badge"And I set the field "potentialrecipients[]" to "Second User (second@example.com)"And I press "Award badge"And I navigate to "Badges > Manage badges" in site administrationAnd I follow "Site Badge"Then I should see "Recipients (1)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should not see "Site Badge"And I log outAnd I log in as "user3"And I follow "Profile" in the user menuAnd I should not see "Site Badge"@javascriptScenario: Award multiple badges based on single cohort membershipGiven the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | Third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH2 |And the following "core_badges > Badges" exist:| name | status | description | image || Site Badge 1 | 0 | Site badge description | badges/tests/behat/badge.png || Site Badge 2 | 0 | Site badge description | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "One Cohort"And I press "Save"And I press "Enable access"When I press "Continue"And I should see "Recipients (1)"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge 2" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I set the field "id_cohort_cohorts" to "Two Cohort"And I press "Save"And I press "Enable access"And I press "Continue"Then I should see "Recipients (2)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge 1"And I should see "Site Badge 2"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should not see "Site Badge 1"And I should see "Site Badge 2"And I log outAnd I log in as "user3"And I follow "Profile" in the user menuAnd I should not see "Site Badge 1"And I should not see "Site Badge 2"@javascriptScenario: Award multiple badges based on multiple cohort membershipsGiven the following "cohorts" exist:| name | idnumber || One Cohort | CH1 || Two Cohort | CH2 || Three Cohort | CH3 |And the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || user3 | Third | User | third@example.com |And the following "cohort members" exist:| user | cohort || user1 | CH1 || user1 | CH2 || user2 | CH2 || user2 | CH3 |And the following "core_badges > Badges" exist:| name | status | description | image || Site Badge 1 | 0 | Site badge description | badges/tests/behat/badge.png || Site Badge 2 | 0 | Site badge description | badges/tests/behat/badge.png |And I log in as "admin"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I expand all fieldsetsAnd I set the field "id_cohort_cohorts" to "One Cohort,Two Cohort"And I set the field "id_agg_1" to "1"And I press "Save"And I press "Enable access"When I press "Continue"And I should see "Recipients (1)"And I navigate to "Badges > Manage badges" in site administrationAnd I press "Edit" action in the "Site Badge 2" report rowAnd I select "Criteria" from the "jump" singleselectAnd I set the field "type" to "Cohort membership"And I expand all fieldsetsAnd I set the field "id_cohort_cohorts" to "Three Cohort,Two Cohort"And I set the field "id_agg_1" to "1"And I press "Save"And I press "Enable access"And I press "Continue"And I should see "Recipients (1)"And I log outAnd I log in as "user1"And I follow "Profile" in the user menuAnd I should see "Site Badge 1"And I should not see "Site Badge 2"And I log outAnd I log in as "user2"And I follow "Profile" in the user menuAnd I should not see "Site Badge 1"And I should see "Site Badge 2"And I log outAnd I log in as "user3"And I follow "Profile" in the user menuAnd I should not see "Site Badge 1"And I should not see "Site Badge 2"