mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-45884 navigation: tidied up code and added behat tests
- Loading branch information
Sam Hemelryk
committed
Jun 12, 2014
1 parent
4d378e9
commit aab6438
Showing
4 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
blocks/navigation/tests/behat/collapse_my_courses_setting.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@block @block_navigation | ||
Feature: Test collapse my courses navigation setting | ||
As a student | ||
I visit my My Moodle page and observe the the My Courses branch | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Student | 1 | student1@asd.com | | ||
And the following "categories" exist: | ||
| name | category | idnumber | | ||
| cat1 | 0 | cat1 | | ||
And the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course1 | c1 | cat1 | | ||
| Course2 | c2 | cat1 | | ||
| Course3 | c3 | cat1 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | c1 | student | | ||
| student1 | c2 | student | | ||
|
||
Scenario: The My Courses branch is expanded on the My Moodle page by default | ||
When I log in as "student1" | ||
And I follow "My home" | ||
Then I should see "c1" in the "Navigation" "block" | ||
And I should see "c2" in the "Navigation" "block" | ||
And I should not see "c3" in the "Navigation" "block" | ||
|
||
Scenario: The My Courses branch is collapsed when collapse my courses is on | ||
Given I log in as "admin" | ||
And I set the following administration settings values: | ||
| Keep My Courses collapsed initially | 1 | | ||
And I log out | ||
Given I log in as "student1" | ||
And I follow "My home" | ||
Then I should not see "c1" in the "Navigation" "block" | ||
And I should not see "c2" in the "Navigation" "block" | ||
And I should not see "c3" in the "Navigation" "block" | ||
|
||
@javascript | ||
Scenario: My Courses can be expanded on the My Moodle page when collapse my courses is on | ||
Given I log in as "admin" | ||
And I set the following administration settings values: | ||
| Keep My Courses collapsed initially | 1 | | ||
And I log out | ||
Given I log in as "student1" | ||
And I follow "My home" | ||
And I should not see "c1" in the "Navigation" "block" | ||
And I should not see "c2" in the "Navigation" "block" | ||
And I should not see "c3" in the "Navigation" "block" | ||
And I expand "My courses" node | ||
Then I should see "c1" in the "Navigation" "block" | ||
And I should see "c2" in the "Navigation" "block" | ||
And I should not see "c3" in the "Navigation" "block" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters