MDL-63794 block_myoverview: Add behat tests

This commit is contained in:
Mihail Geshoski 2018-12-07 11:06:20 +08:00
parent 33a388eff7
commit d657d80db0

View File

@ -8,12 +8,15 @@ Feature: The my overview block allows users to easily access their courses
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | student1@example.com | S1 |
And the following "categories" exist:
| name | category | idnumber |
| Category 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | CAT1 | ##yesterday## | ##tomorrow## |
| Course 5 | C5 | 0 | ##first day of next month## | ##last day of next month## |
And the following "course enrolments" exist:
| user | course | role |
@ -200,3 +203,21 @@ Feature: The my overview block allows users to easily access their courses
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I log out
Scenario: Show course category in cards display
Given I log in as "student1"
And I click on "Display dropdown" "button" in the "Course overview" "block"
When I click on "Card" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"
Scenario: Show course category in list display
Given I log in as "student1"
And I click on "Display dropdown" "button" in the "Course overview" "block"
When I click on "List" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"
Scenario: Show course category in summary display
Given I log in as "student1"
And I click on "Display dropdown" "button" in the "Course overview" "block"
When I click on "Summary" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"