Skip to content

Commit

Permalink
MDL-59602 behat: make use of new course nav steps
Browse files Browse the repository at this point in the history
  • Loading branch information
polothy committed Jul 21, 2017
1 parent 229ae61 commit 197e2bc
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 87 deletions.
3 changes: 1 addition & 2 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion admin/tool/monitor/tests/behat/rule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions availability/tests/behat/edit_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

Expand Down
9 changes: 3 additions & 6 deletions backup/util/ui/tests/behat/restore_moodle2_courses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions blocks/blog_recent/tests/behat/block_blog_recent_course.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion calendar/tests/behat/calendar_lookahead.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions completion/tests/behat/bulk_edit_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 1 addition & 3 deletions completion/tests/behat/default_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions course/tests/behat/navigate_course_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"

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

Expand Down
8 changes: 4 additions & 4 deletions course/tests/behat/paged_course_navigation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 <section2> "link" in the <section2> "section"
And I follow "C1"
And I am on "Course 1" course homepage
And I click on <section3> "link" in the <section3> "section"
And I follow "C1"
And I am on "Course 1" course homepage
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section span.mdl-right" "css_element"
Expand Down Expand Up @@ -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 <section2> "link" in the <section2> "section"
And I follow "C1"
And I am on "Course 1" course homepage
And I click on <section3> "link" in the <section3> "section"
And I follow "C1"
And I am on "Course 1" course homepage
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section span.mdl-right" "css_element"
Expand Down
3 changes: 1 addition & 2 deletions enrol/meta/tests/behat/enrol_meta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
1 change: 0 additions & 1 deletion enrol/tests/behat/enrol_user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions grade/tests/behat/grade_minmax.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions mod/book/tests/behat/edit_tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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! |
Expand Down
21 changes: 10 additions & 11 deletions mod/data/tests/behat/completion_condition_entries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,46 @@ 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 |
| Completion tracking | Show activity as complete when conditions are met |
| 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
Loading

0 comments on commit 197e2bc

Please sign in to comment.