Skip to content

Commit

Permalink
MDL-71610 core_behat: use new edit mode step in feature files
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas Brands committed Sep 29, 2021
1 parent 3ff1b83 commit 16c726c
Show file tree
Hide file tree
Showing 72 changed files with 151 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Manage availability conditions
Scenario: Display list of availability conditions
# Check the report doesn't show when not enabled.
Given I log in as "admin"
And I press "Customise this page"
And I turn editing mode on
And I add the "Administration" block if not present
And the following config values are set as admin:
| enableavailability | 0 |
Expand Down
8 changes: 4 additions & 4 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ Feature: Set up contextual data for tests
| user5 | custom2 | System | |
When I log in as "user1"
And I am on site homepage
Then "Edit settings" "link" should exist in current page administration
Then I should see "Edit mode"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And "Turn editing on" "button" should exist
Then I should see "Edit mode"
And I log out
And I log in as "user3"
And I am on "Course 1" course homepage
And "Turn editing on" "button" should exist
Then I should see "Edit mode"
And I log out
And I log in as "user4"
And I am on "Course 1" course homepage
And "Turn editing on" "button" should exist
Then I should see "Edit mode"
And I log out
And I log in as "user5"
And I should see "You are logged in as"
Expand Down
4 changes: 2 additions & 2 deletions badges/tests/behat/add_badge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Add badges to the system

@javascript
Scenario: Accessing the badges
And I press "Customise this page"
And I turn editing mode on
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
Expand Down Expand Up @@ -133,7 +133,7 @@ Feature: Add badges to the system

@javascript @_file_upload
Scenario: Add a badge from Site badges section
Given I press "Customise this page"
Given I turn editing mode on
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
And I add the "Navigation" block if not present
When I click on "Site pages" "list_item" in the "Navigation" "block"
Expand Down
2 changes: 1 addition & 1 deletion badges/tests/behat/award_badge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Feature: Award badges
And I should see "Add a new badge"
# Teacher 1 should NOT have access to manage/create site badges in the Site badges section.
When I am on homepage
And I press "Customise this page"
And I turn editing mode on
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Block activity modules

When I log in as "admin"
And I am on site homepage
And I follow "Turn editing on"
And I turn editing mode on
And I add the "Activities" block
And I click on "Assignments" "link" in the "Activities" "block"
Then I should see "Frontpage assignment name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Feature: The activity results block displays student scores
And I am on "Course 1" course homepage with editing mode on
And I should see "Test page name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment 1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Feature: The activity results block displays student high scores
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Feature: The activity results block displays student in group high scores as sca
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Feature: The activity results block displays student in separate groups scores
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Feature: The activity results block displays student low scores
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Feature: The activity results block displays student low scores as scales
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Feature: The activity results block displays students in groups low scores as sc
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
And I am on "Course 1" course homepage

Scenario: Try to configure the block on the course page to show 1 low score
Given I add the "Activity results" block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Feature: The activity results block displays students in separate groups scores
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Feature: The activity results block displays student in visible groups low score
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
Expand Down
2 changes: 1 addition & 1 deletion blocks/badges/tests/behat/block_badges_frontpage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Latest badges" block
And I log out
And I log in as "teacher1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Enable Block blog menu on the frontpage
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Blog menu" block
And I log out

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Feature: Students can use the recent blog entries block to view recent
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Recent blog entries" block
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
Expand Down Expand Up @@ -89,7 +89,7 @@ Feature: Feature: Students can use the recent blog entries block to view recent
Then I log out
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I configure the "Recent blog entries" block
And I set the following fields to these values:
| id_config_numberofrecentblogentries | 2 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: View a site event on the frontpage
| id_eventtype | Site |
| id_name | My Site Event |
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Upcoming events" block
And I log out
When I log in as "teacher1"
Expand Down
4 changes: 2 additions & 2 deletions blocks/comments/tests/behat/block_comment_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: Enable Block comments on the dashboard and view comments

Scenario: Add the comments block on the dashboard and add comments with Javascript disabled
When I log in as "teacher1"
And I press "Customise this page"
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 the teacher" comment to comments block
Expand All @@ -23,7 +23,7 @@ Feature: Enable Block comments on the dashboard and view comments
@javascript
Scenario: Add the comments block on the dashboard and add comments with Javascript enabled
When I log in as "teacher1"
And I press "Customise this page"
And I turn editing mode on
And I add the "Comments" block
And I add "I'm a comment from the teacher" comment to comments block
Then I should see "I'm a comment from the teacher"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Enable Block comments on the frontpage and view comments
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Feature: Enable the course_list block on the dashboard and view it's contents

Scenario: Add the course list block on the dashboard and navigate to the course listing
Given I log in as "teacher1"
And I press "Customise this page"
And I turn editing mode on
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
Expand All @@ -38,7 +38,7 @@ Feature: Enable the course_list block on the dashboard and view it's contents

Scenario: Add the course list block on the dashboard and navigate to another course
Given I log in as "teacher1"
And I press "Customise this page"
And I turn editing mode on
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
Expand All @@ -49,7 +49,7 @@ Feature: Enable the course_list block on the dashboard and view it's contents

Scenario: Add the course list block on the dashboard and view as an admin
Given I log in as "admin"
And I press "Customise this page"
And I turn editing mode on
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Enable the course_list block on the frontpage and view it's contents
Scenario: Add the course list block on the frontpage and navigate to the course listing
Given I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Courses" block
And I log out
When I log in as "teacher1"
Expand All @@ -43,7 +43,7 @@ Feature: Enable the course_list block on the frontpage and view it's contents
Scenario: Add the course list block on the frontpage page and navigate to another course
Given I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Courses" block
And I log out
When I log in as "teacher1"
Expand All @@ -58,7 +58,7 @@ Feature: Enable the course_list block on the frontpage and view it's contents
Scenario: Add the course list block on the frontpage page and view as an admin
Given I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
Expand All @@ -72,7 +72,7 @@ Feature: Enable the course_list block on the frontpage and view it's contents
Scenario: Add the course list block on the frontpage page and view as a guest
Given I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Courses" block
And I log out
When I log in as "guest"
Expand Down
2 changes: 1 addition & 1 deletion blocks/login/tests/behat/login_block.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Login from a block
| testuser | testpass | Test | User | student1@example.com |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I turn editing mode on
And I add the "Login" block

Scenario: Login block visible to non-logged in users
Expand Down
Loading

0 comments on commit 16c726c

Please sign in to comment.