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

@ -21,7 +21,7 @@ Feature: Users can add entries to database activities
| activity | name | intro | course | idnumber |
| data | Test database name | n | C1 | data1 |
And I log in as "teacher1"
And I am on course page "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 |
| Field description | Test field description |
@ -33,7 +33,7 @@ Feature: Users can add entries to database activities
And I wait until the page is ready
And I log out
When I log in as "student1"
And I am on course page "Course 1"
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 |
| Test field 2 name | Student original entry 2 |
@ -70,7 +70,7 @@ Feature: Users can add entries to database activities
# Now I will bulk delete the rest of the entries.
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 database name"
And I press "Select all"
And I press "Delete selected"

View file

@ -17,8 +17,7 @@ Feature: Users can edit approved entries in database activities
| 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
@javascript
Scenario: Students can manage their approved entries to a database
@ -37,20 +36,20 @@ Feature: Users can edit approved entries in database activities
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a 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 follow "Test database name"
And I follow "Approve"
And I log out
# Make sure the student can still edit their entry after it's approved.
When 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 database name"
Then I should see "Student entry"
And "Edit" "link" should exist
@ -72,20 +71,20 @@ Feature: Users can edit approved entries in database activities
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a 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 follow "Test database name"
And I follow "Approve"
And I log out
# Make sure the student isn't able to edit their entry after it's approved.
When 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 database name"
Then I should see "Student entry"
And "Edit" "link" should not exist

View file

@ -20,7 +20,7 @@ Feature: Users can be required to specify certain fields when adding entries to
| activity | name | intro | course | idnumber |
| data | Test database name | n | C1 | data1 |
And I log in as "teacher1"
And I am on course page "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 | Base Text input |
| Required | yes |
@ -125,7 +125,7 @@ Feature: Users can be required to specify certain fields when adding entries to
Scenario: Students receive errors for empty required fields but not for optional fields
When I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| Base Text input | Some input to allow us to submit the otherwise empty form |
And I press "Save and view"
@ -154,7 +154,7 @@ Feature: Users can be required to specify certain fields when adding entries to
Scenario: Students recieve no error for filled in required fields
When I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| Base Text input | Some input to allow us to submit the otherwise empty form |
| Required Checkbox Option 1 | 1 |
@ -176,7 +176,7 @@ Feature: Users can be required to specify certain fields when adding entries to
Scenario: Fields refill with data after having an error
When I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
And I add an entry to "Test database name" database with:
| RTOC Option 1 | 1 |
| Latitude | 0 |
@ -205,7 +205,7 @@ Feature: Users can be required to specify certain fields when adding entries to
Scenario: A student fills in Latitude but not Longitude will see an error
Given I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I add an entry to "Test database name" database with:
| Base Text input | Some input to allow us to submit the otherwise empty form |
| Required Checkbox Option 1 | 1 |
@ -226,7 +226,7 @@ Feature: Users can be required to specify certain fields when adding entries to
Scenario: A student filling in number and text fields with zero will not see an error.
Given I log in as "student1"
And I am on course page "Course 1"
And I am on "Course 1" course homepage
When I add an entry to "Test database name" database with:
| Base Text input | Some input to allow us to submit the otherwise empty form |
| Required Checkbox Option 1 | 1 |

View file

@ -20,7 +20,7 @@ Feature: Users can view and search database entries
| activity | name | intro | course | idnumber |
| data | Test database name | n | C1 | data1 |
And I log in as "teacher1"
And I am on course page "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 |
| Field description | Test field description |
@ -37,7 +37,7 @@ Feature: Users can view and search database entries
And I press "Save and view"
And I log out
When 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 database name"
Then I should see "Teacher entry 1"
And I should see "Teacher entry 2"