Skip to content

Commit

Permalink
MDL-66109 behat: Require newline at EOF
Browse files Browse the repository at this point in the history
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
  • Loading branch information
andrewnicols committed May 11, 2020
1 parent 149d80e commit 7afd16a
Show file tree
Hide file tree
Showing 37 changed files with 38 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"no-trailing-spaces": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on"
"no-scenario-outlines-without-examples": "on",
"new-line-at-eof": ["on", "yes"]
}
2 changes: 1 addition & 1 deletion admin/tests/behat/filter_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I set the field "id_department" to "red"
And I press "Add filter"
And I should see "User One"
And I should not see "User Two"
And I should not see "User Two"
2 changes: 1 addition & 1 deletion admin/tool/uploadcourse/tests/behat/create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ Feature: An admin can create courses using a CSV file
And I should see "Field 2: 1 June 2020"
And I should see "Field 3: b"
And I should see "Field 4: Hello"
And I should see "Field 5: Some text"
And I should see "Field 5: Some text"
2 changes: 1 addition & 1 deletion admin/tool/uploadcourse/tests/behat/update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ Feature: An admin can update courses using a CSV file
And I should see "Field 2: Tuesday, 1 October 2019, 2:00"
And I should see "Field 3: b"
And I should see "Field 4: Hello"
And I should see "Field 5: Goodbye"
And I should see "Field 5: Goodbye"
2 changes: 1 addition & 1 deletion admin/tool/uploaduser/tests/behat/upload_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@ Feature: Upload users
Then I should see "2 January 2020" in the "Enrolment starts" "table_row"
And I should see "12 January 2020" in the "Enrolment ends" "table_row"
And I click on "Close" "button"
And I log out
And I log out
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ Feature: Restore Moodle 2 course backups with different user data settings
| Settings | Include enrolled users | 0 |
Then I should see "Test database name"
When I follow "Test database name"
Then I should not see "Student entry"
Then I should not see "Student entry"
2 changes: 1 addition & 1 deletion badges/tests/behat/award_badge_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ Feature: Award badges with separate groups
And I follow "Course Badge"
And I press "Award badge"
# Teacher 2 shouldn't be able to go further
Then I should see "Sorry, but you need to be part of a group to see this page."
Then I should see "Sorry, but you need to be part of a group to see this page."
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Feature: The recently accessed items block allows users to easily access their m
When I follow "Test forum name"
And I follow "Dashboard" in the user menu
And I change window size to "large"
Then I should see "Test forum name" in the "Recently accessed items" "block"
Then I should see "Test forum name" in the "Recently accessed items" "block"
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Feature: H5P file upload to content bank for admins
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
And I should not see "filltheblanks.h5p"
And I should not see "filltheblanks.h5p"
2 changes: 1 addition & 1 deletion contentbank/tests/behat/access_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Feature: Access permission to content Bank

Scenario: Editing teachers can't access content bank at system level
Given I log in as "teacher1"
Then "Content bank" "link" should not exist
Then "Content bank" "link" should not exist
2 changes: 1 addition & 1 deletion contentbank/tests/behat/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Feature: Confirm content bank events are triggered
And I set the field "Content name" to "New name"
And I click on "Rename" "button"
And I navigate to "Reports > Live logs" in site administration
Then I should see "Content updated"
Then I should see "Content updated"
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Feature: Edit format course to Single Activity format
And I press "Update format"
Then I should see "Forum" in the "Type of activity" "field"
And I press "Save and display"
And I should see "Adding a new Forum"
And I should see "Adding a new Forum"
2 changes: 1 addition & 1 deletion course/tests/behat/create_delete_course.feature
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ Feature: Test we can both create and delete a course.
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
2 changes: 1 addition & 1 deletion course/tests/behat/edit_settings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ Feature: Edit course settings
| Course short name | Edited course shortname |
| Course summary | Edited course summary |
And I press "Save and return"
Then I should see the "Course categories and courses" management page
Then I should see the "Course categories and courses" management page
2 changes: 1 addition & 1 deletion customfield/field/date/tests/behat/field.feature
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ Feature: Managers can manage course custom fields date
And I expand all fieldsets
Then "#id_customfield_testfield_hour" "css_element" should not be visible
Then "#id_customfield_testfield_minute" "css_element" should not be visible
And I log out
And I log out
2 changes: 1 addition & 1 deletion customfield/tests/behat/unique_field.feature
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ Feature: Uniqueness The course custom fields can be mandatory or not
And I set the following fields to these values:
| Test field | |
And I press "Save and display"
Then I should not see "This value is already used"
Then I should not see "This value is already used"
2 changes: 1 addition & 1 deletion enrol/guest/tests/behat/guest_access.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al
And I set the following fields to these values:
| Password | moodle_rules |
And I press "Submit"
And I should see "Test forum name"
And I should see "Test forum name"
2 changes: 1 addition & 1 deletion group/tests/behat/create_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ Feature: Organize students into groups
And I set the following fields to these values:
| Group name | Group A |
| Enrolment key | Abcdef-1 |
And I should not see "This enrolment key is already used for another group."
And I should not see "This enrolment key is already used for another group."
2 changes: 1 addition & 1 deletion group/tests/behat/group_description.feature
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ Feature: The description of a group can be viewed by students and teachers
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to course participants
And ".groupinfobox" "css_element" should not exist
And ".groupinfobox" "css_element" should not exist
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ Feature: Manage notification preferences - Email
And I open messaging
And I open messaging settings preferences
And I should see "Notification preferences"
And I should see "Jabber"
And I should see "Jabber"
2 changes: 1 addition & 1 deletion message/tests/behat/message_preferences.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Feature: To be able to see and save user message preferences as admin
And I log in as "student1"
And I follow "Preferences" in the user menu
And I click on "Message preferences" "link"
And the field "Email" matches value "0"
And the field "Email" matches value "0"
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/hide_grader.feature
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ Feature: Hide grader identities identity from students
And I should see "Graded" in the "Grading status" "table_row"
And I should see "Catch for us the foxes."
And I should see "Teacher" in the "Graded by" "table_row"
And I log out
And I log out
2 changes: 1 addition & 1 deletion mod/data/tests/behat/add_entries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ Feature: Users can add entries to database activities
And I press "Select all"
And I press "Delete selected"
And I press "Delete"
And I should see "No entries in database"
And I should see "No entries in database"
2 changes: 1 addition & 1 deletion mod/forum/tests/behat/add_forum_inline.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Feature: Add forum activities and discussions utilizing the inline add discussio
And I am on "Course 1" course homepage
Then I add a new discussion to "Test forum name" forum inline with:
| Subject | Post with attachment |
| Message | This is the body |
| Message | This is the body |
2 changes: 1 addition & 1 deletion mod/forum/tests/behat/favourite_discussion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Feature: A student can favourite a discussion via the forum settings menu
And I click on "Discussion 1" action menu
And I click on "[title='Star this discussion']" "css_element"
And I click on "Discussion 1" action menu
And I click on "[title='Unstar this discussion']" "css_element"
And I click on "[title='Unstar this discussion']" "css_element"
2 changes: 1 addition & 1 deletion mod/forum/tests/behat/inpage_reply.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Feature: Students can reply to a discussion in page.
Then I should see "Discussion contents 1, third message"
Then I should see "This is a private reply. It is not visible to other participants."
When I reload the page
Then I should see "Discussion contents 1, third message"
Then I should see "Discussion contents 1, third message"
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Feature: In a lesson activity, teacher can import blackboard fill in the blank q
And I should see "Your answer : frog"
And I should see "A frog is an amphibian"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I should see "Congratulations - end of lesson reached"
2 changes: 1 addition & 1 deletion mod/lesson/tests/behat/lesson_student_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,4 @@ Feature: In Dashboard, a student can see their current status on all lessons wit
And I set the following fields to these values:
| True | 1 |
And I press "Submit"
And I log out
And I log out
2 changes: 1 addition & 1 deletion mod/lesson/tests/behat/teacher_grade_essays.feature
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ Feature: In a lesson activity, a non editing teacher can grade essay questions
Then I should see "Grade essays"
And I follow "Grade essays"
And I should not see "Student 1"
And I should see "Student 2"
And I should see "Student 2"
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ Feature: Scorm multi-sco completion
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And "Student 1" user has completed "ADV Multi-sco SCORM package" activity
And "Student 1" user has completed "ADV Multi-sco SCORM package" activity
2 changes: 1 addition & 1 deletion mod/scorm/tests/behat/multisco_review_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,4 @@ Feature: Scorm multi-sco review mode.
And I follow "Basic Multi-sco SCORM package"
Then I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I should see "Play of the game"
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ Feature: Teachers can reset wiki pages, tags and files
And I follow "Comments"
And I should not see "Test comment"
And I follow "Files"
And I should see "empty.txt"
And I should see "empty.txt"
2 changes: 1 addition & 1 deletion report/configlog/tests/behat/view_report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Feature: In a report, admin can see configuration changes
| Setting | initialnumfeedbacks | quiz | initialnumfeedbacks | 5 | maxsizetodownload |
| Setting | maxsizetodownload | folder | maxsizetodownload | 2048 | initialnumfeedbacks |
| Value | Perth | core | defaultcity | Perth | maxsizetodownload |
| User | Admin | core | defaultcity | Perth | zzzzzzzzz |
| User | Admin | core | defaultcity | Perth | zzzzzzzzz |
2 changes: 1 addition & 1 deletion theme/boost/tests/behat/settingstabs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Feature: Administration nav tabs back
And I click on "Browse list of users" "link"
And I should see "New filter"
When I press the "back" button in the browser
Then I should see "Cohorts"
Then I should see "Cohorts"
2 changes: 1 addition & 1 deletion theme/boost/tests/behat/tour_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ Feature: Apply tour filters to a tour for Classic
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
When I am on homepage
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
2 changes: 1 addition & 1 deletion user/tests/behat/course_preference.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Feature: As a user, "Course preferences" allows me to set my course preference(s
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"
Then I should see "Add a resource..." in the "Topic 1" "section"
2 changes: 1 addition & 1 deletion user/tests/behat/custom_profile_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ Feature: Custom profile fields should be visible and editable by those with the
And I should not see "notvisible_field"
And I should not see "notvisible_field_information"

And I should not see "Edit profile"
And I should not see "Edit profile"

0 comments on commit 7afd16a

Please sign in to comment.