Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 79a12d2d3fddcf9ab185c53f1db66727f31af048 1 parent bdb5118
@mouneyrac mouneyrac authored danpoltawski committed
Showing with 37 additions and 20 deletions.
  1. +37 −20 badges/tests/behat/award_badge.feature
View
57 badges/tests/behat/award_badge.feature
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.