MDL-58265 core_test: replace I turn editing on steps

Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
This commit is contained in:
Simey Lameze 2017-03-15 15:13:09 +08:00 committed by Damyon Wiese
parent 3353cfd8c1
commit fdeeaff954
458 changed files with 1697 additions and 2148 deletions

View file

@ -9,16 +9,14 @@ Feature: Edit completion settings of an activity
| fullname | shortname | enablecompletion |
| Course 1 | C1 | 1 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1" and I fill the form with:
| Name | TestPage |
| Description | x |
| Page content | x |
| Completion tracking | 2 |
| Require view | 1 |
And I am on course page "Course 1"
And I am on "Course 1" course homepage
Scenario: Completion is not locked when the activity has not yet been viewed
Given I click on "Edit settings" "link" in the "TestPage" activity

View file

@ -16,8 +16,7 @@ Feature: Edit activity name in-place
| user | course | role |
| teacher1 | C1 | editingteacher |
When I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
@ -28,7 +27,7 @@ Feature: Edit activity name in-place
Then I should not see "Test forum name" in the ".course-content" "css_element"
And "New name for activity Test forum name" "field" should not exist
And I should see "Good news"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I should see "Good news"
And I should not see "Test forum name"
# Cancel renaming
@ -38,7 +37,7 @@ Feature: Edit activity name in-place
And "New name for activity Good news" "field" should not exist
And I should see "Good news"
And I should not see "Terrible news"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I should see "Good news"
And I should not see "Terrible news"
And I log out

View file

@ -16,8 +16,7 @@ Feature: Open the edit menu when a block is docked
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
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 name |
| Description | Test glossary description |

View file

@ -16,8 +16,7 @@ Feature: Toggle activities groups mode from the course page
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |

View file

@ -18,8 +18,7 @@ Feature: Indent items on the course page
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
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 name |
| Description | Test glossary description |

View file

@ -18,8 +18,7 @@ Feature: Toggle activities visibility from the course page
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
@ -60,7 +59,7 @@ Feature: Toggle activities visibility from the course page
And I log out
# Student should not see this activity.
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I should not see "Test forum name"
And I log out
@ -78,8 +77,7 @@ Feature: Toggle activities visibility from the course page
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
@ -115,7 +113,7 @@ Feature: Toggle activities visibility from the 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 page "Course 1"
And I am on "Course 1" course homepage
And "Test forum name" activity should be hidden
And I click on "Test forum name" "link" in the "Recent activity" "block"
And I should see "Test forum name"
@ -134,8 +132,7 @@ Feature: Toggle activities visibility from the course page
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
@ -173,8 +170,7 @@ Feature: Toggle activities visibility from the course page
| allowstealth | 1 |
And I log out
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I add a "Assignment" to section "2" and I fill the form with:
| Assignment name | Test assignment name |
@ -208,7 +204,7 @@ Feature: Toggle activities visibility from the 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 page "Course 1"
And I am on "Course 1" course homepage
And "Test assignment name" activity should be hidden
And I click on "Test assignment name" "link" in the "Recent activity" "block"
And I should see "Test assignment name"

View file

@ -17,9 +17,7 @@ Feature: Add activities to courses
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Add an activity to a course
@ -48,8 +46,7 @@ Feature: Add activities to courses
Scenario: Set activity description to required then add an activity supplying only the name
Given I set the following administration settings values:
| requiremodintro | Yes |
When I am on site homepage
And I am on course page "Course 1"
When I am on "Course 1" course homepage
And I add a "Database" to section "3" and I fill the form with:
| Name | Test name |
Then I should see "Required"

View file

@ -27,7 +27,7 @@ Feature: Course activity controls works as expected
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I follow <targetpage>
And I turn editing mode on
And I add the "Recent activity" block
@ -99,7 +99,7 @@ Feature: Course activity controls works as expected
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I follow <targetpage>
And I turn editing mode on
And I add the "Recent activity" block

View file

@ -18,8 +18,7 @@ Feature: Managers can create courses
And I enrol "Student 1" user as "Student"
And I log out
When I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
Then "Latest announcements" "block" should exist
And I follow "Announcements"
@ -28,7 +27,7 @@ Feature: Managers can create courses
And "Subscription mode > Forced subscription" "text" should exist in current page administration
And I log out
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And "Add a new topic" "button" should not exist
And "Forced subscription" "text" should exist in current page administration

View file

@ -24,7 +24,7 @@ Feature: Tagging courses
| teacher1 | c2 | editingteacher |
| teacher2 | c2 | teacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Tags | Mathematics |
@ -33,15 +33,14 @@ Feature: Tagging courses
Scenario: Set course tags using the course edit form
When I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element"
And I set the following fields to these values:
| Tags | Algebra |
And I press "Save and display"
And I am on homepage
And I am on course page "Course 2"
And I am on "Course 2" course homepage
And I navigate to "Edit settings" node in "Course administration"
And I set the following fields to these values:
| Tags | Mathematics, Geometry |
@ -71,14 +70,13 @@ Feature: Tagging courses
| moodle/course:tag | Allow |
And I log out
When I log in as "teacher2"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Course tags" in current page administration
Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element"
And I set the following fields to these values:
| Tags | Algebra |
And I press "Save changes"
And I am on homepage
And I am on course page "Course 2"
And I am on "Course 2" course homepage
And I navigate to "Course tags" in current page administration
And I set the following fields to these values:
| Tags | Mathematics, Geometry |

View file

@ -16,7 +16,7 @@ Feature: Edit course settings
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Course full name | Edited course fullname |
@ -32,7 +32,7 @@ Feature: Edit course settings
And the field "Course full name" matches value "Edited course fullname"
And the field "Course short name" matches value "Edited course shortname"
And the field "Course summary" matches value "Edited course summary"
And I am on homepage
And I am on site homepage
And I should see "Edited course fullname"
Scenario: Edit course settings and return to the management interface

View file

@ -15,8 +15,7 @@ Feature: Force group mode in a course
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Chat" to section "1" and I fill the form with:
| Name of this chat room | Chat room |
| Description | Chat description |

View file

@ -15,8 +15,7 @@ Feature: Activities can be moved between sections
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I follow "Delete Recent activity block"
And I press "Yes"

View file

@ -15,8 +15,7 @@ Feature: Sections can be moved
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
Scenario: Move up and down a section with Javascript disabled in a single page course
Given I add a "Forum" to section "1" and I fill the form with:

View file

@ -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 am on course page "Course 1"
And I follow "Course 1"
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 am on course page "Course 1"
And I follow "Course 1"
And I press "Continue"
Then I should see "Edit profile" in the ".breadcrumb-nav" "css_element"

View file

@ -10,8 +10,7 @@ Feature: Course paged mode
| fullname | shortname | category | format | coursedisplay | numsections |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I am on "Course 1" course homepage
Then I click on <section2> "link" in the <section2> "section"
And I follow "C1"
And I click on <section3> "link" in the <section3> "section"
@ -44,8 +43,7 @@ Feature: Course paged mode
| fullname | shortname | category | format | coursedisplay | numsections |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I am on "Course 1" course homepage
Then I click on <section2> "link" in the <section2> "section"
And I follow "C1"
And I click on <section3> "link" in the <section3> "section"

View file

@ -20,7 +20,7 @@ Feature: Rename roles within a course
| teacher2 | C1 | teacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Your word for 'Non-editing teacher' | Tutor |
@ -33,7 +33,7 @@ Feature: Rename roles within a course
And the "roleid" select box should contain "Tutor"
And the "roleid" select box should contain "Learner"
And the "roleid" select box should not contain "Student"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Your word for 'Non-editing teacher' | |

View file

@ -18,8 +18,7 @@ Feature: Restrict activities availability
@javascript
Scenario: Activities can be added with the default permissions
Given I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
When I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
@ -33,14 +32,12 @@ Feature: Restrict activities availability
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
| mod/chat:addinstance | Prohibit |
And I am on site homepage
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Users > Permissions" in current page administration
And I override the system permissions of "Teacher" role with:
| mod/glossary:addinstance | Prohibit |
And I log out
And I log in as "teacher1"
And I am on course page "Course 1"
When I turn editing mode on
When I am on "Course 1" course homepage with editing mode on
Then the "Add an activity to section 'Topic 1'" select box should not contain "Chat"
Then the "Add an activity to section 'Topic 1'" select box should not contain "Glossary"

View file

@ -19,7 +19,7 @@ Feature: Rename roles in a course
Scenario: Teacher can rename roles
Given I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I should see "Role renaming"
When I set the following fields to these values:
@ -37,7 +37,7 @@ Feature: Rename roles in a course
| moodle/course:renameroles | Inherit |
And I follow "Log out"
When I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
Then I should not see "Role renaming"
And I should not see "Your word for 'Teacher'"

View file

@ -18,14 +18,13 @@ Feature: Topic's course sections highlighting
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
When I turn section "1" highlighting on
Then section "1" should be highlighted
And I turn section "2" highlighting on
And section "2" should be highlighted
And section "1" should not be highlighted
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And section "2" should be highlighted
And section "1" should not be highlighted
And I turn section "2" highlighting off
@ -33,11 +32,11 @@ Feature: Topic's course sections highlighting
And section "2" should not be highlighted
And I reload the page
And section "2" should not be highlighted
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And section "2" should not be highlighted
And I log out
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And section "1" should not be highlighted
And section "2" should not be highlighted

View file

@ -18,8 +18,7 @@ Feature: Show/hide course sections
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test hidden forum 11 name |
| Description | Test hidden forum 11 description |
@ -44,7 +43,7 @@ Feature: Show/hide course sections
| Forum name | Test hidden forum 32 name |
| Description | Test hidden forum 32 description |
| Visible | Show |
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I hide section "1"
Then section "1" should be hidden
And section "2" should be visible
@ -65,7 +64,7 @@ Feature: Show/hide course sections
And all activities in section "1" should be hidden
And I log out
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And section "1" should be hidden
And all activities in section "1" should be hidden
And section "2" should be visible

View file

@ -15,8 +15,7 @@ Feature: View subfolders in a course in-line
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on course page "Course 1"
And I turn editing mode on
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "3" and I fill the form with:
| Name | Test folder |
| Display folder contents | On a separate page |
@ -30,7 +29,7 @@ Feature: View subfolders in a course in-line
@javascript
Scenario: Add a folder with two subfolders - view on separate page
Given I am on course page "Course 1"
Given I am on "Course 1" course homepage
And I should not see "Test subfolder 1"
And I follow "Test folder"
And I should see "Test subfolder 1"
@ -39,7 +38,7 @@ Feature: View subfolders in a course in-line
And I set the field "New folder name" to "Test subfolder 2"
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
And I press "Save changes"
When I am on course page "Course 1"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I follow "Test folder"
And I should see "Test subfolder 2"