From 50bd633d444eb358dac0570610ba0f0e71bc66cb Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 5 Dec 2016 11:53:28 +0800 Subject: [PATCH] MDL-56614 block_navigation: Add block in behat tests --- blocks/navigation/tests/behat/expand_courses_node.feature | 7 +++++++ blocks/navigation/tests/behat/participants_link.feature | 13 +++++++++++-- blocks/navigation/tests/behat/view_my_courses.feature | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/blocks/navigation/tests/behat/expand_courses_node.feature b/blocks/navigation/tests/behat/expand_courses_node.feature index 4e99a94e358..56c85bf877d 100644 --- a/blocks/navigation/tests/behat/expand_courses_node.feature +++ b/blocks/navigation/tests/behat/expand_courses_node.feature @@ -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" diff --git a/blocks/navigation/tests/behat/participants_link.feature b/blocks/navigation/tests/behat/participants_link.feature index 5b2f4d6afba..76533c9e935 100644 --- a/blocks/navigation/tests/behat/participants_link.feature +++ b/blocks/navigation/tests/behat/participants_link.feature @@ -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 diff --git a/blocks/navigation/tests/behat/view_my_courses.feature b/blocks/navigation/tests/behat/view_my_courses.feature index bed47677dcd..2b086ce7445 100644 --- a/blocks/navigation/tests/behat/view_my_courses.feature +++ b/blocks/navigation/tests/behat/view_my_courses.feature @@ -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 -- 2.11.4.GIT