MDL-56614 block_navigation: Add block in behat tests

This commit is contained in:
Marina Glancy 2016-12-05 11:53:28 +08:00
parent ebcff7e256
commit 50bd633d44
3 changed files with 27 additions and 2 deletions

View File

@ -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"

View File

@ -15,13 +15,22 @@ 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
@ -29,7 +38,7 @@ Feature: Displaying the link to the Participants page
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

View File

@ -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