diff --git a/blocks/tests/behat/add_blocks.feature b/blocks/tests/behat/add_blocks.feature index 7ee5644c176..47caaaaeac8 100644 --- a/blocks/tests/behat/add_blocks.feature +++ b/blocks/tests/behat/add_blocks.feature @@ -4,8 +4,7 @@ Feature: Add blocks As a teacher I need to add blocks to pages - @javascript - Scenario: Add a block to a course + Background: Given the following "users" exists: | username | firstname | lastname | email | | student1 | Student | 1 | student1@asd.com | @@ -21,4 +20,9 @@ Feature: Add blocks And I follow "Course 1" And I turn editing mode on When I add the "Blog menu" block - Then I should see "View all of my entries" + Then I should see "View my entries about this course" + + @javascript + Scenario: Add a block to a course with Javascript enabled + + Scenario: Add a block to a course with Javascript disabled diff --git a/course/tests/behat/add_activities.feature b/course/tests/behat/add_activities.feature index 1c77c4488c7..932bca0d259 100644 --- a/course/tests/behat/add_activities.feature +++ b/course/tests/behat/add_activities.feature @@ -4,8 +4,7 @@ Feature: Add activities to courses As a teacher I need to add activites to a course - @javascript - Scenario: Add an activity to the course + Background: Given the following "users" exists: | username | firstname | lastname | email | | student1 | Student | 1 | student1@asd.com | @@ -19,8 +18,11 @@ Feature: Add activities to courses | student2 | C1 | student | And I log in as "admin" And I follow "Course 1" - When I turn editing mode on - And I add a "Database" to section "3" and I fill the form with: + And I turn editing mode on + + @javascript + Scenario: Add an activity to a course + When I add a "Database" to section "3" and I fill the form with: | Name | Test name | | Description | Test database description | | Required entries | 9 | @@ -35,21 +37,29 @@ Feature: Add activities to courses @javascript Scenario: Add an activity without the required fields - Given the following "users" exists: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@asd.com | - | student2 | Student | 2 | student2@asd.com | - And the following "courses" exists: - | fullname | shortname | format | - | Course 1 | C1 | topics | - And the following "course enrolments" exists: - | user | course | role | - | student1 | C1 | student | - | student2 | C1 | student | - And I log in as "admin" - And I follow "Course 1" - When I turn editing mode on - And I add a "Database" to section "3" and I fill the form with: + When I add a "Database" to section "3" and I fill the form with: | Name | Test name | Then I should see "Adding a new" And I should see "Required" + + Scenario: Add an activity to a course with Javascript disabled + Then I should see "Add a resource to section 'Topic 1'" + And I should see "Add an activity to section 'Topic 1'" + And I should see "Add a resource to section 'Topic 2'" + And I should see "Add an activity to section 'Topic 2'" + And I should see "Add a resource to section 'Topic 3'" + And I should see "Add an activity to section 'Topic 3'" + And I add a "Label" to section "2" + And I should see "Adding a new Label to Topic 2" + And I fill the moodle form with: + | Label text | I'm a label | + And I press "Save and return to course" + And I add a "Database" to section "3" + And I should see "Adding a new Database to Topic 3" + And I fill the moodle form with: + | Name | Test database name | + | Description | Test database description | + And I press "Save and return to course" + And I should not see "Adding a new" + And I should see "Test database name" + And I should see "I'm a label"