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

@ -19,7 +19,7 @@ Feature: Atto Autosave
And I set the field "Autosave frequency" to "3"
And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds"
And I click on "Save changes" "button"
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 set the field with xpath "//select[@name='summary_editor[format]']" to "1"
And I click on "Save and display" "button"
@ -28,14 +28,14 @@ Feature: Atto Autosave
@javascript
Scenario: Restore a draft
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" node in "Course administration"
And I set the field "Course summary" to "This is my draft"
# Wait for the autosave
And I wait "5" seconds
And I 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" node in "Course administration"
# Wait for the autorestore
And I wait "2" seconds
@ -44,7 +44,7 @@ Feature: Atto Autosave
@javascript
Scenario: Do not restore a draft if files have been modified
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" node in "Course administration"
And I set the field "Course summary" to "This is my draft"
# Wait for the autosave
@ -54,7 +54,7 @@ Feature: Atto Autosave
And I follow "Manage private files..."
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
And I click on "Save changes" "button"
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 set the field "Course summary" to "<p>Image test</p>"
And I select the text in the "Course summary" Atto editor
@ -70,27 +70,27 @@ Feature: Atto Autosave
And I click on "Save and display" "button"
And I 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" node in "Course administration"
Then I should not see "This is my draft"
@javascript
Scenario: Do not restore a draft if text has been modified
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" node in "Course administration"
And I set the field "Course summary" to "This is my draft"
# Wait for the autosave
And I wait "5" seconds
And I log out
And 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 "Edit settings" node in "Course administration"
And I set the field "Course summary" to "Modified text"
And I click on "Save and display" "button"
And I 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" node in "Course administration"
Then I should not see "This is my draft"
And I should see "Modified text"

View file

@ -13,7 +13,7 @@ Feature: Atto editor with customised toolbar
| activity | name | intro | course | idnumber |
| label | L1 | <a href="../lib/editor/atto/tests/fixtures/custom_toolbar_example.php">FixtureLink</a> | C1 | label1 |
When I log in as "admin"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "FixtureLink"
@javascript

View file

@ -18,8 +18,7 @@ Feature: Add or remove items from the TinyMCE editor toolbar
Scenario: Remove icons
When the following config values are set as admin:
| customtoolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen | editor_tinymce |
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 "Database" to section "1"
Then "#id_introeditor_tbl .mce_bold" "css_element" should not exist
And "#id_introeditor_tbl .mce_fullscreen" "css_element" should exist
@ -28,21 +27,19 @@ Feature: Add or remove items from the TinyMCE editor toolbar
Scenario: Add icons
When the following config values are set as admin:
| customtoolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen,anchor | editor_tinymce |
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 "Database" to section "1"
Then "#id_introeditor_tbl .mce_bold" "css_element" should not exist
And "#id_introeditor_tbl .mce_anchor" "css_element" should exist
And the following config values are set as admin:
| customtoolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen | editor_tinymce |
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add a "Database" to section "1"
And "#id_introeditor_tbl .mce_anchor" "css_element" should not exist
And I press "Cancel"
Scenario: Default icons
Given I am on course page "Course 1"
And I turn editing mode on
Given I am on "Course 1" course homepage with editing mode on
When I add a "Database" to section "1"
And I wait until "#id_introeditor_tbl" "css_element" exists
Then "#id_introeditor_tbl .mce_bold" "css_element" should exist

View file

@ -32,8 +32,7 @@ Feature: Using the activity grade form element
And I press "Save changes"
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 a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
@ -80,8 +79,7 @@ Feature: Using the activity grade form element
And I press "Save changes"
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 a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
@ -92,7 +90,7 @@ Feature: Using the activity grade form element
| Group mode | No groups |
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 "Test forum name"
And I press "Add a new discussion topic"
And I set the following fields to these values:
@ -101,7 +99,7 @@ Feature: Using the activity grade form element
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I follow "Discussion subject"
And I set the field "rating" to "D"
@ -134,14 +132,13 @@ Feature: Using the activity grade form element
And I press "Save changes"
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 a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | ABCDEF |
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
@ -160,8 +157,7 @@ Feature: Using the activity grade form element
Scenario: Attempting to change the maximum grade when ratings exist
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
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
@ -172,7 +168,7 @@ Feature: Using the activity grade form element
| Group mode | No groups |
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 "Test forum name"
And I press "Add a new discussion topic"
And I set the following fields to these values:
@ -181,7 +177,7 @@ Feature: Using the activity grade form element
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I follow "Discussion subject"
And I set the field "rating" to "100"
@ -197,12 +193,11 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
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
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"

View file

@ -13,7 +13,7 @@ Feature: Forms with a multi select field dependency
| activity | name | intro | course | idnumber |
| label | L1 | <a href="../lib/form/tests/fixtures/multi_select_dependencies.php">FixtureLink</a> | C1 | label1 |
And I log in as "admin"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I follow "FixtureLink"
Then the "Enter your name" "field" should be disabled
And I set the field "Choose one or more directions" to "South,West"

View file

@ -13,8 +13,7 @@ Feature: Forms with a large number of fields
| activity | name | intro | course | idnumber |
| label | L1 | <a href="../lib/tests/fixtures/max_input_vars.php">FixtureLink</a> | C1 | label1 |
When 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
And I follow "FixtureLink"
# Note: These tests do not actually use JavaScript but they don't work with