Commit 844d74d7 authored by Jerome Mouneyrac's avatar Jerome Mouneyrac Committed by Dan Poltawski
Browse files

MDL-42330 Automate MDLQA-5257 - An admin can award a site badge

parent 8be0ca75
......@@ -9,50 +9,67 @@ Feature: Award badges
And I log in as "admin"
@javascript
Scenario: Add criteria
Scenario: Award profile badge
Given I expand "Site administration" node
And I expand "Badges" node
And I follow "Add a new badge"
And I fill the moodle form with:
| Name | Test Badge |
| Name | Profile Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
And I press "Create badge"
And I select "Profile completion" from "type"
And I wait "5" seconds
And I check "First name"
And I check "Email address"
And I check "Phone"
When I press "Save"
Then I should see "Profile completion"
And I should see "First name"
And I should see "Email address"
And I should not see "Criteria for this badge have not been set up yet."
And I press "Enable access"
And I press "Continue"
And I expand "My profile settings" node
And I follow "Edit profile"
And I expand all fieldsets
And I fill in "Phone" with "123456789"
And I press "Update profile"
And I follow "My badges"
Then I should see "Profile Badge"
And I should not see "There are no badges available."
@javascript
Scenario: Earn badge
Given I expand "Site administration" node
Scenario: Award site badge
Given the following "users" exists:
| username | firstname | lastname | email |
| teacher | teacher | 1 | teacher1@asd.com |
| student | student | 1 | student1@asd.com |
And I expand "Site administration" node
And I expand "Badges" node
And I follow "Add a new badge"
And I fill the moodle form with:
| Name | Profile Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
| Name | Site Badge |
| Description | Site badge description |
| issuername | Tester of site badge |
And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
And I press "Create badge"
And I select "Profile completion" from "type"
And I wait "5" seconds
And I check "Phone"
And I select "Manual issue by role" from "type"
And I check "Teacher"
And I press "Save"
And I press "Enable access"
And I press "Continue"
And I expand "My profile settings" node
And I follow "Edit profile"
And I expand all fieldsets
And I fill in "Phone" with "123456789"
And I press "Update profile"
When I follow "My badges"
Then I should see "Profile Badge"
And I should not see "There are no badges available."
And I follow "Recipients (0)"
And I press "Award badge"
And I select "teacher 1 (teacher1@asd.com)" from "potentialrecipients[]"
And I press "Award badge"
And I select "student 1 (student1@asd.com)" from "potentialrecipients[]"
And I press "Award badge"
When I follow "Site Badge"
Then I should see "Recipients (2)"
And I log out
And I log in as "student"
And I expand "My profile" node
And I follow "My badges"
Then I should see "Site Badge"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment