Commit cf1cf222 authored by ilya's avatar ilya
Browse files

MDL-66431 core: Fix behat tests.

Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
parent 430746d3
......@@ -16,20 +16,28 @@ Feature: Set time spent as a completion condition for a lesson
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson |
| intro | Test lesson description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
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:
| Enable completion tracking | Yes |
And I press "Save and display"
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson |
| Description | Test lesson description |
And I follow "Test lesson"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 0 |
| completiontimespentenabled | 1 |
| completiontimespent[timeunit] | 1 |
| completiontimespent[number] | 10 |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -20,18 +20,20 @@ Feature: A teacher can set available from and deadline dates to access a lesson
And I am on "Course 1" course homepage with editing mode on
Scenario: Forbidding lesson accesses until a specified date
Given I add a "Lesson" to section "1"
And I expand all fieldsets
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test lesson | Test lesson description | C1 | 1 | lesson1 |
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I navigate to "Edit settings" in current page administration
And I set the field "id_available_enabled" to "1"
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| available[day] | 1 |
| available[month] | January |
| available[year] | 2030 |
| available[hour] | 08 |
| available[minute] | 00 |
And I press "Save and display"
And I press "Save and return to course"
And I follow "Test lesson"
And I follow "Add a content page"
And I set the following fields to these values:
......@@ -47,17 +49,20 @@ Feature: A teacher can set available from and deadline dates to access a lesson
And I should not see "First page contents"
Scenario: Forbidding lesson accesses until a specified date
Given I add a "Lesson" to section "1"
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test lesson | Test lesson description | C1 | 1 | lesson1 |
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I navigate to "Edit settings" in current page administration
And I set the field "id_deadline_enabled" to "1"
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| deadline[day] | 1 |
| deadline[month] | January |
| deadline[year] | 2000 |
| deadline[hour] | 08 |
| deadline[minute] | 00 |
And I press "Save and display"
And I press "Save and return to course"
And I follow "Test lesson"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -14,13 +14,14 @@ Feature: Display the lesson description in the lesson and optionally in the cour
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Given the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| section | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
And I click on "Save and display" "button"
Scenario: Description is displayed in the Lesson
Given I am on "Course 1" course homepage
......
......@@ -15,14 +15,11 @@ Feature: Teachers can review student progress on all lessons in a course by view
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | retake |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| Re-takes allowed | Yes |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Scenario: View student progress for lesson that was never attempted
......
......@@ -17,11 +17,11 @@ branch table contents
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -16,11 +16,11 @@ Feature: In a lesson activity, teacher can edit a cluster page
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| lesson | Lesson with cluster | Test lesson description | C1 | lesson1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Lesson with cluster |
| Description | Test lesson description |
And I follow "Lesson with cluster"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -16,11 +16,11 @@ Feature: In a lesson activity, teacher can edit lesson's pages
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -15,12 +15,11 @@ Feature: In a lesson activity, teacher can add an essay question
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | feedback |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
| Use default feedback | Yes |
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the field "Select a question type" to "Essay"
......
......@@ -15,11 +15,11 @@ Feature: In a lesson activity, students can exit and re-enter the activity when
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Lesson with cluster | Cluster lesson description | C1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Lesson with cluster |
| Description | Cluster lesson description |
And I follow "Lesson with cluster"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -14,12 +14,16 @@ Feature: In a lesson activity, if custom scoring is not enabled, student should
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Custom scoring | No |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -17,12 +17,12 @@ Feature: In a lesson activity, students can navigate through a series of pages i
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Student navigation with pages and questions
Given I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......@@ -88,11 +88,16 @@ Feature: In a lesson activity, students can navigate through a series of pages i
And I should see "Your score is 0 (out of 1)."
Scenario: Student reattempts a question until out of attempts
Given I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_review | Yes |
| id_maxattempts | 3 |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the following fields to these values:
......@@ -129,11 +134,16 @@ Feature: In a lesson activity, students can navigate through a series of pages i
And I should see "Congratulations - end of lesson reached"
Scenario: Student should not see remaining attempts notification if maximum number of attempts is set to unlimited
Given I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_review | Yes |
| id_maxattempts | 0 |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the following fields to these values:
......
......@@ -14,6 +14,13 @@ Feature: Lesson with no calendar capabilites
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Given the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| section | 1 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Users > Permissions" in current page administration
......@@ -25,9 +32,9 @@ Feature: Lesson with no calendar capabilites
Scenario: Editing a lesson
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_available_enabled | 1 |
| id_available_day | 1 |
| id_available_month | 1 |
......@@ -36,6 +43,7 @@ Feature: Lesson with no calendar capabilites
| id_deadline_day | 1 |
| id_deadline_month | 2 |
| id_deadline_year | 2017 |
And I press "Save and return to course"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
......
......@@ -19,21 +19,27 @@ Feature: In Dashboard, teacher can see the number of student attempts to lessons
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: number of student attempts
Given I add a "Lesson" to section "1"
Given the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| retake | 1 |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
When I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| id_deadline_enabled | 1 |
| deadline[day] | 1 |
| deadline[month] | January |
| deadline[year] | 2030 |
| deadline[hour] | 08 |
| deadline[minute] | 00 |
| Re-takes allowed | Yes |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a question page"
......
......@@ -16,12 +16,11 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac
And the following "language customisations" exist:
| component | stringid | value |
| core_langconfig | decsep | # |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | modattempts |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
| Allow student review | Yes |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the field "Select a question type" to "Numerical"
......
......@@ -15,14 +15,15 @@ Feature: Teachers can review student progress on all lessons in a course by view
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| retake | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| Re-takes allowed | Yes |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Scenario: View student progress for lesson that was never attempted
......
......@@ -16,12 +16,15 @@ Feature: Practice mode in a lesson activity
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Lesson description |
| section | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Setup a basic lesson, we'll adjust it in the scenarios later.
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Lesson description |
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
......
......@@ -16,12 +16,16 @@ Feature: In a lesson activity, students can see their progress viewing a progres
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Progress bar | Yes |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......@@ -39,7 +43,7 @@ Feature: In a lesson activity, students can see their progress viewing a progres
| id_answer_editor_1 | Next page |
| id_jumpto_1 | Next page |
And I press "Save page"
And I follow "Expanded"
And I click on "Expanded" "link" in the "region-main" "region"
And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element"
And I set the field "Select a question type" to "Numerical"
And I press "Add a question page"
......
......@@ -15,15 +15,17 @@ Feature: In a lesson activity, students can not re-attempt a question more than
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| retake | 1 |
| minquestions | 3 |
| section | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| Re-takes allowed | Yes |
| Minimum number of questions | 3 |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a content page"
And I set the following fields to these values:
......
......@@ -16,14 +16,11 @@ Feature: In a lesson activity, teachers can review student attempts
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber | retake |
| lesson | Test lesson name | Test | C1 | 1 | lesson1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| Re-takes allowed | Yes |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Scenario: View student attempts in a lesson containing both content and question pages
......
......@@ -16,11 +16,14 @@ Feature: In a lesson activity, students can review the answers they gave to ques
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Display ongoing score | Yes |
| Slideshow | Yes |
| Maximum number of answers | 10 |
......@@ -28,6 +31,7 @@ Feature: In a lesson activity, students can review the answers they gave to ques
| Maximum number of attempts | 3 |
| Custom scoring | No |
| Re-takes allowed | Yes |
And I press "Save and return to course"
And I follow "Test lesson name"
And I follow "Add a question page"
And I set the field "Select a question type" to "Numerical"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment