From 197e2bca5b1de70625e6a8d75d9a60774c934bc4 Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Fri, 21 Jul 2017 13:50:47 -0700 Subject: [PATCH] MDL-59602 behat: make use of new course nav steps --- .../behat/tests/behat/data_generators.feature | 3 +-- admin/tool/monitor/tests/behat/rule.feature | 1 - .../tests/behat/availability_grade.feature | 2 +- .../tests/behat/edit_availability.feature | 4 ++-- .../behat/restore_moodle2_courses.feature | 9 +++----- .../behat/block_activity_modules.feature | 1 - .../behat/addunsupportedactivity.feature | 2 +- .../behat/block_blog_recent_course.feature | 12 +++++------ .../tests/behat/block_calendar_month.feature | 7 ++----- ...mpletionstatus_activity_completion.feature | 2 +- .../tests/behat/calendar_lookahead.feature | 2 +- .../bulk_edit_activity_completion.feature | 4 +--- .../behat/default_activity_completion.feature | 4 +--- .../tests/behat/navigate_course_list.feature | 4 ++-- .../behat/paged_course_navigation.feature | 8 +++---- enrol/meta/tests/behat/enrol_meta.feature | 3 +-- enrol/tests/behat/enrol_user.feature | 1 - grade/tests/behat/grade_minmax.feature | 5 ++--- mod/book/tests/behat/edit_tags.feature | 3 +-- .../completion_condition_entries.feature | 21 +++++++++---------- mod/feedback/tests/behat/anonymous.feature | 10 ++++----- .../tests/behat/coursemapping.feature | 2 +- .../tests/behat/multipleattempt.feature | 6 +++--- .../tests/behat/posts_ordering_blog.feature | 1 - mod/glossary/tests/behat/edit_tags.feature | 3 +-- .../tests/behat/duplicate_lesson_page.feature | 3 +-- .../import_fillintheblank_question.feature | 3 +-- mod/lesson/tests/behat/import_images.feature | 3 +-- .../tests/behat/questions_images.feature | 3 +-- ...completion_condition_attempts_used.feature | 4 ++-- ...completion_condition_passing_grade.feature | 2 +- user/tests/behat/course_preference.feature | 6 ++---- user/tests/behat/set_default_homepage.feature | 3 +-- 33 files changed, 60 insertions(+), 87 deletions(-) diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index d8a325b2714ed..0e621041d0a36 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -221,7 +221,7 @@ Feature: Set up contextual data for tests And I should see "Test workshop name" And I follow "Test assignment name" And I should see "Test assignment description" - And I follow "C1" + And I am on "Course 1" course homepage And I follow "Test assignment name with scale" And I follow "Edit settings" And the field "Type" matches value "Scale" @@ -312,7 +312,6 @@ Feature: Set up contextual data for tests | fullname | course | gradecategory | | Grade sub category 2 | C1 | Grade category 1 | When I log in as "admin" - And I am on course index And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook Then I should see "Grade category 1" diff --git a/admin/tool/monitor/tests/behat/rule.feature b/admin/tool/monitor/tests/behat/rule.feature index a38a75d309070..de818df25a360 100644 --- a/admin/tool/monitor/tests/behat/rule.feature +++ b/admin/tool/monitor/tests/behat/rule.feature @@ -17,7 +17,6 @@ Feature: tool_monitor_rule And I log in as "admin" And I navigate to "Event monitoring rules" node in "Site administration > Reports" And I click on "Enable" "link" - And I am on site homepage And I am on "Course 1" course homepage And I navigate to "Event monitoring rules" node in "Course administration > Reports" And I press "Add a new rule" diff --git a/availability/condition/grade/tests/behat/availability_grade.feature b/availability/condition/grade/tests/behat/availability_grade.feature index a9845257a9cd7..546e378b1df50 100644 --- a/availability/condition/grade/tests/behat/availability_grade.feature +++ b/availability/condition/grade/tests/behat/availability_grade.feature @@ -96,7 +96,7 @@ Feature: availability_grade And I click on "Add submission" "button" And I set the field "Online text" to "Q" And I click on "Save changes" "button" - And I follow "C1" + And I am on "Course 1" course homepage # None of the pages should appear (check assignment though). Then I should not see "P2" in the "region-main" "region" diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index ce0392e715ade..3c352278d601b 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -36,7 +36,7 @@ Feature: edit_availability And I add a "Page" to section "1" Then "Restrict access" "fieldset" should not exist - Given I follow "C1" + Given I am on "Course 1" course homepage When I edit the section "1" Then "Restrict access" "fieldset" should not exist @@ -47,7 +47,7 @@ Feature: edit_availability And I add a "Page" to section "1" Then "Restrict access" "fieldset" should exist - Given I follow "C1" + Given I am on "Course 1" course homepage When I edit the section "1" Then "Restrict access" "fieldset" should exist diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index a2886befeb4a9..d34b8d5358b7b 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -169,8 +169,7 @@ Feature: Restore Moodle 2 course backups When I backup "Course 1" course using this options: | Initial | Include enrolled users | 0 | | Confirmation | Filename | test_backup.mbz | - And I am on site homepage - And I follow "Course 2" + And I am on "Course 2" course homepage And I navigate to "Restore" node in "Course administration" And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: | Schema | Overwrite course configuration | Yes | @@ -199,8 +198,7 @@ Feature: Restore Moodle 2 course backups When I backup "Course 1" course using this options: | Initial | Include enrolled users | 0 | | Confirmation | Filename | test_backup.mbz | - And I am on site homepage - And I follow "Course 2" + And I am on "Course 2" course homepage And I navigate to "Restore" node in "Course administration" And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: | Schema | Overwrite course configuration | No | @@ -229,8 +227,7 @@ Feature: Restore Moodle 2 course backups When I backup "Course 1" course using this options: | Initial | Include enrolled users | 0 | | Confirmation | Filename | test_backup.mbz | - And I am on site homepage - And I follow "Course 4" + And I am on "Course 4" course homepage And I navigate to "Restore" node in "Course administration" And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: | Schema | Overwrite course configuration | No | diff --git a/blocks/activity_modules/tests/behat/block_activity_modules.feature b/blocks/activity_modules/tests/behat/block_activity_modules.feature index 2f24252aa8d42..63e6dba5d7632 100644 --- a/blocks/activity_modules/tests/behat/block_activity_modules.feature +++ b/blocks/activity_modules/tests/behat/block_activity_modules.feature @@ -109,7 +109,6 @@ Feature: Block activity modules | workshop | Test workshop name | Test workshop description | C1 | workshop1 | When I log in as "admin" - And I am on course index And I am on "Course 1" course homepage with editing mode on And I add the "Activities" block And I click on "Assignments" "link" in the "Activities" "block" diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index 5103f23804cec..982510d3a90dd 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -22,7 +22,7 @@ Feature: The activity results block doesn't display student scores for unsupport | Assignment name | Test assignment | | Description | Offline text | | assignsubmission_file_enabled | 0 | - And I follow "C1" + 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: 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 67ee460cfff74..8814cc4769384 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_course.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_course.feature @@ -32,7 +32,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I press "Save changes" Then I should see "S1 First Blog" And I should see "This is my awesome blog!" - And I follow "C1" + And I am on "Course 1" course homepage And I should see "S1 First Blog" And I follow "S1 First Blog" And I should see "This is my awesome blog!" @@ -47,7 +47,7 @@ Feature: Students can use the recent blog entries block to view recent entries o | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds - And I follow "C1" + And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 2 of 5 And I set the following fields to these values: @@ -57,7 +57,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I wait "1" seconds And I should see "S1 Second Blog" And I should see "This is my awesome blog!" - And I follow "C1" + And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 3 of 5 And I set the following fields to these values: @@ -67,7 +67,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I wait "1" seconds And I should see "S1 Third Blog" And I should see "This is my awesome blog!" - And I follow "C1" + And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 4 of 5 And I set the following fields to these values: @@ -77,7 +77,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I wait "1" seconds And I should see "S1 Fourth Blog" And I should see "This is my awesome blog!" - And I follow "C1" + And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 5 of 5 And I set the following fields to these values: @@ -86,7 +86,7 @@ Feature: Students can use the recent blog entries block to view recent entries o And I press "Save changes" And I should see "S1 Fifth Blog" And I should see "This is my awesome blog!" - When I follow "C1" + When I am on "Course 1" course homepage And I should not see "S1 First Blog" And I should see "S1 Second Blog" And I should see "S1 Third Blog" diff --git a/blocks/calendar_month/tests/behat/block_calendar_month.feature b/blocks/calendar_month/tests/behat/block_calendar_month.feature index db6f058c71a23..15e30e1195774 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month.feature @@ -81,7 +81,6 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I am on homepage And I am on "Course 1" course homepage And I follow "Hide course events" And I hover over today in the calendar @@ -96,8 +95,7 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I am on homepage - And I am on "Course 1" course homepage + When I am on "Course 1" course homepage And I hover over today in the calendar Then I should see "User Event" @@ -113,8 +111,7 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I am on homepage - And I am on "Course 1" course homepage + When I am on "Course 1" course homepage And I follow "Hide user events" And I hover over today in the calendar Then I should not see "User Event" diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature b/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature index a92c042bd1f7a..d41fe98ae3da1 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature @@ -60,7 +60,7 @@ Feature: Enable Block Completion in a course using activity completion When I log in as "student1" And I am on "Course 1" course homepage And I follow "Test page name" - And I follow "C1" + And I am on "Course 1" course homepage Then I should see "Status: Pending" in the "Course completion status" "block" And I should see "0 of 1" in the "Activity completion" "table_row" And I trigger cron diff --git a/calendar/tests/behat/calendar_lookahead.feature b/calendar/tests/behat/calendar_lookahead.feature index 819d03e2b30f5..2f828824a3cb1 100644 --- a/calendar/tests/behat/calendar_lookahead.feature +++ b/calendar/tests/behat/calendar_lookahead.feature @@ -26,7 +26,7 @@ Feature: Limit displayed upcoming events And I create a calendar event: | Type of event | course | | Event title | Two months away event | - When I follow "C1" + When I am on "Course 1" course homepage Then I should not see "Two months away event" And I am on site homepage And I follow "Preferences" in the user menu diff --git a/completion/tests/behat/bulk_edit_activity_completion.feature b/completion/tests/behat/bulk_edit_activity_completion.feature index c4d03529c89f4..4d72d35b16942 100644 --- a/completion/tests/behat/bulk_edit_activity_completion.feature +++ b/completion/tests/behat/bulk_edit_activity_completion.feature @@ -27,9 +27,7 @@ Feature: Allow teachers to bulk edit activity completion rules in a course. | assign | C1 | a3 | Test assignment three | Submit something! | 150 | | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 | And I log in as "teacher1" - And I am on site homepage - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | diff --git a/completion/tests/behat/default_activity_completion.feature b/completion/tests/behat/default_activity_completion.feature index 13aeb24860326..cc322753ef0e3 100644 --- a/completion/tests/behat/default_activity_completion.feature +++ b/completion/tests/behat/default_activity_completion.feature @@ -24,9 +24,7 @@ Feature: Allow teachers to edit the default activity completion rules in a cours | activity | course | idnumber | name | intro | grade | | assign | C1 | a1 | Test assignment one | Submit something! | 300 | And I log in as "teacher1" - And I am on site homepage - And I follow "Course 1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | diff --git a/course/tests/behat/navigate_course_list.feature b/course/tests/behat/navigate_course_list.feature index acd8219f2473f..cce5ffa036479 100644 --- a/course/tests/behat/navigate_course_list.feature +++ b/course/tests/behat/navigate_course_list.feature @@ -26,7 +26,7 @@ Feature: Browse course list and return back from enrolment page Then I should see "Courses" in the ".breadcrumb-nav" "css_element" And I click on "Courses" "link" in the ".breadcrumb-nav" "css_element" And I follow "Sample category" - And I follow "Course 1" + And I am on "Course 1" course homepage And I press "Continue" And I should see "Sample category" in the ".breadcrumb-nav" "css_element" @@ -45,7 +45,7 @@ Feature: Browse course list and return back from enrolment page And I open my profile in edit mode And I expand "Courses" node And I expand "Sample category" node - And I follow "Course 1" + And I am on "Course 1" course homepage And I press "Continue" Then I should see "Edit profile" in the ".breadcrumb-nav" "css_element" diff --git a/course/tests/behat/paged_course_navigation.feature b/course/tests/behat/paged_course_navigation.feature index 0f929bdcf7a3f..3e88929bef8f5 100644 --- a/course/tests/behat/paged_course_navigation.feature +++ b/course/tests/behat/paged_course_navigation.feature @@ -12,9 +12,9 @@ Feature: Course paged mode And I log in as "admin" And I am on "Course 1" course homepage Then I click on "link" in the "section" - And I follow "C1" + And I am on "Course 1" course homepage And I click on "link" in the "section" - And I follow "C1" + And I am on "Course 1" course homepage And I click on "link" in the "section" And I should see in the "div.single-section" "css_element" And I should see in the ".single-section span.mdl-right" "css_element" @@ -45,9 +45,9 @@ Feature: Course paged mode And I log in as "admin" And I am on "Course 1" course homepage Then I click on "link" in the "section" - And I follow "C1" + And I am on "Course 1" course homepage And I click on "link" in the "section" - And I follow "C1" + And I am on "Course 1" course homepage And I click on "link" in the "section" And I should see in the "div.single-section" "css_element" And I should see in the ".single-section span.mdl-right" "css_element" diff --git a/enrol/meta/tests/behat/enrol_meta.feature b/enrol/meta/tests/behat/enrol_meta.feature index f8ba17310445c..470ad1dd3b63a 100644 --- a/enrol/meta/tests/behat/enrol_meta.feature +++ b/enrol/meta/tests/behat/enrol_meta.feature @@ -93,8 +93,7 @@ Feature: Enrolments are synchronised with meta courses And I press "Next" And I press "Perform restore" And I trigger cron - And I am on course index - And I follow "Course 4" + And I am on "Course 4" course homepage And I navigate to "Enrolment methods" node in "Course administration > Users" Then I should see "Course meta link (Course 1)" And I should see "Course meta link (Course 2)" diff --git a/enrol/tests/behat/enrol_user.feature b/enrol/tests/behat/enrol_user.feature index aa88075b324e5..294ee58eb0fcf 100644 --- a/enrol/tests/behat/enrol_user.feature +++ b/enrol/tests/behat/enrol_user.feature @@ -12,7 +12,6 @@ Feature: User can be enrolled into a course | fullname | shortname | | Course 001 | C001 | And I log in as "admin" - And I am on course index And I am on "Course 001" course homepage Scenario: User can be enrolled without javascript diff --git a/grade/tests/behat/grade_minmax.feature b/grade/tests/behat/grade_minmax.feature index 13f1b756c4a8a..b1535e04b4c7f 100644 --- a/grade/tests/behat/grade_minmax.feature +++ b/grade/tests/behat/grade_minmax.feature @@ -24,8 +24,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I log in as "admin" And I set the following administration settings values: | grade_minmaxtouse | Min and max grades as specified in grade item settings | - And I am on site homepage - And I follow "C1" + And I am on "C1" course homepage And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: @@ -66,7 +65,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. | Aggregation | Natural | And I log out And I log in as "teacher1" - And I follow "C1" + And I am on "C1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1" diff --git a/mod/book/tests/behat/edit_tags.feature b/mod/book/tests/behat/edit_tags.feature index 8a2348288fd04..938b07f9a2da1 100644 --- a/mod/book/tests/behat/edit_tags.feature +++ b/mod/book/tests/behat/edit_tags.feature @@ -17,8 +17,7 @@ Feature: Edited book chapters handle tags correctly | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Book" to section "1" and I fill the form with: | Name | Test book | | Description | A book about dreams! | diff --git a/mod/data/tests/behat/completion_condition_entries.feature b/mod/data/tests/behat/completion_condition_entries.feature index d9da1db9110a6..4f74d2cb65de9 100644 --- a/mod/data/tests/behat/completion_condition_entries.feature +++ b/mod/data/tests/behat/completion_condition_entries.feature @@ -17,8 +17,7 @@ Feature: Set entries required as a completion condition for a data item | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I follow "C1" - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Database" to section "1" and I fill the form with: | Name | Test database name | | Description | Test database description | @@ -26,38 +25,38 @@ Feature: Set entries required as a completion condition for a data item | completionview | 0 | | completionentriesenabled | checked | | completionentries | 2 | - And I follow "Course 1" + And I am on "Course 1" course homepage And I add a "Text input" field to "Test database name" database and I fill the form with: | Field name | Test field name | - And I follow "C1" + And I am on "Course 1" course homepage And I log out When I log in as "student1" - And I follow "C1" + And I am on "Course 1" course homepage And I add an entry to "Test database name" database with: | Test field name | Student original entry | And I press "Save and view" - And I follow "C1" + And I am on "Course 1" course homepage And I log out And I log in as "teacher1" - And I follow "C1" + And I am on "Course 1" course homepage #One entry is not enough to mark as complete And "Student 1" user has not completed "Test database name" activity And I log out When I log in as "student1" - And I follow "C1" + And I am on "Course 1" course homepage And I add an entry to "Test database name" database with: | Test field name | Student second entry | And I press "Save and view" And I log out And I log in as "teacher1" - And I follow "C1" + And I am on "Course 1" course homepage Then "Student 1" user has completed "Test database name" activity - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Test database name" And I navigate to "Edit settings" in current page administration And I press "Unlock completion" And I set the field "completionentries" to "1" And I press "Save and display" - And I follow "C1" + And I am on "Course 1" course homepage Then "Student 1" user has completed "Test database name" activity And I log out diff --git a/mod/feedback/tests/behat/anonymous.feature b/mod/feedback/tests/behat/anonymous.feature index 849b9456504c1..cfe497cf6e00f 100644 --- a/mod/feedback/tests/behat/anonymous.feature +++ b/mod/feedback/tests/behat/anonymous.feature @@ -247,7 +247,7 @@ Feature: Anonymous feedback Scenario: Collecting new non-anonymous feedback from a previously anonymous feedback activity When I log in as "teacher" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I navigate to "Edit settings" in current page administration And I set the following fields to these values: @@ -260,7 +260,7 @@ Feature: Anonymous feedback | Maximum characters accepted | 200 | And I log out When I log in as "user1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I follow "Answer the questions..." And I set the following fields to these values: @@ -269,7 +269,7 @@ Feature: Anonymous feedback And I log out # Switch to non-anon responses. And I log in as "teacher" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I navigate to "Edit settings" in current page administration And I set the following fields to these values: @@ -278,7 +278,7 @@ Feature: Anonymous feedback And I log out # Now leave a non-anon feedback as user1 When I log in as "user1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I follow "Answer the questions..." And I set the following fields to these values: @@ -287,7 +287,7 @@ Feature: Anonymous feedback And I log out # Now check the responses are correct. When I log in as "teacher" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I follow "Show responses" And I should see "Anonymous entries (1)" diff --git a/mod/feedback/tests/behat/coursemapping.feature b/mod/feedback/tests/behat/coursemapping.feature index 12fba55182e0c..d4a0315857569 100644 --- a/mod/feedback/tests/behat/coursemapping.feature +++ b/mod/feedback/tests/behat/coursemapping.feature @@ -81,7 +81,7 @@ Feature: Mapping courses in a feedback | this is a simple multiple choice | option d | And I press "Submit your answers" And I press "Continue" - And I follow "Course 1" + And I am on "Course 1" course homepage And I click on "Course feedback" "link" in the "Feedback" "block" And I follow "Answer the questions..." And I should not see "Acceptance test site" in the ".feedback_form" "css_element" diff --git a/mod/feedback/tests/behat/multipleattempt.feature b/mod/feedback/tests/behat/multipleattempt.feature index aa226bf3a84a2..4087dd6f0d192 100644 --- a/mod/feedback/tests/behat/multipleattempt.feature +++ b/mod/feedback/tests/behat/multipleattempt.feature @@ -25,7 +25,7 @@ Feature: Non anonymous feedback with multiple submissions Scenario: Completing a feedback second time When I log in as "teacher" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Short text answer" question to the feedback with: @@ -39,7 +39,7 @@ Feature: Non anonymous feedback with multiple submissions | Maximum characters accepted | 200 | And I log out And I log in as "user1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I follow "Answer the questions..." And I set the following fields to these values: @@ -50,7 +50,7 @@ Feature: Non anonymous feedback with multiple submissions And I press "Submit your answers" And I log out And I log in as "user1" - And I follow "Course 1" + And I am on "Course 1" course homepage And I follow "Course feedback" And I follow "Answer the questions..." Then the field "first" matches value "111" diff --git a/mod/forum/tests/behat/posts_ordering_blog.feature b/mod/forum/tests/behat/posts_ordering_blog.feature index 91c5105eccbbb..95a227b39f5a2 100644 --- a/mod/forum/tests/behat/posts_ordering_blog.feature +++ b/mod/forum/tests/behat/posts_ordering_blog.feature @@ -67,7 +67,6 @@ Feature: Blog posts are always displayed in reverse chronological order | Message | Reply to the first post | And I press "Post to forum" And I wait to be redirected - And I am on site homepage And I am on "Course 1" course homepage And I follow "Course blog forum" # diff --git a/mod/glossary/tests/behat/edit_tags.feature b/mod/glossary/tests/behat/edit_tags.feature index 61d7c65957918..3812acee73100 100644 --- a/mod/glossary/tests/behat/edit_tags.feature +++ b/mod/glossary/tests/behat/edit_tags.feature @@ -17,8 +17,7 @@ Feature: Edited glossary entries handle tags correctly | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on And I add a "Glossary" to section "1" and I fill the form with: | Name | Test glossary | | Description | A glossary about dreams! | diff --git a/mod/lesson/tests/behat/duplicate_lesson_page.feature b/mod/lesson/tests/behat/duplicate_lesson_page.feature index 53ff09fc61215..3cbc37bbf65c1 100644 --- a/mod/lesson/tests/behat/duplicate_lesson_page.feature +++ b/mod/lesson/tests/behat/duplicate_lesson_page.feature @@ -20,8 +20,7 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page And I follow "Manage private files" And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager And I click on "Save changes" "button" - When I am on homepage - And I am on "Course 1" course homepage with editing mode on + When I am on "Course 1" course homepage with editing mode on And I add a "Lesson" to section "1" and I fill the form with: | Name | Test lesson name | | Description | Test lesson description | diff --git a/mod/lesson/tests/behat/import_fillintheblank_question.feature b/mod/lesson/tests/behat/import_fillintheblank_question.feature index 9fa478cda714f..80d26e125a2b5 100644 --- a/mod/lesson/tests/behat/import_fillintheblank_question.feature +++ b/mod/lesson/tests/behat/import_fillintheblank_question.feature @@ -17,8 +17,7 @@ Feature: In a lesson activity, teacher can import blackboard fill in the blank q | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - When I am on homepage - And I am on "Course 1" course homepage with editing mode on + When I am on "Course 1" course homepage with editing mode on And I add a "Lesson" to section "1" and I fill the form with: | Name | Test lesson name | | Description | Test lesson description | diff --git a/mod/lesson/tests/behat/import_images.feature b/mod/lesson/tests/behat/import_images.feature index c9f996c411f83..88adddcbdc855 100644 --- a/mod/lesson/tests/behat/import_images.feature +++ b/mod/lesson/tests/behat/import_images.feature @@ -17,8 +17,7 @@ Feature: In a lesson activity, teacher can import embedded images in questions a | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - When I am on homepage - And I am on "Course 1" course homepage with editing mode on + When I am on "Course 1" course homepage with editing mode on And I add a "Lesson" to section "1" and I fill the form with: | Name | Test lesson name | | Description | Test lesson description | diff --git a/mod/lesson/tests/behat/questions_images.feature b/mod/lesson/tests/behat/questions_images.feature index ce3af1ae192f3..0dc725c055ce7 100644 --- a/mod/lesson/tests/behat/questions_images.feature +++ b/mod/lesson/tests/behat/questions_images.feature @@ -20,8 +20,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ And I follow "Manage private files" And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager And I click on "Save changes" "button" - When I am on homepage - And I am on "Course 1" course homepage with editing mode on + When I am on "Course 1" course homepage with editing mode on And I add a "Lesson" to section "1" and I fill the form with: | Name | Test lesson name | | Description | Test lesson description | diff --git a/mod/quiz/tests/behat/completion_condition_attempts_used.feature b/mod/quiz/tests/behat/completion_condition_attempts_used.feature index 735b7eda23b56..58e13990c26a6 100644 --- a/mod/quiz/tests/behat/completion_condition_attempts_used.feature +++ b/mod/quiz/tests/behat/completion_condition_attempts_used.feature @@ -40,14 +40,14 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all And I set the field "False" to "1" And I press "Finish attempt ..." And I press "Submit all and finish" - And I follow "C1" + And I am on "Course 1" course homepage And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete And I follow "Test quiz name" And I press "Re-attempt quiz" And I set the field "False" to "1" And I press "Finish attempt ..." And I press "Submit all and finish" - And I follow "C1" + And I am on "Course 1" course homepage Then "Completed: Test quiz name" "icon" should exist in the "li.modtype_quiz" "css_element" And I log out And I log in as "teacher1" diff --git a/mod/quiz/tests/behat/completion_condition_passing_grade.feature b/mod/quiz/tests/behat/completion_condition_passing_grade.feature index f8e783c09e1ef..7afbec51193d6 100644 --- a/mod/quiz/tests/behat/completion_condition_passing_grade.feature +++ b/mod/quiz/tests/behat/completion_condition_passing_grade.feature @@ -40,7 +40,7 @@ Feature: Set a quiz to be marked complete when the student passes And I set the field "True" to "1" And I press "Finish attempt ..." And I press "Submit all and finish" - And I follow "C1" + And I am on "Course 1" course homepage Then "Completed: Test quiz name" "icon" should exist in the "li.modtype_quiz" "css_element" And I log out And I log in as "teacher1" diff --git a/user/tests/behat/course_preference.feature b/user/tests/behat/course_preference.feature index c14ca659a37ba..6d0ed76c735ee 100644 --- a/user/tests/behat/course_preference.feature +++ b/user/tests/behat/course_preference.feature @@ -17,8 +17,7 @@ Feature: As a user, "Course preferences" allows me to set my course preference(s # See that the "activity chooser" is enabled by default. Given the field "enableactivitychooser" matches value "1" # See that the "activity chooser" is actually shown by default in course page. - When I am on homepage - And I am on "Course 1" course homepage + When I am on "Course 1" course homepage And I should not see "Add an activity or resource" in the "Topic 1" "section" And I turn editing mode on Then I should see "Add an activity or resource" in the "Topic 1" "section" @@ -28,8 +27,7 @@ Feature: As a user, "Course preferences" allows me to set my course preference(s Scenario: As a user, "activity chooser" should be disabled when I uncheck it in "Course preferences" Given I set the field "enableactivitychooser" to "0" And I press "Save changes" - When I am on homepage - And I am on "Course 1" course homepage + When I am on "Course 1" course homepage And I should not see "Add a resource..." in the "Topic 1" "section" And I turn editing mode on Then I should see "Add a resource..." in the "Topic 1" "section" diff --git a/user/tests/behat/set_default_homepage.feature b/user/tests/behat/set_default_homepage.feature index 58d99cc90fdca..8da6610f6a1f9 100644 --- a/user/tests/behat/set_default_homepage.feature +++ b/user/tests/behat/set_default_homepage.feature @@ -33,6 +33,5 @@ Feature: Set the site home page and dashboard as the default home page And I follow "Dashboard" And I follow "Make this my default home page" And I should not see "Make this my default home page" - And I am on site homepage - When I am on "Course 1" course homepage + And I am on "Course 1" course homepage Then "Dashboard" "text" should exist in the ".breadcrumb-nav" "css_element"