diff --git a/backup/util/ui/tests/behat/import_course.feature b/backup/util/ui/tests/behat/import_course.feature index 964001cbea0..c0f1a00f755 100644 --- a/backup/util/ui/tests/behat/import_course.feature +++ b/backup/util/ui/tests/behat/import_course.feature @@ -20,13 +20,13 @@ Feature: Import course's contents into another course Scenario: Import course's contents to another course Given I log in as "teacher1" And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | data | Test database name | Test database description | C1 | database1 | 2 | - | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | - And I am on "Course 1" course homepage with editing mode on - And I add the "Comments" block - And I add the "Recent blog entries" block - And I turn editing mode off + | activity | name | course | idnumber | + | data | Test database name | C1 | database1 | + | forum | Test forum name | C1 | forum1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | + | blog_recent | Course | C1 | course-view-* | side-pre | When I import "Course 1" course into "Course 2" course using this options: Then I should see "Test database name" And I should see "Test forum name" diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index e04c22c73ff..15628289139 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -17,9 +17,11 @@ Feature: Restore Moodle 2 course backups | data | C3 | data1 | Test database name | Database description | 2 | | | forum | C1 | 0001 | Test forum name | | 1 | | | url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | activity_modules | Course | C1 | course-view-* | side-pre | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add the "Activities" block @javascript Scenario: Restore a course in another existing course diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index f5b045b1426..41a3e892d83 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -21,8 +21,10 @@ Feature: The activity results block doesn't display student scores for unsupport Given the following "activities" exist: | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | activity_results | Course | C1 | course-view-* | side-pre | And I am on "Course 1" course homepage - And I add the "Activity results" block And I configure the "Activity results" block And I set the following fields to these values: | config_showbest | 1 | @@ -30,8 +32,7 @@ Feature: The activity results block doesn't display student scores for unsupport | config_gradeformat | Percentages | | config_nameformat | Display full names | And I press "Save changes" - When I follow "Test assignment" - And I navigate to "Settings" in current page administration + When I am on the "Test assignment" "assign activity editing" page And I set the following fields to these values: | id_grade_modgrade_type | None | And I press "Save and return to course" diff --git a/blocks/activity_results/tests/behat/defaultsettings.feature b/blocks/activity_results/tests/behat/defaultsettings.feature index 7ea25451c25..2ff1decdd2e 100644 --- a/blocks/activity_results/tests/behat/defaultsettings.feature +++ b/blocks/activity_results/tests/behat/defaultsettings.feature @@ -21,8 +21,6 @@ Feature: The activity results block can have administrator set defaults | course | C1 | | idnumber | 0001 | | name | Test assignment | - | intro | Offline text | - | section | 1 | | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on @@ -50,8 +48,10 @@ Feature: The activity results block can have administrator set defaults | config_showbest_locked | 1 | block_activity_results | | config_showworst | 0 | block_activity_results | | config_showworst_locked | 1 | block_activity_results | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | activity_results | Course | C1 | course-view-* | side-pre | And I am on "Course 1" course homepage - And I add the "Activity results" block When I configure the "Activity results" block And the following fields match these values: | config_showbest | 0 | diff --git a/blocks/badges/tests/behat/block_badges_frontpage.feature b/blocks/badges/tests/behat/block_badges_frontpage.feature index db59cfde393..f5710414887 100644 --- a/blocks/badges/tests/behat/block_badges_frontpage.feature +++ b/blocks/badges/tests/behat/block_badges_frontpage.feature @@ -14,13 +14,10 @@ Feature: Enable Block Badges on the frontpage and view awarded badges And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Latest badges" block - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | badges | System | 1 | site-index | side-pre | + And I am on the "Course 1" course page logged in as teacher1 # Issue badge 1 of 2 And I navigate to "Badges > Add a new badge" in current page administration And I set the following fields to these values: @@ -37,7 +34,5 @@ Feature: Enable Block Badges on the frontpage and view awarded badges And I press "Award badge" And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)" And I press "Award badge" - And I log out - When I log in as "teacher1" - And I am on site homepage + When I am on site homepage Then I should see "Badge 1" in the "Latest badges" "block" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature index 40e676f6bb7..00aaf132cbc 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature @@ -26,16 +26,12 @@ Feature: Enable Block blog menu in an activity | idnumber | 0001 | | section | 1 | | assignsubmission_file_enabled | 0 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test assignment 1" - And I add the "Blog menu" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Activity module | 0001 | mod-assign-view | side-pre | Scenario: Students use the blog menu block to post blogs - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add a new entry" When I set the following fields to these values: | Entry title | S1 First Blog | @@ -43,16 +39,13 @@ Feature: Enable Block blog menu in an activity And I press "Save changes" Then I should see "S1 First Blog" And I should see "This is my awesome blog!" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page And I follow "Blog entries" And I should see "S1 First Blog" And I should see "This is my awesome blog!" Scenario: Students use the blog menu block to view their blogs about the activity - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -61,10 +54,7 @@ Feature: Enable Block blog menu in an activity And I should see "S1 First Blog" And I should see "This is my awesome blog about this Assignment!" And I should see "Associated Assignment: Test assignment 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -73,8 +63,7 @@ Feature: Enable Block blog menu in an activity And I should see "S2 Second Blog" And I should see "My unrelated blog!" And I should not see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S2 First Blog | @@ -83,17 +72,14 @@ Feature: Enable Block blog menu in an activity And I should see "S2 First Blog" And I should see "My course blog is better!" And I should see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page When I follow "View my entries about this Assignment" Then I should see "S2 First Blog" And I should not see "S2 Second Blog" And I should not see "S1 First Blog" Scenario: Students use the blog menu block to view all blogs about the assignment - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -102,10 +88,7 @@ Feature: Enable Block blog menu in an activity And I should see "S1 First Blog" And I should see "This is my awesome blog about this Assignment!" And I should see "Associated Assignment: Test assignment 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -114,8 +97,7 @@ Feature: Enable Block blog menu in an activity And I should see "S2 Second Blog" And I should see "My unrelated blog!" And I should not see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S2 First Blog | @@ -124,17 +106,14 @@ Feature: Enable Block blog menu in an activity And I should see "S2 First Blog" And I should see "My course blog is better!" And I should see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page When I follow "View all entries about this Assignment" Then I should see "S1 First Blog" And I should see "S2 First Blog" And I should not see "S2 Second Blog" Scenario: Students use the blog menu block to view all their blog entries - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -143,10 +122,7 @@ Feature: Enable Block blog menu in an activity And I should see "S1 First Blog" And I should see "This is my awesome blog about this Assignment!" And I should see "Associated Assignment: Test assignment 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -155,8 +131,7 @@ Feature: Enable Block blog menu in an activity And I should see "S2 Second Blog" And I should see "My unrelated blog!" And I should not see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S2 First Blog | @@ -165,17 +140,14 @@ Feature: Enable Block blog menu in an activity And I should see "S2 First Blog" And I should see "My course blog is better!" And I should see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page When I follow "Blog entries" Then I should see "S2 First Blog" And I should see "S2 Second Blog" And I should not see "S1 First Blog" Scenario: Teacher searches for student blogs - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -184,10 +156,7 @@ Feature: Enable Block blog menu in an activity And I should see "S1 First Blog" And I should see "This is my awesome blog about this Assignment!" And I should see "Associated Assignment: Test assignment 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -196,8 +165,7 @@ Feature: Enable Block blog menu in an activity And I should see "S2 Second Blog" And I should see "My unrelated blog!" And I should not see "Associated Assignment: Test assignment 1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + And I am on the "Test assignment 1" "assign activity" page And I follow "Add an entry about this Assignment" And I set the following fields to these values: | Entry title | S2 First Blog | @@ -206,10 +174,7 @@ Feature: Enable Block blog menu in an activity And I should see "S2 First Blog" And I should see "My course blog is better!" And I should see "Associated Assignment: Test assignment 1" - And I log out - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + When I am on the "Test assignment 1" "assign activity" page logged in as teacher1 And I set the field "Search" to "First" And I press "Search" Then I should see "S1 First Blog" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_course.feature b/blocks/blog_menu/tests/behat/block_blog_menu_course.feature index 11d9625b02e..ba9c1fd2a07 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_course.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_course.feature @@ -18,14 +18,12 @@ Feature: Students can use block blog menu in a course | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Blog menu" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Course | C1 | course-view-* | side-pre | Scenario: Students use the blog menu block to post blogs - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add a new entry" When I set the following fields to these values: | Entry title | S1 First Blog | @@ -39,8 +37,7 @@ Feature: Students can use block blog menu in a course And I should see "This is my awesome blog!" Scenario: Students use the blog menu block to view their blogs about the course - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -49,9 +46,7 @@ Feature: Students can use block blog menu in a course And I should see "S1 First Blog" And I should see "This is my awesome blog about this course!" And I should see "Associated Course: C1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -76,8 +71,7 @@ Feature: Students can use block blog menu in a course And I should not see "S1 First Blog" Scenario: Students use the blog menu block to view all blogs about the course - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -86,9 +80,7 @@ Feature: Students can use block blog menu in a course And I should see "S1 First Blog" And I should see "This is my awesome blog about this course!" And I should see "Associated Course: C1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -113,8 +105,7 @@ Feature: Students can use block blog menu in a course And I should not see "S2 Second Blog" Scenario: Students use the blog menu block to view all their blog entries - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -123,9 +114,7 @@ Feature: Students can use block blog menu in a course And I should see "S1 First Blog" And I should see "This is my awesome blog about this course!" And I should see "Associated Course: C1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -150,8 +139,7 @@ Feature: Students can use block blog menu in a course And I should not see "S1 First Blog" Scenario: Teacher searches for student blogs - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" And I set the following fields to these values: | Entry title | S1 First Blog | @@ -160,9 +148,7 @@ Feature: Students can use block blog menu in a course And I should see "S1 First Blog" And I should see "This is my awesome blog about this course!" And I should see "Associated Course: C1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I follow "Add a new entry" And I set the following fields to these values: | Entry title | S2 Second Blog | @@ -180,9 +166,7 @@ Feature: Students can use block blog menu in a course And I should see "S2 First Blog" And I should see "My course blog is better!" And I should see "Associated Course: C1" - And I log out - When I log in as "teacher1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as teacher1 And I set the field "Search" to "First" And I press "Search" Then I should see "S1 First Blog" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_frontpage.feature b/blocks/blog_menu/tests/behat/block_blog_menu_frontpage.feature index f20b2e5c17f..85ce327be03 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_frontpage.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_frontpage.feature @@ -8,11 +8,9 @@ Feature: Enable Block blog menu on the frontpage Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Blog menu" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | System | 1 | site-index | side-pre | Scenario: Students use the blog menu block to post blogs Given I log in as "student1" diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature index 01e75d39314..a9296b2e2ec 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature @@ -26,17 +26,13 @@ Feature: Students can use the recent blog entries block to view recent entries o | intro | Offline text | | section | 1 | | assignsubmission_file_enabled | 0 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test assignment 1" - And I add the "Blog menu" block - And I add the "Recent blog entries" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Activity module | 0001 | mod-assign-view | side-pre | + | blog_recent | Activity module | 0001 | mod-assign-view | side-pre | Scenario: Students use the recent blog entries block to view blogs - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" When I set the following fields to these values: | Entry title | S1 First Blog | @@ -50,9 +46,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I should see "This is my awesome blog!" Scenario: Students only see a few entries in the recent blog entries block - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment 1" + Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" # Blog 1 of 5 And I set the following fields to these values: diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_course.feature b/blocks/blog_recent/tests/behat/block_blog_recent_course.feature index e8c7fccc577..8d0ba25ee47 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_course.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_course.feature @@ -16,17 +16,15 @@ Feature: Students can use the recent blog entries block to view recent entries o | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Course | C1 | course-view-* | side-pre | + | blog_recent | Course | C1 | course-view-* | side-pre | And the "multilang" filter is "on" And the "multilang" filter applies to "content and headings" - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Blog menu" block - And I add the "Recent blog entries" block - And I log out Scenario: Students use the recent blog entries block to view blogs - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" When I set the following fields to these values: | Entry title | S1 First Blog RUSSIANENGLISH | @@ -40,8 +38,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I should see "This is my awesome blog!" Scenario: Students only see a few entries in the recent blog entries block - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" # Blog 1 of 5 And I set the following fields to these values: diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature index 00cb9472c8d..013a9ea5c51 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature @@ -8,12 +8,14 @@ Feature: Feature: Students can use the recent blog entries block to view recent Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_recent | System | 1 | site-index | side-pre | + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Recent blog entries" block - And the following config values are set as admin: - | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Blogs" link not accessible without navigation block. And I add the "Navigation" block if not present And I log out diff --git a/blocks/calendar_month/tests/behat/block_calendar_month.feature b/blocks/calendar_month/tests/behat/block_calendar_month.feature index df6ed1cb38b..0c937332c6d 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month.feature @@ -52,9 +52,10 @@ Feature: Enable the calendar block in a course and test it's functionality @javascript Scenario: View a user event in the calendar block - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Calendar" block + Given the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | calendar_month | Course | C1 | course-view-* | side-pre | + And I log in as "teacher1" And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | @@ -72,9 +73,7 @@ Feature: Enable the calendar block in a course and test it's functionality | user | group | | student1 | G1 | | student2 | G2 | - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Settings" in current page administration + When I am on the "Course 1" "course editing" page logged in as teacher1 And I set the following fields to these values: | id_groupmode | Separate groups | | id_groupmodeforce | Yes | @@ -87,12 +86,8 @@ Feature: Enable the calendar block in a course and test it's functionality | Type of event | group | | Group | Group 1 | | Event title | Group Event | - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I hover over today in the mini-calendar block - And I should see "Group Event" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + Then I should see "Group Event" + And I am on the "Course 1" course page logged in as student2 And I should not see "Group Event" diff --git a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature index fc9329e68c0..c74f2b6d98a 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature @@ -9,10 +9,10 @@ Feature: Enable the calendar block on the site front page Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | calendar_month | System | 1 | site-index | side-pre | And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Calendar" block And I create a calendar event with form data: | id_eventtype | Site | | id_name | Site Event | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature index b2d956011d1..ad4ace1699a 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature @@ -8,6 +8,9 @@ Feature: View a site event on the frontpage Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | calendar_upcoming | System | 1 | site-index | side-pre | @javascript Scenario: View a site event in the upcoming events block on the frontpage @@ -15,9 +18,6 @@ Feature: View a site event on the frontpage And I create a calendar event with form data: | id_eventtype | Site | | id_name | My Site Event | - And I am on site homepage - And I turn editing mode on - And I add the "Upcoming events" block And I log out When I log in as "teacher1" And I am on site homepage diff --git a/blocks/comments/tests/behat/add_comment.feature b/blocks/comments/tests/behat/add_comment.feature index 83eb6f44109..5baf6d2d985 100644 --- a/blocks/comments/tests/behat/add_comment.feature +++ b/blocks/comments/tests/behat/add_comment.feature @@ -16,12 +16,10 @@ Feature: Add a comment to the comments block | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Comments" block - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" course page logged in as student1 @javascript Scenario: Add a comment with Javascript enabled diff --git a/blocks/comments/tests/behat/block_comment_activity.feature b/blocks/comments/tests/behat/block_comment_activity.feature index 4aa94bdded0..49c6dcbf37b 100644 --- a/blocks/comments/tests/behat/block_comment_activity.feature +++ b/blocks/comments/tests/behat/block_comment_activity.feature @@ -19,15 +19,12 @@ Feature: Enable Block comments on an activity page and view comments And the following "activities" exist: | activity | course | idnumber | name | intro | | page | C1 | page1 | Test page name | Test page description | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test page name" - And I add the "Comments" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Activity module | page1 | mod-page-* | side-pre | + And I am on the "Test page name" "page activity" page logged in as teacher1 And I follow "Show comments" And I add "I'm a comment from the teacher" comment to comments block - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test page name" + When I am on the "Test page name" "page activity" page logged in as student1 And I follow "Show comments" Then I should see "I'm a comment from the teacher" diff --git a/blocks/comments/tests/behat/block_comment_course.feature b/blocks/comments/tests/behat/block_comment_course.feature index 3589da498e0..f4cfe01156e 100644 --- a/blocks/comments/tests/behat/block_comment_course.feature +++ b/blocks/comments/tests/behat/block_comment_course.feature @@ -16,13 +16,12 @@ Feature: Enable Block comments on a course page and view comments | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Comments" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" course page logged in as teacher1 And I follow "Show comments" And I add "I'm a comment from the teacher" comment to comments block - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I follow "Show comments" Then I should see "I'm a comment from the teacher" diff --git a/blocks/comments/tests/behat/block_comment_frontpage.feature b/blocks/comments/tests/behat/block_comment_frontpage.feature index cb8d76dd036..ada60b7d5f7 100644 --- a/blocks/comments/tests/behat/block_comment_frontpage.feature +++ b/blocks/comments/tests/behat/block_comment_frontpage.feature @@ -8,10 +8,11 @@ Feature: Enable Block comments on the frontpage and view comments Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | System | 1 | site-index | side-pre | And I log in as "admin" And I am on site homepage - And I turn editing mode on - And I add the "Comments" block And I follow "Show comments" And I add "I'm a comment from admin" comment to comments block And I log out diff --git a/blocks/comments/tests/behat/delete_comment.feature b/blocks/comments/tests/behat/delete_comment.feature index f8939f42ae3..c3a86f325cd 100644 --- a/blocks/comments/tests/behat/delete_comment.feature +++ b/blocks/comments/tests/behat/delete_comment.feature @@ -17,16 +17,12 @@ Feature: Delete comment block messages | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Comments" block - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" course page logged in as student1 And I add "Comment from student1" comment to comments block - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I add "Comment from teacher1" comment to comments block When I delete "Comment from student1" comment from comments block Then I should not see "Comment from student1" diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature index dfe5f224273..e4060f722ba 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature @@ -18,24 +18,21 @@ Feature: Enable Block Completion in a course using manual completion by others | teacher1 | C1 | editingteacher | | teacher2 | C1 | teacher | | student1 | C1 | student | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | completionstatus | Course | C1 | course-view-* | side-pre | Scenario: Add the block to a the course and mark a student complete. - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Course completion status" block + Given I am on the "Course 1" course page logged in as teacher1 And I navigate to "Course completion" in current page administration And I expand all fieldsets And I set the following fields to these values: | Teacher | 1 | And I press "Save changes" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I should see "Status: Not yet started" in the "Course completion status" "block" And I should see "No" in the "Teacher" "table_row" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Reports" in current page administration And I click on "Course completion" "link" in the "region-main" "region" And I follow "Click to mark user complete" @@ -44,18 +41,14 @@ Feature: Enable Block Completion in a course using manual completion by others And I wait "1" seconds And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 Then I should see "Status: Complete" in the "Course completion status" "block" And I should see "Yes" in the "Teacher" "table_row" And I follow "More details" And I should see "Yes" in the "Marked complete by Teacher" "table_row" Scenario: Add the block to a the course and require multiple roles to mark a student complete. - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Course completion status" block + Given I am on the "Course 1" course page logged in as teacher1 And I navigate to "Course completion" in current page administration And I expand all fieldsets And I set the following fields to these values: @@ -63,30 +56,22 @@ Feature: Enable Block Completion in a course using manual completion by others | Non-editing teacher | 1 | | id_role_aggregation | ALL selected roles to mark when the condition is met | And I press "Save changes" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I should see "Status: Not yet started" in the "Course completion status" "block" And I should see "No" in the "Teacher" "table_row" And I should see "No" in the "Non-editing teacher" "table_row" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Reports" in current page administration And I click on "Course completion" "link" in the "region-main" "region" And I follow "Click to mark user complete" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Status: In progress" in the "Course completion status" "block" And I should see "Yes" in the "Teacher" "table_row" And I should see "No" in the "Non-editing teacher" "table_row" And I follow "More details" And I should see "Yes" in the "Marked complete by Teacher" "table_row" And I should see "No" in the "Marked complete by Non-editing teacher" "table_row" - And I log out - And I log in as "teacher2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher2 And I navigate to "Reports" in current page administration And I click on "Course completion" "link" in the "region-main" "region" And I follow "Click to mark user complete" @@ -95,9 +80,7 @@ Feature: Enable Block Completion in a course using manual completion by others And I wait "1" seconds And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 Then I should see "Status: Complete" in the "Course completion status" "block" And I should see "Yes" in the "Teacher" "table_row" And I should see "Yes" in the "Non-editing teacher" "table_row" diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature index 5165716e15a..193c8e5e2fa 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature @@ -17,18 +17,17 @@ Feature: Enable Block Completion in a course using manual self completion | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I enable "selfcompletion" "block" plugin - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Course completion status" block - And I add the "Self completion" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | completionstatus | Course | C1 | course-view-* | side-pre | + | selfcompletion | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Course completion" in current page administration And I expand all fieldsets And I set the following fields to these values: | id_criteria_self | 1 | And I press "Save changes" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I should see "Status: Not yet started" in the "Course completion status" "block" And I should see "No" in the "Self completion" "table_row" And I follow "Complete course" diff --git a/blocks/course_summary/tests/behat/block_course_summary_course.feature b/blocks/course_summary/tests/behat/block_course_summary_course.feature index 5edee88900e..85f0c3bd1fe 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_course.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_course.feature @@ -17,21 +17,18 @@ Feature: Course summary block used in a course | student1 | C101 | student | | teacher1 | C101 | editingteacher | And I enable "course_summary" "block" plugin - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Course/site summary" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | course_summary | Course | C101 | course-view-* | side-pre | Scenario: Student can view course summary - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then "Course summary" "block" should exist And I should see "Course summary" in the "Course summary" "block" And I should see "Proved the course summary block works!" in the "Course summary" "block" Scenario: Teacher can not see edit icon when edit mode is off - When I log in as "teacher1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as teacher1 Then I should see "Proved the course summary block works!" in the "Course summary" "block" And I should see "Course summary" in the "Course summary" "block" And "Edit" "link" should not exist in the "Course summary" "block" diff --git a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature index 7d476e9e4c6..afb11ee744e 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature @@ -7,9 +7,10 @@ Feature: Course summary block used on the frontpage Background: Given I log in as "admin" And I enable "course_summary" "block" plugin + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | course_summary | System | 1 | site-index | side-pre | And I am on site homepage - And I turn editing mode on - And I add the "Course/site summary" block And I navigate to "Site home > Site home settings" in site administration And I set the following fields to these values: | summary | Proved the summary block works! | diff --git a/blocks/login/tests/behat/login_block.feature b/blocks/login/tests/behat/login_block.feature index b06547a5ccf..1648a74c068 100644 --- a/blocks/login/tests/behat/login_block.feature +++ b/blocks/login/tests/behat/login_block.feature @@ -8,19 +8,16 @@ Feature: Login from a block Given the following "users" exist: | username | password | firstname | lastname | email | | testuser | testpass | Test | User | student1@example.com | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Login" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | login | System | 1 | site-index | side-pre | Scenario: Login block visible to non-logged in users - Given I log out When I am on homepage Then "Login" "block" should exist Scenario: Login as student through login block - Given I log out - And I am on homepage + Given I am on homepage When I set the field "Username" to "testuser" And I set the field "Password" to "testpass" And I click on "Log in" "button" in the "Login" "block" diff --git a/blocks/mnet_hosts/tests/behat/mnet_hosts_addblock_disabled.feature b/blocks/mnet_hosts/tests/behat/mnet_hosts_addblock_disabled.feature index b084fa2a269..6ee26848fdf 100644 --- a/blocks/mnet_hosts/tests/behat/mnet_hosts_addblock_disabled.feature +++ b/blocks/mnet_hosts/tests/behat/mnet_hosts_addblock_disabled.feature @@ -8,9 +8,9 @@ Feature: Add the network servers block when main feature is disabled Given I log in as "admin" And I navigate to "Plugins > Authentication > Manage authentication" in site administration And I click on "Enable" "icon" in the "MNet authentication" "table_row" - And I am on site homepage - And I turn editing mode on - And I add the "Network servers" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | mnet_hosts | System | 1 | site-index | side-pre | When I navigate to "Plugins > Authentication > Manage authentication" in site administration And I click on "Disable" "icon" in the "MNet authentication" "table_row" And I am on site homepage @@ -21,10 +21,11 @@ Feature: Add the network servers block when main feature is disabled Given I log in as "admin" And I navigate to "Plugins > Authentication > Manage authentication" in site administration And I click on "Enable" "icon" in the "MNet authentication" "table_row" + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | mnet_hosts | System | 1 | site-index | side-pre | And I am on site homepage And I turn editing mode on - And I add the "Network servers" block - And I turn editing mode on And I open the "Network servers" blocks action menu And I click on "Delete Network servers block" "link" in the "Network servers" "block" And "Delete block?" "dialogue" should exist diff --git a/blocks/myprofile/tests/behat/block_myprofile_activity.feature b/blocks/myprofile/tests/behat/block_myprofile_activity.feature index bc0f704946e..0109119171a 100644 --- a/blocks/myprofile/tests/behat/block_myprofile_activity.feature +++ b/blocks/myprofile/tests/behat/block_myprofile_activity.feature @@ -17,8 +17,8 @@ Feature: The logged in user block allows users to view their profile information And the following "activities" exist: | activity | course | idnumber | name | intro | | page | C1 | page1 | Test page name | Test page description | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test page name" - When I add the "Logged in user" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | myprofile | Activity module | page1 | mod-page-* | side-pre | + When I am on the "Test page name" "page activity" page logged in as teacher1 Then I should see "Teacher One" in the "Logged in user" "block" diff --git a/blocks/myprofile/tests/behat/block_myprofile_frontpage.feature b/blocks/myprofile/tests/behat/block_myprofile_frontpage.feature index c7d5e37a071..1870b3dcb5b 100644 --- a/blocks/myprofile/tests/behat/block_myprofile_frontpage.feature +++ b/blocks/myprofile/tests/behat/block_myprofile_frontpage.feature @@ -8,11 +8,9 @@ Feature: The logged in user block allows users to view their profile information Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | One | teacher1@example.com | T1 | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Logged in user" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | myprofile | System | 1 | site-index | side-pre | Scenario: Try to view the logged in user block as a guest Given I log in as "guest" diff --git a/blocks/news_items/tests/behat/display_news.feature b/blocks/news_items/tests/behat/display_news.feature index be5e1b011df..e976ed829f8 100644 --- a/blocks/news_items/tests/behat/display_news.feature +++ b/blocks/news_items/tests/behat/display_news.feature @@ -9,17 +9,16 @@ Feature: Latest announcements block displays the course latest news Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - And I log in as "admin" - And I create a course with: - | Course full name | Course 1 | - | Course short name | C1 | - | Number of announcements | 5 | - And I enrol "Teacher 1" user as "Teacher" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Latest announcements" block - And I turn editing mode off + And the following "courses" exist: + | fullname | shortname | category | newsitems | + | Course 1 | C1 | 0 | 5 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | news_items | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" Course page logged in as teacher1 When I add a new topic to "Announcements" forum with: | Subject | Discussion One | | Message | Not important | diff --git a/blocks/private_files/tests/behat/block_private_files_activity.feature b/blocks/private_files/tests/behat/block_private_files_activity.feature index 0486531a96e..f88bb751175 100644 --- a/blocks/private_files/tests/behat/block_private_files_activity.feature +++ b/blocks/private_files/tests/behat/block_private_files_activity.feature @@ -17,10 +17,10 @@ Feature: The private files block allows users to store files privately in moodle And the following "activities" exist: | activity | course | idnumber | name | intro | | page | C1 | page1 | Test page name | Test page description | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I am on the "Test page name" "page activity" page - And I add the "Private files" block + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | private_files | Activity module | page1 | mod-page-* | side-pre | + And I am on the "Test page name" "page activity" page logged in as teacher1 And I should see "No files available" in the "Private files" "block" When I follow "Manage private files..." And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager diff --git a/blocks/private_files/tests/behat/block_private_files_course.feature b/blocks/private_files/tests/behat/block_private_files_course.feature index 35a4e9629cc..7261d6d55df 100644 --- a/blocks/private_files/tests/behat/block_private_files_course.feature +++ b/blocks/private_files/tests/behat/block_private_files_course.feature @@ -14,9 +14,11 @@ Feature: The private files block allows users to store files privately in moodle And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | private_files | Course | C1 | course-view-* | side-pre | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add the "Private files" block And I should see "No files available" in the "Private files" "block" When I follow "Manage private files..." And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager diff --git a/blocks/private_files/tests/behat/block_private_files_frontpage.feature b/blocks/private_files/tests/behat/block_private_files_frontpage.feature index cd3ef3b1665..93509fd1432 100644 --- a/blocks/private_files/tests/behat/block_private_files_frontpage.feature +++ b/blocks/private_files/tests/behat/block_private_files_frontpage.feature @@ -11,11 +11,9 @@ Feature: The private files block allows users to store files privately in moodle And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Private files" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | private_files | System | 1 | site-index | side-pre | Scenario: Try to view the private files block as a guest Given I log in as "guest" diff --git a/blocks/search_forums/tests/behat/block_search_forums_course.feature b/blocks/search_forums/tests/behat/block_search_forums_course.feature index 8ad1d9fcd71..0cc4f02b875 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_course.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_course.feature @@ -16,27 +16,22 @@ Feature: The search forums block allows users to search for forum posts on cours | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Settings" in current page administration + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | news_items | Course | C1 | course-view-* | side-pre | + | search_forums | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" "course editing" page logged in as teacher1 And I set the field "id_newsitems" to "1" And I press "Save and display" - And I turn editing mode on - And I add the "Latest announcements" block - And I add the "Search forums" block - And I log out Scenario: Use the search forum block in a course without any forum posts - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 When I set the field "Search" to "Moodle" And I press "Search" Then I should see "No posts" Scenario: Use the search forum block in a course with a hidden forum and search for posts - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a new topic to "Announcements" forum with: + Given I add a new topic to "Announcements" forum with: | Subject | My subject | | Message | My message | And I am on "Course 1" course homepage with editing mode on @@ -45,24 +40,18 @@ Feature: The search forums block allows users to search for forum posts on cours And I expand all fieldsets And I set the field "id_visible" to "0" And I press "Save and return to course" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And "Search forums" "block" should exist - When I set the field "Search" to "message" + And I set the field "Search" to "message" And I press "Search" Then I should see "No posts" Scenario: Use the search forum block in a course and search for posts - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a new topic to "Announcements" forum with: + Given I add a new topic to "Announcements" forum with: | Subject | My subject | | Message | My message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And "Search forums" "block" should exist - When I set the field "Search" to "message" + And I set the field "Search" to "message" And I press "Search" Then I should see "My subject" diff --git a/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature b/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature index 53d09348b57..952a0357bc4 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature @@ -8,11 +8,9 @@ Feature: The search forums block allows users to search for forum posts on front Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Search forums" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | search_forums | System | 1 | site-index | side-pre | Scenario: Use the search forum block on the frontpage and search for posts as a user Given I log in as "student1" diff --git a/blocks/section_links/tests/behat/show_section_name.feature b/blocks/section_links/tests/behat/show_section_name.feature index 7d3b3d3a51e..d1a2fdd959d 100644 --- a/blocks/section_links/tests/behat/show_section_name.feature +++ b/blocks/section_links/tests/behat/show_section_name.feature @@ -18,16 +18,13 @@ Feature: The Section links block can be configured to display section name in ad | student1 | C1 | student | And the following config values are set as admin: | showsectionname | 1 | block_section_links | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And the following config values are set as admin: | unaddableblocks | | theme_boost| - And I add the "Section links" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | section_links | Course | C1 | course-view-* | side-pre | Scenario: Student can see section name under the Section links block - Given I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "7: Topic 7" in the "Section links" "block" And I follow "7: Topic 7" And I should see "First assignment" diff --git a/blocks/site_main_menu/tests/behat/add_url.feature b/blocks/site_main_menu/tests/behat/add_url.feature index cd4483cf748..b8f697d5750 100644 --- a/blocks/site_main_menu/tests/behat/add_url.feature +++ b/blocks/site_main_menu/tests/behat/add_url.feature @@ -4,12 +4,19 @@ Feature: Add URL to main menu block As a admin I need to add URLs to the main menu block and check it works. + Background: + Given the following "courses" exist: + | fullname | shortname | category | enablecompletion | + | Course 1 | C1 | 0 | 1 | + | Course 2 | C2 | 0 | | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | site_main_menu | System | 1 | site-index | side-pre | + @javascript Scenario: Add a URL in menu block and ensure it appears Given I log in as "admin" And I am on site homepage - And I turn editing mode on - And I add the "Main menu" block And the following "activity" exists: | activity | url | | course | Acceptance test site | @@ -22,20 +29,15 @@ Feature: Add URL to main menu block And I set the following fields to these values: | id_display | In pop-up | And I press "Save and return to course" + And I turn editing mode on Then "reference link" "link" should exist in the "Main menu" "block" And "Add an activity or resource" "button" should exist in the "Main menu" "block" @javascript Scenario: Add a URL in menu block can appear in the entire site - Given the following "course" exists: - | fullname | Course 1 | - | shortname | C1 | - | category | 0 | - | enablecompletion | 1 | When I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Main menu" block And I configure the "Main menu" block And I set the following fields to these values: | Page contexts | Display throughout the entire site | @@ -61,15 +63,9 @@ Feature: Add URL to main menu block @javascript Scenario: Add a URL in menu block can appear in any front page - Given the following "course" exists: - | fullname | Course 1 | - | shortname | C1 | - | category | 0 | - | enablecompletion | 1 | When I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Main menu" block And I configure the "Main menu" block And I set the following fields to these values: | Page contexts | Display on the site home and any pages added to the site home. | @@ -95,22 +91,17 @@ Feature: Add URL to main menu block @javascript Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course - results in adding it in the course and not in the frontpage - Given the following "course" exists: - | fullname | Course 1 | - | shortname | C1 | - | category | 0 | - And I log in as "admin" + results in adding it in the course and not in the frontpage + Given I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Main menu" block And I configure the "Main menu" block And I set the following fields to these values: | Page contexts | Display throughout the entire site | And I press "Save changes" When the following "activity" exists: | activity | url | - | course | C1 | + | course | C2 | | name | reference link | | intro | mooooooooodle | | externalurl | http://www.moodle.com | diff --git a/blocks/site_main_menu/tests/behat/edit_activities.feature b/blocks/site_main_menu/tests/behat/edit_activities.feature index 45d50143408..9ead1093b07 100644 --- a/blocks/site_main_menu/tests/behat/edit_activities.feature +++ b/blocks/site_main_menu/tests/behat/edit_activities.feature @@ -11,10 +11,12 @@ Feature: Edit activities in main menu block | course | Acceptance test site | | name | My forum name | | idnumber | forum | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | site_main_menu | System | 1 | site-index | side-pre | And I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Main menu" block When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name" Then I should not see "My forum name" And I should see "New forum name" diff --git a/blocks/social_activities/tests/behat/edit_activities.feature b/blocks/social_activities/tests/behat/edit_activities.feature index 8a63dd36fc8..2b37eeb7209 100644 --- a/blocks/social_activities/tests/behat/edit_activities.feature +++ b/blocks/social_activities/tests/behat/edit_activities.feature @@ -35,9 +35,11 @@ Feature: Edit activities in social activities block Scenario: Activities in social activities block can be made available but not visible on a course page Given the following config values are set as admin: | allowstealth | 1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | And I log in as "user1" And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block And I press "Add an activity or resource" And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue" And I set the field "Forum name" to "My forum name" @@ -74,8 +76,7 @@ Feature: Edit activities in social activities block And "My forum name" activity in social activities block should be available but hidden from course page And I log out # Student will not see the module on the course page but can access it from other reports and blocks: - And I log in as "student1" - And I am on "Course 1" course homepage - And I should not see "My forum name" in the "Social activities" "block" + When I am on the "Course 1" course page logged in as student1 + Then I should not see "My forum name" in the "Social activities" "block" And I click on "My forum name" "link" in the "Recent activity" "block" And I should see "My forum name" in the ".breadcrumb" "css_element" diff --git a/blocks/tests/behat/delete_block.feature b/blocks/tests/behat/delete_block.feature index 963cadfae0f..f324827e3cc 100644 --- a/blocks/tests/behat/delete_block.feature +++ b/blocks/tests/behat/delete_block.feature @@ -8,10 +8,11 @@ Feature: Block removal via modal Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | search_forums | Course | C1 | course-view-* | side-pre | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add the "Search forums" block - And "Search forums" "block" should exist @javascript Scenario: Removing a block via modal should remove the block on the page diff --git a/blocks/tests/behat/hidden_block_region.feature b/blocks/tests/behat/hidden_block_region.feature index e41f9f26917..50221740da7 100644 --- a/blocks/tests/behat/hidden_block_region.feature +++ b/blocks/tests/behat/hidden_block_region.feature @@ -11,12 +11,14 @@ Feature: Show hidden blocks in a docked block region when editing And the following "course enrolments" exist: | user | course | role | | admin | C1 | editingteacher | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | search_forums | Course | C1 | course-view-* | side-pre | + | news_items | Course | C1 | course-view-* | side-pre | + | calendar_upcoming | Course | C1 | course-view-* | side-pre | + | recent_activity | Course | C1 | course-view-* | side-pre | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add the "Search forums" block - And I add the "Latest announcements" block - And I add the "Upcoming events" block - And I add the "Recent activity" block # Hide all the blocks in the non-default region And I configure the "Search forums" block And I set the following fields to these values: diff --git a/blocks/tests/behat/hide_blocks.feature b/blocks/tests/behat/hide_blocks.feature index 0a4f9fae911..abd1499f48a 100644 --- a/blocks/tests/behat/hide_blocks.feature +++ b/blocks/tests/behat/hide_blocks.feature @@ -8,18 +8,20 @@ Feature: Block visibility Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | search_forums | Course | C1 | course-view-* | side-pre | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on @javascript Scenario: Hiding all blocks on the page should remove the column they're in - Given I add the "Search forums" block - And I open the "Search forums" blocks action menu + When I open the "Search forums" blocks action menu And I click on "Configure Search forums block" "link" in the "Search forums" "block" And I set the field "Region" to "Right" And I press "Save changes" And I turn editing mode off - And ".empty-region-side-post" "css_element" should not exist in the "body" "css_element" + Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element" And I turn editing mode on And I open the "Search forums" blocks action menu And I click on "Hide Search forums block" "link" in the "Search forums" "block" diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index 1a86e24df6e..7e33803d719 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -22,9 +22,11 @@ Feature: Block appearances | book | Test book name | | title | Book title | | content | Book content test test | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | And I am on the "Course 1" course page logged in as teacher1 And I turn editing mode on - And I add the "Comments" block And I configure the "Comments" block And I set the following fields to these values: | Display on page types | Any page | diff --git a/blocks/tests/behat/move_blocks.feature b/blocks/tests/behat/move_blocks.feature index c16b6fe0896..f7201d7a21b 100644 --- a/blocks/tests/behat/move_blocks.feature +++ b/blocks/tests/behat/move_blocks.feature @@ -22,9 +22,11 @@ Feature: Block region moving | book | Test book name | | title | Book title | | content | Book content test test | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | Course | C1 | course-view-* | side-pre | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add the "Comments" block And I configure the "Comments" block And I set the following fields to these values: | Display on page types | Any page | diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index 8f2c46fe50c..bda1caa1955 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -30,10 +30,10 @@ Feature: Perform basic calendar functionality | user | group | | student1 | G1 | | teacher1 | G1 | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add the "Calendar" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | calendar_month | Course | C1 | course-view-* | side-pre | + | calendar_upcoming | Course | C4 | course-view-* | side-pre | @javascript Scenario: Create a site event @@ -43,14 +43,13 @@ Feature: Perform basic calendar functionality | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I follow "Full calendar" And I should see "Really awesome event!" And I log out And I log in as "student2" And I follow "Full calendar" - And I should see "Really awesome event!" + Then I should see "Really awesome event!" @javascript Scenario: Create a course event @@ -61,8 +60,7 @@ Feature: Perform basic calendar functionality | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I follow "Full calendar" And I click on "Really awesome event!" "link" And "Course 1" "link" should exist in the "Really awesome event!" "dialogue" @@ -83,8 +81,7 @@ Feature: Perform basic calendar functionality | Event title | Really awesome event! | | Description | Come join this awesome event | And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I follow "Full calendar" Then I follow "Really awesome event!" @@ -96,8 +93,7 @@ Feature: Perform basic calendar functionality | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 And I follow "Full calendar" Then I should not see "Really awesome event!" @@ -180,8 +176,7 @@ Feature: Perform basic calendar functionality @javascript Scenario: Attempt to create event without fill required fields should display validation errors - Given I log in as "teacher1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher1 And I follow "Full calendar" And I click on "New event" "button" When I click on "Save" "button" @@ -191,7 +186,7 @@ Feature: Perform basic calendar functionality And I click on "New event" "button" And I set the field "Event title" to "Really awesome event!" And I set the field "Type of event" to "Course" - When I click on "Save" "button" + And I click on "Save" "button" And I should see "Select a course" in the "Course" "form_row" @javascript @@ -207,8 +202,7 @@ Feature: Perform basic calendar functionality @javascript Scenario: Admin can only see all courses if calendar_adminseesall setting is enabled. - Given I log in as "admin" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as admin And I am viewing site calendar And I click on "New event" "button" And I set the field "Type of event" to "Course" @@ -264,8 +258,7 @@ Feature: Perform basic calendar functionality @javascript @accessibility Scenario: The calendar page must be accessible - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 When I follow "Full calendar" Then the page should meet accessibility standards And the page should meet "wcag131, wcag143, wcag412" accessibility standards @@ -294,7 +287,6 @@ Feature: Perform basic calendar functionality And the following config values are set as admin: | calendar_adminseesall | 0 | And I am on "Course 4" course homepage with editing mode on - And I add the "Upcoming events" block And I click on "Go to calendar..." "link" in the "Upcoming events" "block" And I click on "New event" "button" And I should see "Course" in the "Type of event" "select" @@ -309,8 +301,7 @@ Feature: Perform basic calendar functionality @javascript Scenario: Changing the event type should clear previous data - Given I log in as "admin" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as admin And I follow "Full calendar" And I set the field "course" to "C1" And I press "New event" diff --git a/calendar/tests/behat/calendar_lookahead.feature b/calendar/tests/behat/calendar_lookahead.feature index 0b174ae77b4..6a538cba458 100644 --- a/calendar/tests/behat/calendar_lookahead.feature +++ b/calendar/tests/behat/calendar_lookahead.feature @@ -14,12 +14,14 @@ Feature: Limit displayed upcoming events And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | calendar_month | Course | C1 | course-view-* | side-pre | + | calendar_upcoming | Course | C1 | course-view-* | side-pre | And I log in as "teacher1" Scenario: I view calendar details for a future event Given I am on "Course 1" course homepage with editing mode on - And I add the "Calendar" block - And I add the "Upcoming events" block And I follow "Full calendar" And I click on "a.next" "css_element" And I click on "a.next" "css_element" diff --git a/completion/tests/behat/activity_completion_criteria.feature b/completion/tests/behat/activity_completion_criteria.feature index 34d114649ab..beb6ce8eaf8 100644 --- a/completion/tests/behat/activity_completion_criteria.feature +++ b/completion/tests/behat/activity_completion_criteria.feature @@ -23,9 +23,10 @@ Feature: Allow to mark course as completed without cron for activity completion | name | Test assignment name | | idnumber | assign1 | | description | Test assignment description | - And I log in as "admin" - And I am on "Completion course" course homepage - And I navigate to "Settings" in current page administration + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | completionstatus | Course | CC1 | course-view-* | side-pre | + And I am on the "Completion course" "course editing" page logged in as admin And I expand all fieldsets And I set the field "Enable completion tracking" to "Yes" And I click on "Save and display" "button" @@ -38,9 +39,6 @@ Feature: Allow to mark course as completed without cron for activity completion And I expand all fieldsets And I set the field "Assignment - Test assignment name" to "1" And I press "Save changes" - And I turn editing mode on - And I add the "Course completion status" block - And I log out @javascript Scenario: Update course completion when student marks activity as complete @@ -48,9 +46,7 @@ Feature: Allow to mark course as completed without cron for activity completion And I follow "Expand all" And I set the field "Completion tracking" to "Students can manually mark the activity as completed" And I press "Save and return to course" - And I log out - When I log in as "student1" - And I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as student1 And I should see "Status: Not yet started" And I press "Mark as done" And I wait until "Done" "button" exists @@ -66,9 +62,7 @@ Feature: Allow to mark course as completed without cron for activity completion And I set the field "Grade out of 100" to "40" And I click on "Save changes" "button" And I am on "Completion course" course homepage - And I log out - And I log in as "student1" - When I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as student1 Then I should see "Status: Complete" @javascript @@ -78,7 +72,6 @@ Feature: Allow to mark course as completed without cron for activity completion | course | CC1 | | name | Test assignment name2 | | idnumber | assign2 | - | description | Test assignment description | And I am on the "Test assignment name2" "assign activity editing" page logged in as admin And I follow "Expand all" And I set the field "Completion tracking" to "Show activity as complete when conditions are met" @@ -95,33 +88,25 @@ Feature: Allow to mark course as completed without cron for activity completion And I set the field "Grade out of 100" to "40" And I click on "Save changes" "button" And I am on "Completion course" course homepage - And I log out - And I log in as "student1" - And I am on "Completion course" course homepage + And I am on the "Completion course" course page logged in as student1 And I should see "Status: In progress" - And I log out And I am on the "Test assignment name2" "assign activity" page logged in as teacher1 And I follow "View all submissions" And I click on "Grade" "link" in the "student1@example.com" "table_row" And I set the field "Grade out of 100" to "40" And I click on "Save changes" "button" And I am on "Completion course" course homepage - And I log out - And I log in as "student1" - And I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as student1 Then I should see "Status: Complete" @javascript Scenario: Course completion should not be updated when teacher grades assignment on course grader report page - Given I log in as "teacher1" - And I am on "Completion course" course homepage + Given I am on the "Completion course" course page logged in as teacher1 And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "57" to the user "Student First" for the grade item "Test assignment name" And I press "Save changes" - And I log out - And I log in as "student1" - When I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as student1 Then I should see "Status: Pending" And I run the scheduled task "core\task\completion_regular_task" And I wait "1" seconds @@ -131,8 +116,7 @@ Feature: Allow to mark course as completed without cron for activity completion @javascript Scenario: Course completion should not be updated when teacher grades assignment on activity grader report page - Given I log in as "teacher1" - And I am on "Completion course" course homepage + Given I am on the "Completion course" course page logged in as teacher1 And I navigate to "View > Single view" in the course gradebook And I click on "Users" "link" in the ".page-toggler" "css_element" And I turn editing mode on @@ -142,9 +126,7 @@ Feature: Allow to mark course as completed without cron for activity completion | Grade for Test assignment name | 10.00 | | Feedback for Test assignment name | test data | And I press "Save" - And I log out - And I log in as "student1" - And I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as student1 And I should see "Status: Pending" And I run the scheduled task "core\task\completion_regular_task" And I wait "1" seconds @@ -154,8 +136,7 @@ Feature: Allow to mark course as completed without cron for activity completion @javascript @_file_upload Scenario: Course completion should not be updated when teacher imports grades with csv file - Given I log in as "teacher1" - And I am on "Completion course" course homepage + Given I am on the "Completion course" course page logged in as teacher1 And I navigate to "CSV file" import page in the course gradebook And I upload "lib/tests/fixtures/upload_grades.csv" file to "File" filemanager And I press "Upload grades" @@ -164,9 +145,7 @@ Feature: Allow to mark course as completed without cron for activity completion And I press "Upload grades" And I press "Continue" And I should see "10.00" in the "Student First" "table_row" - And I log out - And I log in as "student1" - And I am on "Completion course" course homepage + And I am on the "Completion course" course page logged in as student1 And I should see "Status: Pending" When I run the scheduled task "core\task\completion_regular_task" And I wait "1" seconds diff --git a/completion/tests/behat/course_completion_activity_criteria.feature b/completion/tests/behat/course_completion_activity_criteria.feature index 998fd1656ef..5b3fd415432 100644 --- a/completion/tests/behat/course_completion_activity_criteria.feature +++ b/completion/tests/behat/course_completion_activity_criteria.feature @@ -21,29 +21,26 @@ Feature: Course completion state should match completion criteria And the following "activity" exists: | activity | assign | | course | C1 | - | section | 1 | | name | Test assignment name | - | intro | Submit your online text | | completion | 1 | | assignsubmission_onlinetext_enabled | 1 | | grade[modgrade_type] | Point | | grade[modgrade_point] | 100 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | completionstatus | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Course completion" in current page administration And I click on "Condition: Activity completion" "link" And I set the field "Assignment - Test assignment name" to "1" And I press "Save changes" - And I add the "Course completion status" block - And I am on the "Test assignment name" "assign activity" page - And I navigate to "Settings" in current page administration + And I am on the "Test assignment name" "assign activity editing" page And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | completionusegrade | 1 | | completionpassgrade | 1 | | gradepass | 70 | And I press "Save and return to course" - And I log out Scenario: Completion status show match completion criteria when passgrage condition is set. Given I am on the "Course 1" course page logged in as "student1" @@ -57,7 +54,6 @@ Feature: Course completion state should match completion criteria And I press "Save changes" And I press "Submit assignment" And I press "Continue" - And I log out And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I follow "View all submissions" And I click on "Grade" "link" in the "Student 1" "table_row" @@ -72,14 +68,12 @@ Feature: Course completion state should match completion criteria And I click on "Course completion" "link" in the "region-main" "region" And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row" And "Student 1, Course complete: Not completed" "icon" should exist in the "Student 1" "table_row" - And I log out When I am on the "Course 1" course page logged in as "student1" And I should see "Status: Pending" in the "Course completion status" "block" And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done" And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed" And I am on the "My courses" page And I should not see "100%" in the "Course overview" "block" - And I log out And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I follow "View all submissions" And I click on "Grade" "link" in the "Student 1" "table_row" @@ -94,7 +88,6 @@ Feature: Course completion state should match completion criteria And I click on "Course completion" "link" in the "region-main" "region" And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row" And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row" - And I log out And I am on the "Course 1" course page logged in as "student1" And I should see "Status: Complete" in the "Course completion status" "block" And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done" @@ -103,16 +96,13 @@ Feature: Course completion state should match completion criteria Then I should see "100%" in the "Course overview" "block" Scenario: Completion status show match completion criteria when passgrage condition is not set. - Given I am on the "Course 1" course page logged in as "teacher1" - And I am on the "Test assignment name" "assign activity" page - And I navigate to "Settings" in current page administration + Given I am on the "Test assignment name" "assign activity editing" page logged in as teacher1 And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | completionusegrade | 1 | | completionpassgrade | 0 | | gradepass | 70 | And I press "Save and return to course" - And I log out And I am on the "Course 1" course page logged in as "student1" And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo" And I should see "Status: Not yet started" in the "Course completion status" "block" @@ -123,7 +113,6 @@ Feature: Course completion state should match completion criteria And I press "Save changes" And I press "Submit assignment" And I press "Continue" - And I log out And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I follow "View all submissions" And I click on "Grade" "link" in the "Student 1" "table_row" @@ -138,14 +127,12 @@ Feature: Course completion state should match completion criteria And I click on "Course completion" "link" in the "region-main" "region" And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row" And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row" - And I log out When I am on the "Course 1" course page logged in as "student1" And I should see "Status: Complete" in the "Course completion status" "block" # Once MDL-75582 is fixed "failed" should be changed to "done" And the "Receive a grade" completion condition of "Test assignment name" is displayed as "failed" And I am on the "My courses" page And I should see "100%" in the "Course overview" "block" - And I log out And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I follow "View all submissions" And I click on "Grade" "link" in the "Student 1" "table_row" @@ -160,7 +147,6 @@ Feature: Course completion state should match completion criteria And I click on "Course completion" "link" in the "region-main" "region" And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row" And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row" - And I log out And I am on the "Course 1" course page logged in as "student1" And I should see "Status: Complete" in the "Course completion status" "block" And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done" diff --git a/completion/tests/behat/teacher_manual_completion.feature b/completion/tests/behat/teacher_manual_completion.feature index 13810f37546..947321531c0 100644 --- a/completion/tests/behat/teacher_manual_completion.feature +++ b/completion/tests/behat/teacher_manual_completion.feature @@ -6,8 +6,8 @@ Feature: Allow teachers to manually mark users as complete when configured Scenario: Mark a student as complete using the completion report Given the following "courses" exist: - | fullname | shortname | category | - | Completion course | CC1 | 0 | + | fullname | shortname | category | enablecompletion | + | Completion course | CC1 | 0 | 1 | And the following "users" exist: | username | firstname | lastname | email | | student1 | Student | First | student1@example.com | @@ -16,21 +16,16 @@ Feature: Allow teachers to manually mark users as complete when configured | user | course | role | | student1 | CC1 | student | | teacher1 | CC1 | editingteacher | - And I log in as "admin" - And I am on "Completion course" course homepage - And completion tracking is "Enabled" in current course - And I follow "Course completion" + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | completionstatus | Course | CC1 | course-view-* | side-pre | + And I am on the "Completion course" course page logged in as admin + And I navigate to "Course completion" in current page administration And I set the field "Teacher" to "1" And I press "Save changes" - And I turn editing mode on - And I add the "Course completion status" block - And I log out - And I log in as "student1" - And I am on "Completion course" course homepage + And I am on the "Completion course" course page logged in as student1 And I should see "Status: Not yet started" - And I log out - When I log in as "teacher1" - And I am on "Completion course" course homepage + When I am on the "Completion course" course page logged in as teacher1 And I follow "View course report" And I should see "Student First" And I follow "Click to mark user complete" @@ -39,7 +34,5 @@ Feature: Allow teachers to manually mark users as complete when configured And I wait "1" seconds And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage - And I log out - Then I log in as "student1" - And I am on "Completion course" course homepage + Then I am on the "Completion course" course page logged in as student1 And I should see "Status: Complete" diff --git a/course/tests/behat/activities_visibility_icons.feature b/course/tests/behat/activities_visibility_icons.feature index acb3c69ce61..ea6afc03ef5 100644 --- a/course/tests/behat/activities_visibility_icons.feature +++ b/course/tests/behat/activities_visibility_icons.feature @@ -19,6 +19,9 @@ Feature: Toggle activities visibility from the course page And the following "activities" exist: | activity | course | section | idnumber | name | intro | id_visible | | assign | C1 | 1 | 1 | Test assignment name | Test assignment description | 1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | @javascript Scenario: Hide/Show toggle with javascript enabled @@ -77,7 +80,6 @@ Feature: Toggle activities visibility from the course page | visible | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block When I hide section "2" Then "Test forum name" activity should be hidden And I open "Test forum name" actions menu @@ -117,7 +119,6 @@ Feature: Toggle activities visibility from the course page | allowstealth | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block When I open "Test assignment name" actions menu Then "Test assignment name" actions menu should not have "Show" item And "Test assignment name" actions menu should have "Hide" item diff --git a/mod/assign/tests/behat/group_submission.feature b/mod/assign/tests/behat/group_submission.feature index 93325c17931..9e50bb8a6b4 100644 --- a/mod/assign/tests/behat/group_submission.feature +++ b/mod/assign/tests/behat/group_submission.feature @@ -291,26 +291,18 @@ Feature: Group assignment submissions | preventsubmissionnotingroup | 0 | | submissiondrafts | 0 | | teamsubmission | 1 | - And the following "mod_assign > submissions" exist: | assign | user | onlinetext | | Test assignment name | student1 | I'm the student's first submission | - - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Activities" block - And I log out - + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | activity_modules | Course | C1 | course-view-* | side-pre | And I am on the "C1" Course page logged in as student1 And I click on "Assignments" "link" in the "Activities" "block" And I should see "Submitted for grading" - And I log out - And I am on the "C1" Course page logged in as student2 And I click on "Assignments" "link" in the "Activities" "block" And I should see "Submitted for grading" - And I log out - And I am on the "Test assignment name" Activity page logged in as teacher1 When I follow "View all submissions" Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading" diff --git a/mod/choice/tests/behat/block_editing.feature b/mod/choice/tests/behat/block_editing.feature index 70de2df758e..41ee7b4dc9c 100644 --- a/mod/choice/tests/behat/block_editing.feature +++ b/mod/choice/tests/behat/block_editing.feature @@ -17,10 +17,12 @@ Feature: Editing choice block | intro | Choice Description 1 | | section | 1 | | option | Option 1, Option 2 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Activity module | choice1 | mod-choice-* | side-pre | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on And I follow "Choice name 1" - And I add the "Blog menu" block And I should see "View all entries about this Choice" When I configure the "Blog menu" block And I press "Save changes" @@ -51,10 +53,12 @@ Feature: Editing choice block | intro | Choice Description 1 | | section | 1 | | option | Option 1, Option 2 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Activity module | choice1 | mod-choice-* | side-pre | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Choice name 1" - And I add the "Blog menu" block And I should see "View all entries about this Choice" When I configure the "Blog menu" block And I press "Save changes" @@ -84,10 +88,12 @@ Feature: Editing choice block | intro | Choice Description 1 | | section | 1 | | option | Option 1, Option 2 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | blog_menu | Activity module | choice1 | mod-choice-* | side-pre | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Choice name 1" - And I add the "Blog menu" block And I should see "View all entries about this Choice" When I configure the "Blog menu" block And I press "Save changes" diff --git a/mod/data/tests/behat/data_activities.feature b/mod/data/tests/behat/data_activities.feature index 5274cffa7e7..2354f149eaa 100644 --- a/mod/data/tests/behat/data_activities.feature +++ b/mod/data/tests/behat/data_activities.feature @@ -17,14 +17,12 @@ Feature: Users can view the list of data activities and their formatted descript | activity | name | intro | course | idnumber | | data | Test database 1 | This is an intro without an image | C1 | data1 | | data | Test database 2 | This is an intro with an image: | C1 | data2 | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add the "Activities" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | activity_modules | Course | C1 | course-view-* | side-pre | Scenario: Teachers can view the list of data activities and their formatted descriptions - Given I log in as "teacher1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher1 When I follow "Databases" Then I should see "Test database 1" And I should see "Test database 2" @@ -32,11 +30,9 @@ Feature: Users can view the list of data activities and their formatted descript And I should see "This is an intro with an image: " And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist - And I log out Scenario: Students can view the list of data activities and their formatted descriptions - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 When I follow "Databases" Then I should see "Test database 1" And I should see "Test database 2" @@ -44,4 +40,3 @@ Feature: Users can view the list of data activities and their formatted descript And I should see "This is an intro with an image: " And "//img[contains(@src, 'some_image.jpg')]" "xpath_element" should exist And "//img[contains(@src, '@@PLUGINFILE@@/some_image.jpg')]" "xpath_element" should not exist - And I log out diff --git a/mod/feedback/tests/behat/coursemapping.feature b/mod/feedback/tests/behat/coursemapping.feature index ae68aa53c7c..5cdd2c7f5c2 100644 --- a/mod/feedback/tests/behat/coursemapping.feature +++ b/mod/feedback/tests/behat/coursemapping.feature @@ -35,6 +35,11 @@ Feature: Mapping courses in a feedback | feedback | Course feedback | Acceptance test site | feedback0 | 1 | 1 | 1 | | feedback | Another feedback | C1 | feedback1 | 1 | 1 | 0 | And I enable "feedback" "block" plugin + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | feedback | Course | C1 | course-view-* | side-pre | + | feedback | Course | C2 | course-view-* | side-pre | + | feedback | Course | C3 | course-view-* | side-pre | When I log in as "manager" And I am on site homepage And I follow "Course feedback" @@ -54,14 +59,6 @@ Feature: Mapping courses in a feedback | Multiple choice type | Multiple choice - single answer allowed (drop-down menu) | | Multiple choice values | option d\noption e\noption f | And I log out - And I log in as "teacher" - And I am on "Course 1" course homepage with editing mode on - And I add the "Feedback" block - And I am on "Course 2" course homepage - And I add the "Feedback" block - And I am on "Course 3" course homepage - And I add the "Feedback" block - And I log out Scenario: Course feedback can not be mapped And I log in as "manager" diff --git a/mod/forum/tests/behat/advanced_search.feature b/mod/forum/tests/behat/advanced_search.feature index 77c003e5c88..3b032263b9a 100644 --- a/mod/forum/tests/behat/advanced_search.feature +++ b/mod/forum/tests/behat/advanced_search.feature @@ -21,10 +21,10 @@ Feature: The forum search allows users to perform advanced searches for forum po And the following "tags" exist: | name | isstandard | | SearchedTag | 1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Latest announcements" block - And I navigate to "Settings" in current page administration + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | news_items | Course | C1 | course-view-* | side-pre | + And I am on the "Course 1" "course editing" page logged in as teacher1 And I expand all fieldsets And I set the field "id_newsitems" to "1" And I press "Save and display" @@ -35,7 +35,6 @@ Feature: The forum search allows users to perform advanced searches for forum po And I add a new topic to "Announcements" forum with: | Subject | Your subjective| | Message | Your long message | - And I log out Scenario: Perform an advanced search using any term Given I am on the "Announcements" "forum activity" page logged in as student1 @@ -78,12 +77,10 @@ Feature: The forum search allows users to perform advanced searches for forum po And I should see "Your subjective" Scenario: Perform an advanced search matching the author - Given I log in as "teacher2" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher2 And I add a new topic to "Announcements" forum with: | Subject | My Subjects | | Message | My message | - And I log out When I am on the "Announcements" "forum activity" page logged in as student1 And I press "Search" And I should see "Please enter search terms into one or more of the following fields" @@ -109,7 +106,6 @@ Feature: The forum search allows users to perform advanced searches for forum po And I set the following fields to these values: | Tags | SearchedTag | And I press "Save changes" - And I log out And I am on the "Announcements" "forum activity" page logged in as student1 And I press "Search" And I should see "Please enter search terms into one or more of the following fields" diff --git a/mod/forum/tests/behat/edit_post_student.feature b/mod/forum/tests/behat/edit_post_student.feature index d4c1bfbbee3..1e866bc520e 100644 --- a/mod/forum/tests/behat/edit_post_student.feature +++ b/mod/forum/tests/behat/edit_post_student.feature @@ -41,12 +41,11 @@ Feature: Students can edit or delete their forum posts within a set time limit @javascript @block_recent_activity Scenario: Time limit expires - Given I log out - And I log in as "admin" + Given the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | And the following config values are set as admin: | maxeditingtime | 1 | - And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block And I am on the "Course 1" course page logged in as student1 And I should see "New forum posts:" in the "Recent activity" "block" And I should see "Forum post subject" in the "Recent activity" "block" diff --git a/mod/forum/tests/behat/recent_activity.feature b/mod/forum/tests/behat/recent_activity.feature index 693c2ab762c..86574b8e6c2 100644 --- a/mod/forum/tests/behat/recent_activity.feature +++ b/mod/forum/tests/behat/recent_activity.feature @@ -35,9 +35,10 @@ Feature: Users can see the relevant recent forum posts from the recent activity | forum | Standard forum | C1 | forum3 | general | 0 | 1 | | forum | Hidden forum | C1 | forum4 | general | 0 | 0 | | forum | Q&A forum | C1 | forum5 | qanda | 0 | 1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block Scenario: Recent forum activity with separate group discussion Given I add a new discussion to "Separate groups forum" forum with: @@ -94,8 +95,6 @@ Feature: Users can see the relevant recent forum posts from the recent activity And I am on "Course 1" course homepage And I should see "The egg vs the chicken" in the "Recent activity" "block" And I should see "Student 1's answer" in the "Recent activity" "block" - And I log out - And I log in as "admin" And the following config values are set as admin: | maxeditingtime | 1 | When I am on the "Course 1" course page logged in as student2 diff --git a/mod/glossary/tests/behat/import_entries.feature b/mod/glossary/tests/behat/import_entries.feature index 7d6daf8e937..e3499044d98 100644 --- a/mod/glossary/tests/behat/import_entries.feature +++ b/mod/glossary/tests/behat/import_entries.feature @@ -17,14 +17,15 @@ Feature: Importing glossary entries And the following "activities" exist: | activity | course | idnumber | name | | glossary | C1 | glossary1 | Glossary 1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | + | tags | Course | C1 | course-view-* | side-pre | + And I am on the "Glossary 1" "glossary activity" page logged in as teacher1 @javascript @block_recent_activity Scenario: Importing glossary entries and checking the Recent activity block - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block - And I am on the "Glossary 1" "glossary activity" page - And I press "Import entries" + Given I press "Import entries" And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager When I press "Submit" Then I should see "103" in the "Total entries:" "table_row" @@ -35,11 +36,7 @@ Feature: Importing glossary entries @javascript @block_tags Scenario: Importing glossary entries and checking Tags block - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Tags" block - And I am on the "Glossary 1" "glossary activity" page - And I press "Import entries" + Given I press "Import entries" And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager When I press "Submit" And I am on "Course 1" course homepage diff --git a/mod/h5pactivity/tests/behat/recent_activity.feature b/mod/h5pactivity/tests/behat/recent_activity.feature index d2250f85d2f..a8b562c462f 100644 --- a/mod/h5pactivity/tests/behat/recent_activity.feature +++ b/mod/h5pactivity/tests/behat/recent_activity.feature @@ -26,10 +26,9 @@ Feature: Users can see the H5P recent activity from the recent activity block | course | C1 | | name | Awesome H5P package | | packagefilepath | h5p/tests/fixtures/multiple-choice-2-6.h5p | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add the "Recent activity" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | recent_activity | Course | C1 | course-view-* | side-pre | And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1 # The H5P content needs some time to be displayed (so better to wait for 1 second to avoid random errors). And I switch to "h5p-player" class iframe @@ -37,7 +36,6 @@ Feature: Users can see the H5P recent activity from the recent activity block And I click on "Wrong one" "text" in the ".h5p-question-content" "css_element" And I click on "Check" "button" in the ".h5p-question-buttons" "css_element" And I switch to the main frame - And I log out And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student2 # The H5P content needs some time to be displayed (so better to wait for 1 second to avoid random errors). And I switch to "h5p-player" class iframe @@ -45,7 +43,6 @@ Feature: Users can see the H5P recent activity from the recent activity block And I click on "Correct one" "text" in the ".h5p-question-content" "css_element" And I click on "Check" "button" in the ".h5p-question-buttons" "css_element" And I switch to the main frame - And I log out Scenario: Student see only his own activity Given I am on the "Course 1" course page logged in as student1 diff --git a/my/tests/behat/reset_all_pages.feature b/my/tests/behat/reset_all_pages.feature index a321ac039f2..7956720d5a6 100644 --- a/my/tests/behat/reset_all_pages.feature +++ b/my/tests/behat/reset_all_pages.feature @@ -14,26 +14,21 @@ Feature: Reset all personalised pages to default | role | user | | moodle/block:edit | allow | | block/myprofile:addinstance | allow | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | comments | User | student1 | my-index | side-pre | + | myprofile | User | student2 | user-profile | side-pre | And I log in as "student1" - And I follow "Dashboard" - And I turn editing mode on - And I add the "Comments" block - And I turn editing mode off And I should see "Comments" And I log out And I log in as "student2" And I follow "Profile" in the user menu - And I should not see "Logged in user" - And I turn editing mode on - And I add the "Logged in user" block - And I turn editing mode off And I should see "Logged in user" And I log out And I log in as "student3" - And I follow "Dashboard" And I should not see "Comments" And I follow "Profile" in the user menu And I should not see "Logged in user" @@ -51,13 +46,11 @@ Feature: Reset all personalised pages to default And I log out And I log in as "student1" - And I follow "Dashboard" And I should not see "Latest announcements" And I should see "Timeline" And I log out And I log in as "student3" - And I follow "Dashboard" And I should not see "Latest announcements" And I should see "Timeline" And I log out @@ -69,21 +62,18 @@ Feature: Reset all personalised pages to default And I log out And I log in as "student1" - And I follow "Dashboard" Then I should see "Latest announcements" And I should not see "Comments" And I should not see "Timeline" And I log out And I log in as "student3" - And I follow "Dashboard" And I should see "Latest announcements" And I should not see "Timeline" And I log out # Check that this did not affect the customised profiles. - And I log in as "student2" - And I follow "Profile" in the user menu + And I am on the "student2" "user > profile" page logged in as student2 And I should see "Logged in user" And I should not see "Latest announcements" @@ -94,13 +84,11 @@ Feature: Reset all personalised pages to default And I add the "Latest announcements" block And I log out - And I log in as "student2" - And I follow "Profile" in the user menu + And I am on the "student2" "user > profile" page logged in as student2 And I should not see "Latest announcements" And I log out - And I log in as "student3" - And I follow "Profile" in the user menu + And I am on the "student3" "user > profile" page logged in as student3 And I should not see "Latest announcements" And I log out @@ -110,19 +98,16 @@ Feature: Reset all personalised pages to default And I should see "All profile pages have been reset to default." And I log out - And I log in as "student2" - And I follow "Profile" in the user menu + And I am on the "student2" "user > profile" page logged in as student2 Then I should see "Latest announcements" And I should not see "Logged in user" And I log out - And I log in as "student3" - And I follow "Profile" in the user menu + And I am on the "student3" "user > profile" page logged in as student3 And I should see "Latest announcements" And I log out # Check that this did not affect the customised dashboards. And I log in as "student1" - And I follow "Dashboard" And I should see "Comments" And I should not see "Latest announcements" diff --git a/user/tests/behat/custom_profile_fields.feature b/user/tests/behat/custom_profile_fields.feature index 3e80ae21ea7..1a1856683e7 100644 --- a/user/tests/behat/custom_profile_fields.feature +++ b/user/tests/behat/custom_profile_fields.feature @@ -223,11 +223,9 @@ Feature: Custom profile fields should be visible and editable by those with the | moodle/user:viewalldetails | Allow | parent | User | userwithinformation | | moodle/user:viewdetails | Allow | parent | User | userwithinformation | | moodle/user:editprofile | Allow | parent | User | userwithinformation | - Given I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Mentees" block - And I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | mentees | System | 1 | site-index | side-pre | And I log in as "parent" And I am on site homepage When I follow "userwithinformation" diff --git a/user/tests/behat/user_grade_navigation.feature b/user/tests/behat/user_grade_navigation.feature index 02a1e11d21f..83036308a5c 100644 --- a/user/tests/behat/user_grade_navigation.feature +++ b/user/tests/behat/user_grade_navigation.feature @@ -27,8 +27,7 @@ Feature: The student can navigate to their grades page and user grade report. | assign | C1 | a2 | Test assignment two | Submit something! | 100 | | assign | C1 | a3 | Test assignment three | Submit something! | 150 | | assign | C2 | a4 | Test assignment four | Submit something! | 150 | - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment one" @@ -67,10 +66,10 @@ Feature: The student can navigate to their grades page and user grade report. | moodle/user:viewalldetails | allow | | moodle/user:viewuseractivitiesreport | allow | | moodle/user:viewdetails | allow | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | mentees | System | 1 | site-index | side-pre | When I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Mentees" block And I am on the "student1" "user > profile" page And I click on "Preferences" "link" in the ".profile_tree" "css_element" And I follow "Assign roles relative to this user" diff --git a/user/tests/behat/view_preferences_page.feature b/user/tests/behat/view_preferences_page.feature index 35bac5f7048..d5c8e389d14 100644 --- a/user/tests/behat/view_preferences_page.feature +++ b/user/tests/behat/view_preferences_page.feature @@ -60,10 +60,10 @@ Feature: Access to preferences page | moodle/user:viewalldetails | allow | | moodle/user:viewuseractivitiesreport | allow | | moodle/user:viewdetails | allow | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | mentees | System | 1 | site-index | side-pre | When I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Mentees" block And I am on the "student1" "user > profile" page And I click on "Preferences" "link" in the ".profile_tree" "css_element" And I follow "Assign roles relative to this user"