Skip to content

Commit

Permalink
MDL-56614 block_navigation: Add block in behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Dec 6, 2016
1 parent ebcff7e commit 50bd633
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
7 changes: 7 additions & 0 deletions blocks/navigation/tests/behat/expand_courses_node.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ Feature: Expand the courses nodes within the navigation block
| navshowallcourses | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I turn editing mode off
And I follow "Course 2"
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I click on "Edit" "link" in the "Guest access" "table_row"
Expand Down
13 changes: 11 additions & 2 deletions blocks/navigation/tests/behat/participants_link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,30 @@ Feature: Displaying the link to the Participants page
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out

@javascript
Scenario: Course participants link is displayed to enrolled students after expanding the course node
When I log in as "student1"
And I expand "C1" node
Then "Participants" "link" should exist in the "Navigation" "block"
And I navigate to "Participants" node in "My courses > C1"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should not exist

Scenario: Site participants link is displayed to admins
When I log in as "admin"
Then "Participants" "link" should exist in the "Navigation" "block"
And I navigate to "Participants" node in "Site pages"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should exist
Expand Down
9 changes: 9 additions & 0 deletions blocks/navigation/tests/behat/view_my_courses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ Feature: View my courses in navigation block
| student1 | c1 | student |
| student1 | c31 | student |
| student1 | c331 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out

@javascript
Scenario: The plain list of enrolled courses is shown
Expand Down

0 comments on commit 50bd633

Please sign in to comment.