Skip to content

Instantly share code, notes, and snippets.

@luukverhoeven
Created September 4, 2024 20:10
Show Gist options
  • Save luukverhoeven/84246e2616f92c1ac1bfcfb39de67d1e to your computer and use it in GitHub Desktop.
Save luukverhoeven/84246e2616f92c1ac1bfcfb39de67d1e to your computer and use it in GitHub Desktop.
Moodle 403 BEHAT all .features combined
This file has been truncated, but you can view the full file.
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_recent/tests/behat/block_blog_recent_course.feature
@block @block_blog_menu @block_blog_recent
Feature: Students can use the recent blog entries block to view recent entries on a course page
In order to enable the recent blog entries block a course page
As a teacher
I can add the recent blog entries block to a course page
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
Scenario: Students use the recent blog entries block to view blogs
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
When I set the following fields to these values:
| Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog ENGLISH"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I should see "S1 First Blog ENGLISH"
And I follow "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students only see a few entries in the recent blog entries block
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
# Blog 1 of 5
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
# Blog 2 of 5
And I set the following fields to these values:
| Entry title | S1 Second Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Second Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
# Blog 3 of 5
And I set the following fields to these values:
| Entry title | S1 Third Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Third Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
# Blog 4 of 5
And I set the following fields to these values:
| Entry title | S1 Fourth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Fourth Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
# Blog 5 of 5
And I set the following fields to these values:
| Entry title | S1 Fifth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I should see "S1 Fifth Blog"
And I should see "This is my awesome blog!"
When I am on "Course 1" course homepage
And I should not see "S1 First Blog"
And I should see "S1 Second Blog"
And I should see "S1 Third Blog"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
And I follow "S1 Fifth Blog"
And I should see "This is my awesome blog!"
Then I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I configure the "Recent blog entries" block
And I set the following fields to these values:
| config_numberofrecentblogentries | 2 |
And I press "Save changes"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature
@block @block_blog_recent
Feature: Feature: Students can use the recent blog entries block to view recent entries on the frontpage
In order to enable the recent blog entries block on the frontpage
As an admin
I can add the recent blog entries block to the frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_recent | System | 1 | site-index | side-pre |
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I log out
Scenario: Students use the recent blog entries block to view blogs
Given I log in as "student1"
And I am on site homepage
And I click on "Site blogs" "link" in the "Navigation" "block"
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on site homepage
And I should see "S1 First Blog"
And I follow "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students only see a few entries in the recent blog entries block
Given I log in as "student1"
And I am on site homepage
And I click on "Site blogs" "link" in the "Navigation" "block"
And I follow "Add a new entry"
# Blog 1 of 5
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I follow "Add a new entry"
# Blog 2 of 5
And I set the following fields to these values:
| Entry title | S1 Second Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Second Blog"
And I should see "This is my awesome blog!"
And I follow "Add a new entry"
# Blog 3 of 5
And I set the following fields to these values:
| Entry title | S1 Third Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Third Blog"
And I should see "This is my awesome blog!"
And I follow "Add a new entry"
# Blog 4 of 5
And I set the following fields to these values:
| Entry title | S1 Fourth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Fourth Blog"
And I should see "This is my awesome blog!"
And I follow "Add a new entry"
# Blog 5 of 5
And I set the following fields to these values:
| Entry title | S1 Fifth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I should see "S1 Fifth Blog"
And I should see "This is my awesome blog!"
When I am on site homepage
And I should not see "S1 First Blog"
And I should see "S1 Second Blog"
And I should see "S1 Third Blog"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
And I follow "S1 Fifth Blog"
And I should see "This is my awesome blog!"
Then I log out
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I configure the "Recent blog entries" block
And I set the following fields to these values:
| config_numberofrecentblogentries | 2 |
And I press "Save changes"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_recent/tests/behat/block_blog_recent_activity.feature
@block @block_blog_menu @mod_assign @block_blog_recent
Feature: Students can use the recent blog entries block to view recent entries on an activity page
In order to enable the recent blog entries block an activity page
As a teacher
I can add the recent blog entries block to an activity page
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment 1 |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
| blog_recent | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the recent blog entries block to view blogs
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I follow "Test assignment 1"
And I should see "S1 First Blog"
And I follow "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students only see a few entries in the recent blog entries block
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
# Blog 1 of 5
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I follow "Test assignment 1"
And I follow "Add an entry about this Assignment"
# Blog 2 of 5
And I set the following fields to these values:
| Entry title | S1 Second Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Second Blog"
And I should see "This is my awesome blog!"
And I follow "Test assignment 1"
And I follow "Add an entry about this Assignment"
# Blog 3 of 5
And I set the following fields to these values:
| Entry title | S1 Third Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Third Blog"
And I should see "This is my awesome blog!"
And I follow "Test assignment 1"
And I follow "Add an entry about this Assignment"
# Blog 4 of 5
And I set the following fields to these values:
| Entry title | S1 Fourth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I wait "1" seconds
And I should see "S1 Fourth Blog"
And I should see "This is my awesome blog!"
And I follow "Test assignment 1"
And I follow "Add an entry about this Assignment"
# Blog 5 of 5
And I set the following fields to these values:
| Entry title | S1 Fifth Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
And I should see "S1 Fifth Blog"
And I should see "This is my awesome blog!"
When I follow "Test assignment 1"
And I should not see "S1 First Blog"
And I should see "S1 Second Blog"
And I should see "S1 Third Blog"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
And I follow "S1 Fifth Blog"
And I should see "This is my awesome blog!"
Then I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment 1"
And I configure the "Recent blog entries" block
And I set the following fields to these values:
| config_numberofrecentblogentries | 2 |
And I press "Save changes"
And I should see "S1 Fourth Blog"
And I should see "S1 Fifth Blog"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_recent/tests/behat/block_blog_recent.feature
@block @block_blog_recent
Feature: Feature: Users can use the recent blog entries block to view recent blog entries.
In order to enable the recent blog entries in a course
As a teacher
I can add recent blog entries block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Add the recent blogs block to a course when blogs are disabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Recent blog entries" block
And the following config values are set as admin:
| enableblogs | 0 |
And I reload the page
Then I should see "Blogging is disabled!" in the "Recent blog entries" "block"
Scenario: Add the recent blogs block to a course when there are not any blog posts
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Recent blog entries" block
Then I should see "No recent entries" in the "Recent blog entries" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/recent_activity/tests/behat/structural_changes.feature
@block @block_recent_activity
Feature: View structural changes in recent activity block
In order to know when activities were changed
As a user
In need to see the structural changes in recent activity block
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | [email protected] |
| assistant1 | Terry2 | Teacher2 | [email protected] |
| student1 | Sam1 | Student1 | [email protected] |
| student2 | Sam2 | Student2 | [email protected] |
| student3 | Sam3 | Student3 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| assistant1 | C1 | teacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
And the following "groupings" exist:
| name | course | idnumber |
| Grouping 1 | C1 | GG1 |
| Grouping 2 | C1 | GG2 |
| Grouping 3 | C1 | GG3 |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G2 |
| student3 | G1 |
| student3 | G2 |
| assistant1 | G1 |
And the following "grouping groups" exist:
| grouping | group |
| GG1 | G1 |
| GG2 | G2 |
| GG3 | G1 |
| GG3 | G2 |
Scenario: Check that Added module information is displayed respecting view capability
Given the following "activities" exist:
| activity | course | name | idnumber | groupmode | grouping | visible |
| forum | C1 | ForumVisibleGroups | forum1 | 2 | | 1 |
| forum | C1 | ForumSeparateGroups | forum2 | 1 | | 1 |
| forum | C1 | ForumHidden | forum3 | 1 | | 0 |
| forum | C1 | ForumNoGroups | forum4 | 0 | | 1 |
| forum | C1 | ForumVisibleGroupsG1 | forum5 | 2 | GG1 | 1 |
| forum | C1 | ForumSeparateGroupsG1 | forum6 | 1 | GG1 | 1 |
| forum | C1 | ForumVisibleGroupsG2 | forum7 | 2 | GG2 | 1 |
| forum | C1 | ForumSeparateGroupsG2 | forum8 | 1 | GG2 | 1 |
And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I press "Save and return to course"
And I am on the "ForumSeparateGroupsG1" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I press "Save and return to course"
And I am on the "ForumVisibleGroupsG2" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
And I am on the "ForumSeparateGroupsG2" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
And I am on "Course 1" course homepage with editing mode on
When I add the "Recent activity" block
Then I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
And I should see "ForumHidden" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
And I should not see "ForumHidden" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I am on the "Course 1" course page logged in as student2
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
And I should not see "ForumHidden" in the "Recent activity" "block"
And I should not see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I am on the "Course 1" course page logged in as student3
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
And I should not see "ForumHidden" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
# Teachers have capability to see all groups and hidden activities
And I am on the "Course 1" course page logged in as assistant1
And I should see "ForumHidden" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
Scenario: Updates and deletes in recent activity block
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | forum1 |
| name | ForumNew |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
Then I should see "Added Forum" in the "Recent activity" "block"
And I should see "ForumNew" in the "Recent activity" "block"
And I log out
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
And I am on the "Course 1" course page logged in as student1
And I should see "Added Forum" in the "Recent activity" "block"
And I should see "ForumNew" in the "Recent activity" "block"
And I log out
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
# Update forum as a teacher
And I am on the "ForumNew" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| name | ForumUpdated |
And I press "Save and return to course"
And I log out
And I wait "1" seconds
# Student 1 already saw that forum was created, now he can see that forum was updated
And I am on the "Course 1" course page logged in as student1
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should see "Updated Forum" in the "Recent activity" "block"
And I should see "ForumUpdated" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Student 2 has bigger interval and he can see one entry that forum was created but with the new name
And I am on the "Course 1" course page logged in as student2
And I should see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
And I should see "ForumUpdated" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Delete forum as a teacher
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I delete "ForumUpdated" activity
And I run all adhoc tasks
And I log out
And I wait "1" seconds
# Students 1 and 2 see that forum was deleted
And I am on the "Course 1" course page logged in as student1
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
And I should not see "ForumUpdated" in the "Recent activity" "block"
And I should see "Deleted Forum" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Student 3 never knew that forum was created, so he does not see anything
And I am on the "Course 1" course page logged in as student3
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
And I should not see "ForumUpdated" in the "Recent activity" "block"
And I should not see "Deleted Forum" in the "Recent activity" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/news_items/tests/behat/display_news.feature
@block @block_news_items
Feature: Latest announcements block displays the course latest news
In order to be aware of the course announcements
As a user
I need to see the latest announcements block in the main course page
@javascript
Scenario: Latest course announcements are displayed and can be configured
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category | newsitems |
| Course 1 | C1 | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| teacher1 | Announcements | Discussion One | Not important |
| teacher1 | Announcements | Discussion Two | Not important |
| teacher1 | Announcements | Discussion Three | Not important |
When I am on the "Course 1" Course page logged in as teacher1
Then I should see "Discussion One" in the "Latest announcements" "block"
And I should see "Discussion Two" in the "Latest announcements" "block"
And I should see "Discussion Three" in the "Latest announcements" "block"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Number of announcements | 2 |
And I press "Save and display"
And I should not see "Discussion One" in the "Latest announcements" "block"
And I should see "Discussion Two" in the "Latest announcements" "block"
And I should see "Discussion Three" in the "Latest announcements" "block"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Number of announcements | 0 |
And I press "Save and display"
And "Latest announcements" "block" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/comments/tests/behat/add_comment.feature
@block @block_comments
Feature: Add a comment to the comments block
In order to comment on a conversation or a topic
As a user
In need to add comments to courses
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
| student1 | Student | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as student1
@javascript
Scenario: Add a comment with Javascript enabled
When I add "I'm a comment from student1" comment to comments block
Then I should see "I'm a comment from student1"
And I am on the "Course 1" course page logged in as teacher1
And I should see "I'm a comment from student1"
Scenario: Add a comment with Javascript disabled
When I follow "Show comments"
And I add "I'm a comment from student1" comment to comments block
Then I should see "I'm a comment from student1"
And I am on the "Course 1" course page logged in as teacher1
And I follow "Show comments"
And I should see "I'm a comment from student1"
@javascript
Scenario: Test comment block pagination
When I add "Super test comment 01" comment to comments block
And I change window size to "1024x4096"
And I add "Super test comment 02" comment to comments block
And I add "Super test comment 03" comment to comments block
And I add "Super test comment 04" comment to comments block
And I add "Super test comment 05" comment to comments block
And I add "Super test comment 06" comment to comments block
And I add "Super test comment 07" comment to comments block
And I add "Super test comment 08" comment to comments block
And I add "Super test comment 09" comment to comments block
And I add "Super test comment 10" comment to comments block
And I add "Super test comment 11" comment to comments block
And I add "Super test comment 12" comment to comments block
And I add "Super test comment 13" comment to comments block
And I add "Super test comment 14" comment to comments block
And I add "Super test comment 15" comment to comments block
And I add "Super test comment 16" comment to comments block
And I add "Super test comment 17" comment to comments block
And I add "Super test comment 18" comment to comments block
And I add "Super test comment 19" comment to comments block
And I add "Super test comment 20" comment to comments block
And I add "Super test comment 21" comment to comments block
And I add "Super test comment 22" comment to comments block
And I add "Super test comment 23" comment to comments block
And I add "Super test comment 24" comment to comments block
And I add "Super test comment 25" comment to comments block
And I add "Super test comment 26" comment to comments block
And I add "Super test comment 27" comment to comments block
And I add "Super test comment 28" comment to comments block
And I add "Super test comment 29" comment to comments block
And I add "Super test comment 30" comment to comments block
And I add "Super test comment 31" comment to comments block
Then I should see "Super test comment 01"
And I should see "Super test comment 31"
And I am on "Course 1" course homepage
And I should not see "Super test comment 01"
And I should not see "Super test comment 02"
And I should not see "Super test comment 16"
And I should see "Super test comment 17"
And I should see "Super test comment 31"
And I should see "1" in the ".block_comments .comment-paging" "css_element"
And I should see "2" in the ".block_comments .comment-paging" "css_element"
And I should see "3" in the ".block_comments .comment-paging" "css_element"
And I should not see "4" in the ".block_comments .comment-paging" "css_element"
And I click on "2" "link" in the ".block_comments .comment-paging" "css_element"
And I should not see "Super test comment 01"
And I should see "Super test comment 02"
And I should see "Super test comment 16"
And I should not see "Super test comment 17"
And I should not see "Super test comment 31"
And I click on "3" "link" in the ".block_comments .comment-paging" "css_element"
And I should see "Super test comment 01"
And I should not see "Super test comment 02"
And I should not see "Super test comment 16"
And I should not see "Super test comment 17"
And I should not see "Super test comment 31"
And I click on "1" "link" in the ".block_comments .comment-paging" "css_element"
And I should not see "Super test comment 01"
And I should not see "Super test comment 02"
And I should not see "Super test comment 16"
And I should see "Super test comment 17"
And I should see "Super test comment 31"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/comments/tests/behat/block_comment_frontpage.feature
@block @block_comments
Feature: Enable Block comments on the frontpage and view comments
In order to enable the comments block on the frontpage
As a admin
I can add the comments block to the frontpage
Scenario: Add the comments block on the frontpage and add comments
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I follow "Show comments"
And I add "I'm a comment from admin" comment to comments block
And I log out
When I log in as "teacher1"
And I am on site homepage
And I follow "Show comments"
Then I should see "I'm a comment from admin"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/comments/tests/behat/block_comment_activity.feature
@block @block_comments
Feature: Enable Block comments on an activity page and view comments
In order to enable the comments block on an activity page
As a teacher
I can add the comments block to an activity page
Scenario: Add the comments block on an activity page and add comments
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
| student1 | Student | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Activity module | page1 | mod-page-* | side-pre |
And I am on the "Test page name" "page activity" page logged in as teacher1
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
When I am on the "Test page name" "page activity" page logged in as student1
And I follow "Show comments"
Then I should see "I'm a comment from the teacher"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/comments/tests/behat/block_comment_dashboard.feature
@block @block_comments
Feature: Enable Block comments on the dashboard and view comments
In order to enable the comments block on a the dashboard
As a teacher
I can add the comments block to my dashboard
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
Scenario: Add the comments block on the dashboard and add comments with Javascript disabled
When I log in as "teacher1"
And I turn editing mode on
And I add the "Comments" block
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
Then I should see "I'm a comment from the teacher"
@javascript
Scenario: Add the comments block on the dashboard and add comments with Javascript enabled
When I log in as "teacher1"
And I turn editing mode on
And I add the "Comments" block
And I add "I'm a comment from the teacher" comment to comments block
Then I should see "I'm a comment from the teacher"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/comments/tests/behat/delete_comment.feature
@block @block_comments
Feature: Delete comment block messages
In order to refine comment block's contents
As a teacher
In need to delete comments from courses
@javascript
Scenario: Delete comments with Javascript enabled
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
| student1 | Student | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as student1
And I add "Comment from student1" comment to comments block
And I am on the "Course 1" course page logged in as teacher1
And I add "Comment from teacher1" comment to comments block
When I delete "Comment from student1" comment from comments block
Then I should not see "Comment from student1"
And I delete "Comment from teacher1" comment from comments block
And I should not see "Comment from teacher1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_list/tests/behat/block_course_list_frontpage.feature
@block @block_course_list
Feature: Enable the course_list block on the frontpage and view it's contents
In order to enable the course list block on the frontpage
As an admin
I can add the course list block to the frontpage
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
| Category B | 0 | CATB |
| Category C | CATB | CATC |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | CATA |
| Course 3 | C3 | CATB |
| Course 4 | C4 | CATC |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
Scenario: Add the course list block on the frontpage and navigate to the course listing
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Courses" block
And I log out
When I log in as "teacher1"
And I am on site homepage
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: Add the course list block on the frontpage page and navigate to another course
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Courses" block
And I log out
When I log in as "teacher1"
And I am on site homepage
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I am on "Course 3" course homepage
And I should see "Course 3"
Scenario: Add the course list block on the frontpage page and view as an admin
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
And I should see "Category B" in the "Course categories" "block"
And I should not see "Category C" in the "Course categories" "block"
And I should not see "Course 1" in the "Course categories" "block"
And I should not see "Course 2" in the "Course categories" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: Add the course list block on the frontpage page and view as a guest
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Courses" block
And I log out
When I log in as "guest"
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
And I should see "Category B" in the "Course categories" "block"
And I should not see "Category C" in the "Course categories" "block"
And I should not see "Course 1" in the "Course categories" "block"
And I should not see "Course 2" in the "Course categories" "block"
And I follow "All courses"
And I should see "Category 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_list/tests/behat/block_course_list_course.feature
@block @block_course_list
Feature: Enable the course_list block on a course page and view it's contents
In order to enable the course list block on an course page
As a teacher
I can add the course list block to a course page
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
| Category B | 0 | CATB |
| Category C | CATB | CATC |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | CATA |
| Course 3 | C3 | CATB |
| Course 4 | C4 | CATC |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
Scenario: Add the course list block on course page and navigate to the course listing
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: Add the course list block on course page and navigate to another course
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I am on "Course 3" course homepage
And I should see "Course 3"
Scenario: Add the course list block on course page and view as an admin
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
And I should see "Category B" in the "Course categories" "block"
And I should not see "Category C" in the "Course categories" "block"
And I should not see "Course 1" in the "Course categories" "block"
And I should not see "Course 2" in the "Course categories" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: View the course list block on course page with hide all courses link enabled
Given the following config values are set as admin:
| block_course_list_hideallcourseslink | 1 | |
| unaddableblocks | | theme_boost|
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Courses" block
Then I should not see "All courses" in the "My courses" "block"
Scenario: View the course list block on course page with admin sees own course enabled
Given the following config values are set as admin:
| block_course_list_adminview | own | |
| unaddableblocks | | theme_boost|
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Courses" block
Then I should not see "Category 1" in the "My courses" "block"
And I should not see "Category A" in the "My courses" "block"
And I should not see "Category B" in the "My courses" "block"
And I should not see "Category C" in the "My courses" "block"
And I should see "Course 1" in the "My courses" "block"
And I should not see "Course 2" in the "My courses" "block"
And I follow "All courses"
And I should see "Category 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_list/tests/behat/block_course_list_category.feature
@block @block_course_list
Feature: Enable the course_list block on a category page and view it's contents
In order to enable the course list block on a category page
As an admin
I can add the course list block to a category page
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
| Category B | 0 | CATB |
| Category C | CATB | CATC |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | CATA |
| Course 3 | C3 | CATB |
| Course 4 | C4 | CATC |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
Scenario: Add the course list block on category page and navigate to the course listing
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I am on course index
And I follow "Category 1"
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Courses" block
And I log out
When I log in as "teacher1"
And I am on course index
And I follow "Category 1"
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: Add the course list block on category page and navigate to another course
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I am on course index
And I follow "Category 1"
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Courses" block
And I log out
When I log in as "teacher1"
And I am on course index
And I follow "Category 1"
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I am on "Course 3" course homepage
And I should see "Course 3"
Scenario: Add the course list block on category page and view as an admin
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I am on course index
And I follow "Category 1"
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
And I should see "Category B" in the "Course categories" "block"
And I should not see "Category C" in the "Course categories" "block"
And I should not see "Course 1" in the "Course categories" "block"
And I should not see "Course 2" in the "Course categories" "block"
And I follow "All courses"
And I should see "Category 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_list/tests/behat/block_course_list_dashboard.feature
@block @block_course_list
Feature: Enable the course_list block on the dashboard and view it's contents
In order to enable the course list block on the dashboard
As a user
I can add the course list block to the dashboard
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
| Category B | 0 | CATB |
| Category C | CATB | CATC |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | CATA |
| Course 3 | C3 | CATB |
| Course 4 | C4 | CATC |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
Scenario: Add the course list block on the dashboard and navigate to the course listing
Given I log in as "teacher1"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I follow "All courses"
And I should see "Category 1"
Scenario: Add the course list block on the dashboard and navigate to another course
Given I log in as "teacher1"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Course 1" in the "My courses" "block"
And I should see "Course 2" in the "My courses" "block"
And I should see "Course 3" in the "My courses" "block"
And I should not see "Course 4" in the "My courses" "block"
And I am on "Course 3" course homepage
And I should see "Course 3"
Scenario: Add the course list block on the dashboard and view as an admin
Given I log in as "admin"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
When I add the "Courses" block
Then I should see "Category 1" in the "Course categories" "block"
And I should see "Category A" in the "Course categories" "block"
And I should see "Category B" in the "Course categories" "block"
And I should not see "Category C" in the "Course categories" "block"
And I should not see "Course 1" in the "Course categories" "block"
And I should not see "Course 2" in the "Course categories" "block"
And I follow "All courses"
And I should see "Category 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_pagination.feature
@block @block_myoverview @javascript
Feature: My overview block pagination
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 01 | C1 | 0 |
| Course 02 | C2 | 0 |
| Course 03 | C3 | 0 |
| Course 04 | C4 | 0 |
| Course 05 | C5 | 0 |
| Course 06 | C6 | 0 |
| Course 07 | C7 | 0 |
| Course 08 | C8 | 0 |
| Course 09 | C9 | 0 |
| Course 10 | C10 | 0 |
| Course 11 | C11 | 0 |
| Course 12 | C12 | 0 |
| Course 13 | C13 | 0 |
| Course 14 | C14 | 0 |
| Course 15 | C15 | 0 |
| Course 16 | C16 | 0 |
| Course 17 | C17 | 0 |
| Course 18 | C18 | 0 |
| Course 19 | C19 | 0 |
| Course 20 | C20 | 0 |
| Course 21 | C21 | 0 |
| Course 22 | C22 | 0 |
| Course 23 | C23 | 0 |
| Course 24 | C24 | 0 |
| Course 25 | C25 | 0 |
Scenario: The pagination controls should be hidden if I am not enrolled in any courses
When I am on the "My courses" page logged in as "student1"
Then I should see "You're not enrolled in any course" in the "Course overview" "block"
And I should not see "Show" in the "Course overview" "block"
And ".block_myoverview .dropdown-menu.show" "css_element" should not be visible
And ".block_myoverview [data-control='next']" "css_element" should not be visible
And ".block_myoverview [data-control='previous']" "css_element" should not be visible
And I log out
Scenario: The pagination controls should be hidden if I am enrolled in 12 courses or less
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
When I am on the "My courses" page logged in as "student1"
Then I should not see "Show" in the "Course overview" "block"
And ".block_myoverview .dropdown-menu.show" "css_element" should not be visible
And ".block_myoverview [data-control='next']" "css_element" should not be visible
And ".block_myoverview [data-control='previous']" "css_element" should not be visible
And I log out
Scenario: The default pagination should be 12 courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I am on the "My courses" page logged in as "student1"
Then I should see "12" in the ".block_myoverview [data-action='limit-toggle']" "css_element"
And I log out
Scenario: I should only see pagination limit options less than total number of enrolled courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
And I am on the "My courses" page logged in as "student1"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
Then I should see "All" in the ".dropdown-menu.show" "css_element"
And I should see "12" in the ".dropdown-menu.show" "css_element"
And ".block_myoverview [data-control='next']" "css_element" should be visible
And ".block_myoverview [data-control='previous']" "css_element" should be visible
But I should not see "24" in the ".block_myoverview .dropdown-menu.show" "css_element"
And I log out
Scenario: Previous page button should be disabled when on the first page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I am on the "My courses" page logged in as "student1"
Then the "class" attribute of ".block_myoverview [data-control='previous']" "css_element" should contain "disabled"
And I log out
Scenario: Next page button should be disabled when on the last page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I am on the "My courses" page logged in as "student1"
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
Then the "class" attribute of ".block_myoverview [data-control='next']" "css_element" should contain "disabled"
And I log out
Scenario: Next and previous page buttons should both be enabled when not on last or first page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
| student1 | C14 | student |
| student1 | C15 | student |
| student1 | C16 | student |
| student1 | C17 | student |
| student1 | C18 | student |
| student1 | C19 | student |
| student1 | C20 | student |
| student1 | C21 | student |
| student1 | C22 | student |
| student1 | C23 | student |
| student1 | C24 | student |
| student1 | C25 | student |
When I am on the "My courses" page logged in as "student1"
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
Then the "class" attribute of ".block_myoverview [data-control='next']" "css_element" should not contain "disabled"
And the "class" attribute of ".block_myoverview [data-control='previous']" "css_element" should not contain "disabled"
And I should see "Course 13" in the "Course overview" "block"
And I should see "Course 24" in the "Course overview" "block"
But I should not see "Course 12" in the "Course overview" "block"
And I should not see "Course 25" in the "Course overview" "block"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_hidden.feature
@block @block_myoverview @javascript
Feature: The my overview block allows users to hide their courses
In order to enable the my overview block in a course
As a student
I can add the my overview block to my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 3 | C3 | 0 |
| Course 4 | C4 | 0 |
| Course 5 | C5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
Scenario: Test hide toggle functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
Scenario: Test hide toggle functionality w/ favorites
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
And I should not see "Course 2" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
And I click on "Starred" "link" in the "Course overview" "block"
Then I should not see "Course 2" in the "Course overview" "block"
And I click on "Starred" "button" in the "Course overview" "block"
And I click on "Removed from view" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
Scenario: Test show toggle functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "All" "button" in the "Course overview" "block"
And I click on "Removed from view" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
And I should not see "Course 2" in the "Course overview" "block"
And I click on "Removed from view" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Course 2" in the "Course overview" "block"
Scenario: Test star and unstar functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "All" "button" in the "Course overview" "block"
And I click on "Removed from view" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
And I click on "Removed from view" "button" in the "Course overview" "block"
And I click on "All" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
And I click on "Starred" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
Scenario: Test a course is hidden directly with "All" courses
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
Then I should not see "Course 2" in the "Course overview" "block"
Scenario: Test a course is never hidden with "All (including removed from view)" courses
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (except hidden)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
Then I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I should not see "Remove from view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I should see "Restore to view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I should see "Remove from view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I should not see "Restore to view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_favourite.feature
@block @block_myoverview @javascript
Feature: The my overview block allows users to favourite their courses
In order to enable the my overview block in a course
As a student
I can add the my overview block to my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 3 | C3 | 0 |
| Course 4 | C4 | 0 |
| Course 5 | C5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
Scenario: Favourite a course on a course card
Given I am on the "My courses" page logged in as "student1"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
And "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
And "//div[@class='card dashboard-card' and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[@class='card dashboard-card' and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
Scenario: Star a course and switch display to list
Given I am on the "My courses" page logged in as "student1"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
And I click on "List" "link" in the "Course overview" "block"
Then "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
Scenario: Star a course and switch display to summary
Given I am on the "My courses" page logged in as "student1"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
And I click on "Summary" "link" in the "Course overview" "block"
Then "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_pagelimit_persistence.feature
@block @block_myoverview @javascript
Feature: The my overview block allows users to persistence of their page limits
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C01 | 0 |
| Course 2 | C02 | 0 |
| Course 3 | C03 | 0 |
| Course 4 | C04 | 0 |
| Course 5 | C05 | 0 |
| Course 6 | C06 | 0 |
| Course 7 | C07 | 0 |
| Course 8 | C08 | 0 |
| Course 9 | C09 | 0 |
| Course 10 | C10 | 0 |
| Course 11 | C11 | 0 |
| Course 12 | C12 | 0 |
| Course 13 | C13 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C01 | student |
| student1 | C02 | student |
| student1 | C03 | student |
| student1 | C04 | student |
| student1 | C05 | student |
| student1 | C06 | student |
| student1 | C07 | student |
| student1 | C08 | student |
| student1 | C09 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
Scenario: Toggle the page limit between page reloads
Given I am on the "My courses" page logged in as "student1"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
And I click on "All" "link" in the ".dropdown-menu.show" "css_element"
Then I should see "Course 13"
And I reload the page
Then I should see "Course 13"
And I should see "All" in the ".block-myoverview [data-action='limit-toggle']" "css_element"
Scenario: Toggle the page limit between grouping changes
Given I am on the "My courses" page logged in as "student1"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
And I click on "All" "link" in the ".dropdown-menu.show" "css_element"
And I click on "All" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 13"
And I should see "All" in the ".block-myoverview [data-action='limit-toggle']" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_progress.feature
@block @block_myoverview @javascript
Feature: Course overview block show users their progress on courses
In order to enable the my overview block in a course
As a student
I can see the progress percentage of the courses I am enrolled in
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion | startdate | enddate |
| Course 1 | C1 | 0 | 1 | ##yesterday## | ##tomorrow## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose |
| choice | C1 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Course progress percentage should not be displayed if completion is not enabled
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
Then I should not see "0%" in the "Course overview" "block"
Scenario: User complete activity and verify his progress
Given I am on the "Test choice 1" "choice activity" page logged in as teacher1
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Add requirements | 1 |
| id_completionview | 1 |
And I press "Save and return to course"
And I log out
When I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should see "0%" in the "Course overview" "block"
And I am on the "Test choice 1" "choice activity" page
And I am on the "My courses" page
And I click on "All" "button" in the "Course overview" "block"
And I should see "100%" in the "Course overview" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_zerostate.feature
@block @block_myoverview @javascript
Feature: Zero state on my overview block
In order to know what should be the next step
As a user
I should see the proper information based on my capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| user | User | X | [email protected] | U1 |
| manager | Manager | X | [email protected] | M1 |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager | manager | System | |
Scenario: Users with no permissions don't see any CTA
Given I am on the "My courses" page logged in as "user"
When I should see "You're not enrolled in any course"
Then I should see "Once you're enrolled in a course, it will appear here."
And I should not see "Create course"
And I should not see "Request a course"
Scenario: Users with permissions to request a course should see a Request course button
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:request | Allow | user | System | |
When I am on the "My courses" page logged in as "user"
Then I should see "Request your first course"
And "Moodle documentation" "link" should exist
And "Quickstart guide" "link" should exist
And "Request a course" "button" should exist
And I click on "Request a course" "button"
And I should see "Details of the course"
Scenario: Users with permissions to create a course when there is no course created
Given I am on the "My courses" page logged in as "manager"
When I should see "Create your first course"
Then "Moodle documentation" "link" should exist
And "View Quickstart guide" "button" should exist
And "Create course" "button" should exist
And I click on "Create course" "button"
And I should see "Add a new course"
Scenario: Users with permissions to create a course but is not enrolled in any existing course
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
When I am on the "My courses" page logged in as "manager"
Then I should see "You're not enrolled in any course"
Then I should see "Once you're enrolled in a course, it will appear here."
And "Manage courses" "button" should exist
And "Create course" "button" should exist
And I click on "Create course" "button"
And I should see "Add a new course"
And I am on the "My courses" page
And I click on "Manage courses" "button"
And I should see "Course 1"
Scenario: Users with permissions to create but not to manage courses and is not enrolled in any existing course
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/category:manage | Prohibit | manager | System | |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
When I am on the "My courses" page logged in as "manager"
Then I should see "You're not enrolled in any course"
Then I should not see "To view all courses on this sie, go to Manage courses"
And "Manage courses" "button" should not exist
And "Create course" "button" should exist
And I click on "Create course" "button"
And I should see "Add a new course"
@accessibility
Scenario: Evaluate the accessibility of the My courses (zero state)
When I am on the "My courses" page logged in as "manager"
Then the page should meet accessibility standards
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_adminsettings.feature
@block @block_myoverview @javascript
Feature: The my overview block allows admins to easily configure the students' course list
In order to adapt the my overview block to my users' needs
As an admin
I can configure the appearance of the my overview block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "categories" exist:
| name | category | idnumber |
| Category 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | CAT1 | ##yesterday## | ##tomorrow## |
| Course 5 | C5 | 0 | ##first day of next month## | ##last day of next month## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
Scenario: Enable 'All (including removed from view)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including removed from view)" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false positives from the "All" element otherwise
Then "All (including removed from view)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'All (including removed from view)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including removed from view)" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "All (including removed from view)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'All' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "[data-value='all']" "css_element" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'All' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
# 'All' option has been disabled, so the button is falling back to the 'In progress' option which is the next enabled option.
And I click on "In progress" "button" in the "Course overview" "block"
Then "[data-value='all']" "css_element" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'In progress' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "In progress" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false negatives "All (including removed from view)" element otherwise
Then "In progress" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'In progress' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "In progress" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "In progress" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Future' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Future" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Future' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Future" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Past' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Past" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Past' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Past" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Starred' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Starred" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Starred' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Starred" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Removed from view" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Removed from view" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Removed from view" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable all course filter options
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including removed from view)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "0"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Then "button#groupingdropdown" "css_element" should not exist in the ".block_myoverview" "css_element"
And I should see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
And I should see "Course 5" in the "Course overview" "block"
Scenario: Disable all but one course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including removed from view)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "1"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Then "button#groupingdropdown" "css_element" should not exist in the ".block_myoverview" "css_element"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_customfield.feature
@block @block_myoverview @javascript
Feature: The my overview block allows users to group courses by custom fields
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "custom field categories" exist:
| name | component | area | itemid |
| Course fields | core_course | course | 0 |
And the following "custom fields" exist:
| name | category | type | shortname | configdata |
| Checkbox field | Course fields | checkbox | checkboxfield | |
| Date field | Course fields | date | datefield | {"mindate":0, "maxdate":0} |
| Select field | Course fields | select | selectfield | {"options":"Option 1\nOption 2\nOption 3\nOption 4"} |
| Text field | Course fields | text | textfield | {"visibility":"2"} |
| Text field 2 | Course fields | text | textfield2 | {"visibility":"2"} |
| Hidden field | Course fields | text | hiddenfield | {"visibility":"0"} |
And the following "courses" exist:
| fullname | shortname | category | customfield_checkboxfield | customfield_datefield | customfield_selectfield | customfield_textfield | customfield_textfield2 |
| Course 1 | C1 | 0 | 1 | 981028800 | 1 | fish | penguin |
| Course 2 | C2 | 0 | 0 | 334324800 | | | |
| Course 3 | C3 | 0 | 0 | 981028800 | 2 | dog | |
| Course 4 | C4 | 0 | 1 | | 3 | cat | |
| Course 5 | C5 | 0 | | 334411200 | 2 | fish | penguin |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
Scenario: Group courses by checkbox: Yes
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | checkboxfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Checkbox field: Yes" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by checkbox: No
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | checkboxfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Checkbox field: No" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should see "Course 5" in the "Course overview" "block"
Scenario: Group courses by date: 1 February 2001
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "1 February 2001" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by date: 6 August 1980
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "6 August 1980" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should see "Course 5" in the "Course overview" "block"
Scenario: Group courses by date: No Date field
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "No Date field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by select: Option 1
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I should not see "Option 4" in the "Course overview" "block"
When I click on "Option 1" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by select: Option 2
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Option 2" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should see "Course 5" in the "Course overview" "block"
Scenario: Group courses by select: No Select field
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "No Select field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by text: fish
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "fish" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should see "Course 5" in the "Course overview" "block"
Scenario: Group courses by text: dog
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "dog" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Group courses by text: No Text field
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "No Text field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: Hidden fields not displayed when configuring the custom field filters
Given I log in as "admin"
When I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Custom field" to "1"
Then the "Field to use" select box should not contain "Hidden field"
Scenario: Hidden fields not displayed in the filter
Given the following config values are set as admin:
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield2 | block_myoverview |
And I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Edit" "link" in the "Text field 2" "table_row"
And I set the field "Visible to" to "Nobody"
And I press "Save changes"
And I log out
When I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then I should not see "penguin" in the "Course overview" "block"
Then I should not see "No text field" in the "Course overview" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
@block @block_myoverview @javascript
Feature: The my overview block allows users to easily access their courses
In order to enable the my overview block in a course
As a student
I can add the my overview block to my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
And the following "categories" exist:
| name | category | idnumber |
| Category 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | CAT1 | ##yesterday## | ##tomorrow## |
| Course 5 | C5 | 0 | ##first day of next month## | ##last day of next month## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
Scenario: View past courses
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View future courses
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
Scenario: View inprogress courses
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View all (except removed) courses
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
Scenario: View all (including removed from view) courses
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
Scenario: View inprogress courses - test persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
And I reload the page
Then I should see "In progress" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View all (except removed) courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I reload the page
Then I should see "All" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
Scenario: View past courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Past" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View future courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Future" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
Scenario: View favourite courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Starred" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Starred" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: List display persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
And I click on "List" "link" in the "Course overview" "block"
And I reload the page
Then I should see "List" in the "Course overview" "block"
And "[data-display='list']" "css_element" in the "Course overview" "block" should be visible
Scenario: Cards display persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
And I click on "Card" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Card" in the "Course overview" "block"
And "[data-display='card']" "css_element" in the "Course overview" "block" should be visible
Scenario: Summary display persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
And I click on "Summary" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Summary" in the "Course overview" "block"
And "[data-display='summary']" "css_element" in the "Course overview" "block" should be visible
Scenario: Course name sort persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "sortingdropdown" "button" in the "Course overview" "block"
And I click on "Sort by course name" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Sort by course name" in the "Course overview" "block"
And "[data-sort='fullname']" "css_element" in the "Course overview" "block" should be visible
Scenario: Last accessed sort persistence
Given I am on the "My courses" page logged in as "student1"
And I click on "sortingdropdown" "button" in the "Course overview" "block"
And I click on "Sort by last accessed" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Sort by last accessed" in the "Course overview" "block"
And "[data-sort='ul.timeaccess desc']" "css_element" in the "Course overview" "block" should be visible
Scenario: Short name sort persistence
Given I am on the "My courses" page logged in as "student1"
When I click on "sortingdropdown" "button" in the "Course overview" "block"
Then I should not see "Sort by short name" in the "Course overview" "block"
When the following config values are set as admin:
| config | value |
| courselistshortnames | 1 |
And I reload the page
And I click on "sortingdropdown" "button" in the "Course overview" "block"
And I click on "Sort by short name" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Sort by short name" in the "Course overview" "block"
And "[data-sort='shortname']" "css_element" in the "Course overview" "block" should be visible
Scenario: View inprogress courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "In progress" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View past courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I reload the page
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
And I should not see "Course 5" in the "Course overview" "block"
Scenario: View future courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
And I should not see "Course 3" in the "Course overview" "block"
And I should not see "Course 4" in the "Course overview" "block"
Scenario: View all (except hidden) courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
Scenario: View all (including removed from view) courses with hide persistent functionality
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
Scenario: Show course category in cards display
Given the following config values are set as admin:
| displaycategories | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "Card" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"
Scenario: Show course category in list display
Given the following config values are set as admin:
| displaycategories | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "List" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"
Scenario: Show course category in summary display
Given the following config values are set as admin:
| displaycategories | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "Summary" "link" in the "Course overview" "block"
Then I should see "Category 1" in the "Course overview" "block"
Scenario: Hide course category in cards display
Given the following config values are set as admin:
| displaycategories | 0 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "Card" "link" in the "Course overview" "block"
Then I should not see "Category 1" in the "Course overview" "block"
Scenario: Hide course category in list display
Given the following config values are set as admin:
| displaycategories | 0 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "List" "link" in the "Course overview" "block"
Then I should not see "Category 1" in the "Course overview" "block"
Scenario: Show course category in summary display
Given the following config values are set as admin:
| displaycategories | 0 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
When I click on "Summary" "link" in the "Course overview" "block"
Then I should not see "Category 1" in the "Course overview" "block"
@accessibility
Scenario: The dashboard page must have sufficient colour contrast
When I am on the "My courses" page logged in as "student1"
Then the page should meet "wcag143" accessibility standards
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myoverview/tests/behat/block_myoverview_search.feature
@block @block_myoverview @javascript
Feature: My overview block searching
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | [email protected] | S1 |
| student2 | Student | Y | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 01 | C1 | 0 |
| Course 02 | C2 | 0 |
| Course 03 | C3 | 0 |
| Course 04 | C4 | 0 |
| Course 05 | C5 | 0 |
| Course 06 | C6 | 0 |
| Course 07 | C7 | 0 |
| Course 08 | C8 | 0 |
| Course 09 | C9 | 0 |
| Course 10 | C10 | 0 |
| Course 11 | C11 | 0 |
| Course 12 | C12 | 0 |
| Course 13 | C13 | 0 |
| Fake example | Fake | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
Scenario: There is no search if I am not enrolled in any course
When I am on the "My courses" page logged in as "student2"
Then I should see "You're not enrolled in any course" in the "Course overview" "block"
And "Search courses" "field" should not exist in the "Course overview" "block"
And I log out
Scenario: Single page search
Given I am on the "My courses" page logged in as "student1"
And I set the field "Search courses" in the "Course overview" "block" to "Course 0"
Then I should see "Course 01" in the "Course overview" "block"
And I should not see "Course 13" in the "Course overview" "block"
And I log out
Scenario: Paginated search
Given I am on the "My courses" page logged in as "student1"
And I set the field "Search courses" in the "Course overview" "block" to "Course"
And I should see "Course 01" in the "Course overview" "block"
And I should not see "Course 13" in the "Course overview" "block"
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
Then I should see "Course 13" in the "Course overview" "block"
And I should not see "Course 01" in the "Course overview" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/accessreview/tests/accessreview.feature
@block @block_accessreview @javascript
Feature: Block accessreview
In order to overview accessibility information on my course
As a manager
I can add the accessreview block in a course
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
Scenario: View accessreview block on a course
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
And I should see "Your accessibility toolkit needs to be registered."
Scenario: Hide/show accessreview view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
And I should see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility Review" "block"
And I follow "Hide Accessibility Review block"
And I should not see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility Review" "block"
And I follow "Show Accessibility Review block"
And I should see "Your accessibility toolkit needs to be registered."
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/accessreview/tests/behat/accessreview.feature
@block @block_accessreview @javascript
Feature: Block accessreview
In order to overview accessibility information on my course
As a manager
I can add the accessreview block in a course
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following config values are set as admin:
| analysistype | 1 | tool_brickfield |
Scenario: View accessreview block on a course
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I should see "Your accessibility toolkit needs to be registered."
Scenario: Hide/show accessreview view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I should see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility review" "block"
And I follow "Hide Accessibility review block"
And I should not see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility review" "block"
And I follow "Show Accessibility review block"
And I should see "Your accessibility toolkit needs to be registered."
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/accessreview/tests/behat/accessreview_results.feature
@block @block_accessreview @javascript
Feature: Block accessreview results
In order to overview accessibility information on my course
As a manager
I can add the accessreview block in a course after running the scheduled task
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |
And the following config values are set as admin:
| analysistype | 1 | tool_brickfield |
Scenario: View accessreview block results on a course
Given I log in as "admin"
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
Then I should see "Your accessibility toolkit is functional while being validated."
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I press "Submit for analysis"
Then I should see "This course has been scheduled for analysis."
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I should see "Image" in the "Accessibility review" "block"
And I should see "Layout" in the "Accessibility review" "block"
And I should see "Link" in the "Accessibility review" "block"
And I should see "Media" in the "Accessibility review" "block"
And I should see "Table" in the "Accessibility review" "block"
And I should see "Text" in the "Accessibility review" "block"
# We created one link error above.
And I should see "1" in the "Link" "table_row"
# We created one text issue, and the standard Behat course generator creates another (too much content).
And I should see "2" in the "Text" "table_row"
And "View accessibility toolkit" "icon" should exist in the "Accessibility review" "block"
And "Toggle accessibility heatmap" "icon" should exist in the "Accessibility review" "block"
And "Download accessibility summary report" "icon" should exist in the "Accessibility review" "block"
Scenario: Toggle highlighting on/off
Given I log in as "admin"
Given the following "user preferences" exist:
| user | preference | value |
| admin | block_accessreviewtogglestate | 0 |
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility review" block
And I press "Submit for analysis"
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I click on "Toggle accessibility heatmap" "icon"
And ".block_accessreview_view" "css_element" should be visible
And I click on "Toggle accessibility heatmap" "icon"
And ".block_accessreview_view" "css_element" should not be visible
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/accessreview/tests/accessreview_results.feature
@block @block_accessreview @javascript
Feature: Block accessreview results
In order to overview accessibility information on my course
As a manager
I can add the accessreview block in a course after running the scheduled task
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
Scenario: View accessreview block results on a course
Given I log in as "admin"
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
Then I should see "Your accessibility toolkit is still being validated."
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
And I press "Submit for analysis"
Then I should see "This course has been scheduled for analysis."
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I should see "Image" in the "Accessibility Review" "block"
And I should see "Layout" in the "Accessibility Review" "block"
And I should see "Link" in the "Accessibility Review" "block"
And I should see "Media" in the "Accessibility Review" "block"
And I should see "Table" in the "Accessibility Review" "block"
And I should see "Text" in the "Accessibility Review" "block"
# We created one link error above.
And I should see "1" in the "Link" "table_row"
# We created one text issue, and the standard Behat course generator creates another (too much content).
And I should see "2" in the "Text" "table_row"
And "View Brickfield Accessibility Report" "icon" should exist in the "Accessibility Review" "block"
And "Toggle Brickfield Accessibility Heatmap" "icon" should exist in the "Accessibility Review" "block"
And "Download Brickfield Accessibility Report" "icon" should exist in the "Accessibility Review" "block"
Scenario: Toggle highlighting on/off
Given I log in as "admin"
Given the following "user preferences" exist:
| user | preference | value |
| admin | block_accessreviewtogglestate | 0 |
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
And I press "Submit for analysis"
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
And ".block_accessreview_view" "css_element" should be visible
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
And ".block_accessreview_view" "css_element" should not be visible
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/private_files/tests/behat/block_private_files_course.feature
@block @block_private_files @_file_upload @javascript
Feature: The private files block allows users to store files privately in moodle on course page
In order to store a private file in moodle
As a teacher
I can upload the file to my private files area using the private files block in a course
Scenario: Upload a file to the private files block from a course
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
And I press "Save changes"
Then I should see "testfile.txt" in the "Private files" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/private_files/tests/behat/block_private_files_frontpage.feature
@block @block_private_files @_file_upload
Feature: The private files block allows users to store files privately in moodle on front page.
In order to store a private file in moodle
As a teacher
I can upload the file to my private files area using the private files block from the front page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | site-index | side-pre |
Scenario: Try to view the private files block as a guest
Given I log in as "guest"
When I am on site homepage
Then "Private files" "block" should not exist
@javascript
Scenario: Upload a file to the private files block from the frontpage
Given I log in as "teacher1"
And I am on site homepage
And "Private files" "block" should exist
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
And I press "Save changes"
Then I should see "testfile.txt" in the "Private files" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/private_files/tests/behat/block_private_files_dashboard.feature
@block @block_private_files @_file_upload @javascript
Feature: The private files block allows users to store files privately in moodle on dashboard
In order to store a private file in moodle
As a user
I can upload the file to my private files area using the private files block on the dashboard
Scenario: Upload a file to the private files block from the dashboard
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And I log in as "teacher1"
And "Private files" "block" should exist
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
And I press "Save changes"
Then I should see "testfile.txt" in the "Private files" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/private_files/tests/behat/block_private_files_activity.feature
@block @block_private_files @_file_upload @javascript
Feature: The private files block allows users to store files privately in moodle on activity page
In order to store a private file in moodle
As a teacher
I can upload the file to my private files area using the private files block in an activity
Scenario: Upload a file to the private files block in an activity
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Activity module | page1 | mod-page-* | side-pre |
And I am on the "Test page name" "page activity" page logged in as teacher1
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
And I press "Save changes"
Then I should see "testfile.txt" in the "Private files" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/section_links/tests/behat/block_section_links_course.feature
@block @block_section_links
Feature: The section links block allows users to quickly navigate around a moodle course
In order to navigate a moodle course
As a teacher
I can use the section links block
Background:
Given the following "courses" exist:
| fullname | shortname | category | numsections | coursedisplay |
| Course 1 | C1 | 0 | 20 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment 1 | Offline text | C1 | 5 | assign1 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Add the section links block to a course.
Given the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And I turn editing mode off
And I should see "5" in the "Section links" "block"
When I follow "5"
Then I should see "Test assignment 1"
Scenario: Add the section links block to a course and limit the sections displayed.
Given the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And I configure the "Section links" block
And I set the following fields to these values:
| config_numsections1 | 5 |
| config_incby1 | 5 |
| config_numsections2 | 40 |
| config_incby2 | 10 |
And I press "Save changes"
And I turn editing mode off
And I should see "5" in the "Section links" "block"
When I follow "5"
Then I should see "Test assignment 1"
Scenario: Add the section links block to a course and limit the sections displayed using the alternative number of sections.
Given the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And I configure the "Section links" block
And I set the following fields to these values:
| config_numsections1 | 5 |
| config_incby1 | 1 |
| config_numsections2 | 10 |
| config_incby2 | 5 |
And I press "Save changes"
And I turn editing mode off
And I should see "5" in the "Section links" "block"
When I follow "5"
Then I should see "Test assignment 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/section_links/tests/behat/show_section_name.feature
@block @block_section_links
Feature: The Section links block can be configured to display section name in addition to section number
Background:
Given the following "courses" exist:
| fullname | shortname | category | numsections | coursedisplay |
| Course 1 | C1 | 0 | 10 | 1 |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| assign | First assignment | C1 | assign1 | 7 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following config values are set as admin:
| showsectionname | 1 | block_section_links |
| unaddableblocks | | theme_boost|
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| section_links | Course | C1 | course-view-* | side-pre |
Scenario: Student can see section name under the Section links block
When I am on the "Course 1" course page logged in as student1
Then I should see "7: Topic 7" in the "Section links" "block"
And I follow "7: Topic 7"
And I should see "First assignment"
Scenario: Teacher can configure existing Section links block to display section number or section name
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I configure the "Section links" block
And I set the following fields to these values:
| Display section name | No |
And I click on "Save changes" "button"
Then I should not see "7: Topic 7" in the "Section links" "block"
And I should see "7" in the "Section links" "block"
And I follow "7"
And I should see "First assignment"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/mentees/tests/behat/configuring_mentees_block.feature
@block @block_mentees @core_block
Feature: Adding and configuring Mentees blocks
In order to have a Mentees blocks on a page
As admin
I need to be able to insert and configure a Mentees blocks
@javascript
Scenario: Configuring the Mentees block with Javascript on
Given I log in as "admin"
And I am on site homepage
When I turn editing mode on
And I add the "Mentees" block
And I configure the "(new Mentees block)" block
Then I should see "Mentees block title (no title if blank)"
And I set the field "Mentees block title (no title if blank)" to "The Mentees block header"
And I press "Save changes"
And "block_mentees" "block" should exist
Then "The Mentees block header" "block" should exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/social_activities/tests/behat/edit_activities.feature
@block @block_social_activities @format_social
Feature: Edit activities in social activities block
In order to use social activities block
As a teacher
I need to add and edit activities there
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | social |
And the following "users" exist:
| username | firstname | lastname |
| user1 | User | One |
| student1 | Student | One |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | editingteacher |
| student1 | C1 | student |
@javascript
Scenario: Edit name of activity in-place in social activities block
Given the following "activities" exist:
| activity | course | name |
| forum | C1 | My forum name |
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
When I set the field "Edit title" in the "My forum name" "block_social_activities > Activity" to "New forum name"
Then I should not see "My forum name" in the "Social activities" "block"
And I should see "New forum name"
And I follow "New forum name"
And I should not see "My forum name"
And I should see "New forum name"
@javascript
Scenario: Activities in social activities block can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
When I open "My forum name" actions menu in social activities block
And I choose "Availability > Make available but don't show on course page" in the open action menu
Then I should see "Available but not shown on course page" in the "My forum name" "core_courseformat > Activity visibility"
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "My forum name" actions menu in social activities block
And I click on "Edit settings" "link" in the "My forum name" activity in social activities block
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "My forum name" activity in social activities block should be available but hidden from course page
And I turn editing mode off
And "My forum name" activity in social activities block should be available but hidden from 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:
When I am on the "Course 1" course page logged in as student1
Then I should not see "My forum name" in the "Social activities" "block"
And I click on "My forum name" "link" in the "Recent activity" "block"
And I should see "My forum name" in the ".breadcrumb" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/starredcourses/tests/behat/starred_courses.feature
@block_starredcourses
Feature: Starred courses
In order for me to quickly navigate to my favourite courses
As a user
I must be able to add them to the Starred courses block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| shortname | fullname |
| C1 | Course 1 |
| C2 | Course 2 |
| C3 | Course 3 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| starredcourses | User | student1 | my-index | content |
@accessibility @javascript
Scenario: User has no starred courses
Given I log in as "student1"
Then I should see "No starred courses"
And the page should meet accessibility standards
@accessibility @javascript
Scenario: User has starred courses
Given I am on the "My courses" page logged in as "student1"
And I click on "Actions for course Course 1" "button"
And I click on "Star for Course 1" "link"
And I click on "Actions for course Course 3" "button"
And I click on "Star for Course 3" "link"
When I follow "Dashboard"
Then the page should meet accessibility standards
And I should see "Course 1" in the "Starred courses" "block"
And I should see "Course 3" in the "Starred courses" "block"
But I should not see "Course 2" in the "Starred courses" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myprofile/tests/behat/block_myprofile_frontpage.feature
@block @block_myprofile
Feature: The logged in user block allows users to view their profile information on the front page
In order to enable the logged in user block on the frontpage
As an admin
I can add the logged in user block to the frontpage and view my information
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | [email protected] | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | System | 1 | site-index | side-pre |
Scenario: Try to view the logged in user block as a guest
Given I log in as "guest"
When I am on site homepage
Then I should not see "Logged in user"
Scenario: View the logged in user block by a logged in user
Given I log in as "teacher1"
When I am on site homepage
Then I should see "Teacher One" in the "Logged in user" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myprofile/tests/behat/block_myprofile.feature
@block @block_myprofile
Feature: The logged in user block allows users to view their profile information
In order to enable the logged in user block
As a user
I can add the logged in user block and configure it to show my information
Scenario: Configure the logged in user block to show / hide the users country
Given the following "users" exist:
| username | firstname | lastname | email | country |
| teacher1 | Teacher | One | [email protected] | AU |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display country | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "Australia" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display country | Yes |
And I press "Save changes"
And I should see "Australia" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users city
Given the following "users" exist:
| username | firstname | lastname | email | city |
| teacher1 | Teacher | One | [email protected] | Perth |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display city | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "Perth" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display city | Yes |
And I press "Save changes"
And I should see "Perth" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users email
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display email | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "[email protected]" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display email | Yes |
And I press "Save changes"
And I should see "[email protected]" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users phone
Given the following "users" exist:
| username | firstname | lastname | email | phone1 |
| teacher1 | Teacher | One | [email protected] | 555-5555 |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display phone | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "555-5555" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display phone | Yes |
And I press "Save changes"
And I should see "555-5555" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users mobile phone
Given the following "users" exist:
| username | firstname | lastname | email | phone2 |
| teacher1 | Teacher | One | [email protected] | 555-5555 |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display mobile phone | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "555-5555" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display mobile phone | Yes |
And I press "Save changes"
And I should see "555-5555" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users Institution
Given the following "users" exist:
| username | firstname | lastname | email | institution |
| teacher1 | Teacher | One | [email protected] | myinstitution |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display institution | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "myinstitution" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display institution | Yes |
And I press "Save changes"
And I should see "myinstitution" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users address
Given the following "users" exist:
| username | firstname | lastname | email | address |
| teacher1 | Teacher | One | [email protected] | myaddress |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display address | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "myaddress" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display address | Yes |
And I press "Save changes"
And I should see "myaddress" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users first access
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display first access | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "First access:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display first access | Yes |
And I press "Save changes"
And I should see "First access:" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users last access
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last access | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "Last access:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last access | Yes |
And I press "Save changes"
And I should see "Last access:" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users current login
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display current login | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "Log in:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display current login | Yes |
And I press "Save changes"
And I should see "Log in:" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users last ip
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last IP | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "IP:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last IP | Yes |
And I press "Save changes"
And I should see "IP:" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users idnumber
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | [email protected] | ID12345 |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display ID number | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "ID number:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display ID number | Yes |
And I press "Save changes"
And I should see "ID number:" in the "Logged in user" "block"
Scenario: Configure the logged in user block to show / hide the users last login
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last login | No |
And I press "Save changes"
Then I should see "Teacher One" in the "Logged in user" "block"
And I should not see "Last login:" in the "Logged in user" "block"
And I configure the "Logged in user" block
And I set the following fields to these values:
| Display last login | Yes |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I should see "Last login:" in the "Logged in user" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myprofile/tests/behat/block_myprofile_course.feature
@block @block_myprofile
Feature: The logged in user block allows users to view their profile information in a course
In order to enable the logged in user block in a course
As a teacher
I can add the logged in user block to a course and view my information
Scenario: View the logged in user block by a user in a course
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Logged in user" block
Then I should see "Teacher One" in the "Logged in user" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myprofile/tests/behat/block_myprofile_dashboard.feature
@block @block_myprofile
Feature: The logged in user block allows users to view their profile information in on the dashboard
In order to enable the logged in user block on the dashboard
As a user
I can add the logged in user block to a the dashboard and view my information
Scenario: View the logged in user block by a user on the dashboard
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And I log in as "teacher1"
And I turn editing mode on
When I add the "Logged in user" block
Then I should see "Teacher One" in the "Logged in user" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/myprofile/tests/behat/block_myprofile_activity.feature
@block @block_myprofile
Feature: The logged in user block allows users to view their profile information in an activity
In order to enable the logged in user block in an activity
As a teacher
I can add the logged in user block to an activity and view my information
Scenario: View the logged in user block by a user in an activity
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | Activity module | page1 | mod-page-* | side-pre |
When I am on the "Test page name" "page activity" page logged in as teacher1
Then I should see "Teacher One" in the "Logged in user" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tag_flickr/tests/behat/configuring_tag_flickr_block.feature
@block @block_tag_flickr
Feature: Adding and configuring Flickr block
In order to have the Flickr block used
As a admin
I need to add the Flickr block to the tags site page
Background:
# We need to create a user to use tag here because the tags site page only shows the tag that currently being used.
Given the following "users" exist:
| username | interests |
| student1 | Cats |
And I log in as "admin"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| tag_flickr | System | 1 | tag-search | side-post |
| tag_flickr | System | 1 | tag-index | side-post |
# TODO MDL-57120 site "Tags" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Tags" "link" in the "Navigation" "block"
@javascript
Scenario: Adding Flickr block to the tags site page
Given "block_tag_flickr" "block" should exist
When I configure the "Flickr" block
Then I should see "Flickr block title"
And I set the field "Flickr block title" to "The Flickr block header"
And I press "Save changes"
And "block_tag_flickr" "block" should exist
And "The Flickr block header" "block" should exist
@javascript
Scenario: Adding Flickr block to a specific tag page
Given I click on "Cats" "link"
Then "block_tag_flickr" "block" should exist
And ".flickr-photos" "css_element" should exist in the "block_tag_flickr" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/admin_bookmarks/tests/behat/bookmark_admin_pages.feature
@block @block_admin_bookmarks
Feature: Add a bookmarks to an admin pages
In order to speed up common tasks
As an admin
I need to add and access pages through bookmarks
Background:
Given I log in as "admin"
And I navigate to "Server > Tasks > Scheduled tasks" in site administration
And I click on "Bookmark this page" "link" in the "Admin bookmarks" "block"
And I log out
# Test bookmark functionality using the "User profile fields" page as our bookmark.
Scenario: Admin page can be bookmarked
Given I log in as "admin"
And I navigate to "Users > Accounts > User profile fields" in site administration
When I click on "Bookmark this page" "link" in the "Admin bookmarks" "block"
Then I should see "User profile fields" in the "Admin bookmarks" "block"
# See the existing bookmark is there too.
And I should see "Scheduled tasks" in the "Admin bookmarks" "block"
Scenario: Admin page can be accessed through bookmarks block
Given I log in as "admin"
And I navigate to "Notifications" in site administration
And I click on "Scheduled tasks" "link" in the "Admin bookmarks" "block"
# Verify that we are on the right page.
Then I should see "Day of week" in the "admintable" "table"
Scenario: Admin page can be removed from bookmarks
Given I log in as "admin"
And I navigate to "Notifications" in site administration
And I click on "Scheduled tasks" "link" in the "Admin bookmarks" "block"
When I click on "Unbookmark this page" "link" in the "Admin bookmarks" "block"
Then I should see "Bookmark deleted"
And I wait to be redirected
And I should not see "Scheduled tasks" in the "Admin bookmarks" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/return_block_original_state.feature
@core @core_block
Feature: The context of a block can always be returned to it's original state.
In order to revert actions when configuring blocks
As an admin
I need to be able to return the block to original state
Scenario: Add and configure a block to display on every page and revert back
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| assign | Assignment1 | Description | C1 | 1 | assign1 |
| assign | Assignment2 | Description | C1 | 1 | assign1 |
And I log in as "admin"
When I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
Then I should see "Tags" in the "Tags" "block"
And I navigate to course participants
And I configure the "Tags" block
And I set the following fields to these values:
| Display on page types | Any page |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Assignment1"
And I configure the "Tags" block
And I set the following fields to these values:
| Display on page types | Any assignment module page |
And I press "Save changes"
And I should see "Tags" in the "Tags" "block"
And I am on "Course 1" course homepage
And "Tags" "block" should not exist
And I navigate to course participants
And "Tags" "block" should not exist
And I am on "Course 1" course homepage
And I follow "Assignment2"
And I should see "Tags" in the "Tags" "block"
And I configure the "Tags" block
And I set the following fields to these values:
| Display on page types | Any page |
And I press "Save changes"
And I am on "Course 1" course homepage
And I should see "Tags" in the "Tags" "block"
And I navigate to course participants
And I should see "Tags" in the "Tags" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/move_blocks.feature
@core @core_block
Feature: Block region moving
In order to configure blocks appearance
As a teacher
I need to modify block region for the page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | template |
| survey | C1 | Test survey name | 4 |
| book | C1 | Test book name | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
And I press "Save changes"
Scenario: Block settings can be modified so that a block can be moved
When I follow "Test book name"
And I configure the "Comments" block
And I set the following fields to these values:
| Region | Right |
And I press "Save changes"
And I should see "Comments" in the "//*[@id='region-post' or @id='block-region-side-post']" "xpath_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/add_blocks.feature
@core @core_block
Feature: Add blocks
In order to add more functionality to pages
As a teacher
I need to add blocks to pages
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
| student2 | Student | 2 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
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
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/manage_blocks.feature
@core @core_block
Feature: Block appearances
In order to configure blocks appearance
As a teacher
I need to add and modify block configuration for the page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | template |
| survey | Test survey name | C1 | survey1 | 4 |
| book | Test book name | C1 | book1 | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
And I press "Save changes"
Scenario: Block settings can be modified so that a block apprears on any page
When I click on "Test survey name" "link" in the "region-main" "region"
Then I should see "Comments" in the "Comments" "block"
And I am on "Course 1" course homepage
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any course page |
And I press "Save changes"
And I turn editing mode off
And I click on "Test survey name" "link" in the "region-main" "region"
And I should not see "Comments"
Scenario: Block settings can be modified so that a block can be hidden
When I click on "Test book name" "link" in the "region-main" "region"
And I configure the "Comments" block
And I set the following fields to these values:
| Visible | No |
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode off
And I click on "Test book name" "link" in the "region-main" "region"
Then I should not see "Comments"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/add_blocks_overridden_disabled.feature
@block @core_block @javascript
Feature: Add a block when main feature is disabled
In order to add a block to my course
As a teacher
Some blocks should be only added to courses if the main feature they are based on is enabled.
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And I am on the "C1" "course" page logged in as "admin"
Scenario Outline: The block is displayed even when main feature is disabled
Given the following config values are set as admin:
| <settingname1> | 1 | <settingplugin1> |
And I turn editing mode on
And I add the "<blockname>" block
When the following config values are set as admin:
| <settingname1> | 0 | <settingplugin1> |
Then I should see "<blockname>"
Examples:
| blockname | settingname1 | settingplugin1 |
| Accessibility review | enableaccessibilitytools | |
| Blog menu | enableblogs | |
| Recent blog entries | enableblogs | |
| Comments | usecomments | |
| Course completion status | enablecompletion | |
| Global search | enableglobalsearch | |
| Latest badges | enablebadges | |
| Tags | usetags | |
| Learning plans | enabled | core_competency |
Scenario Outline: The block is displayed even when main feature is disabled (2 settings)
Given the following config values are set as admin:
| <settingname1> | 1 |
| <settingname2> | 1 |
And I turn editing mode on
And I add the "<blockname>" block
When the following config values are set as admin:
| <settingname1> | 0 |
| <settingname2> | 0 |
Then I should see "<blockname>"
Examples:
| blockname | settingname1 | settingname2 |
| Blog tags | enableblogs | usetags |
Scenario Outline: The block can be removed even when main feature is disabled
Given the following config values are set as admin:
| <settingname1> | 1 | <settingplugin1> |
And I turn editing mode on
And I add the "<blockname>" block
And I open the "<blockname>" blocks action menu
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
And "Delete block?" "dialogue" should exist
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
And I should see "<blockname>"
When the following config values are set as admin:
| <settingname1> | 0 | <settingplugin1> |
And I open the "<blockname>" blocks action menu
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
And "Delete block?" "dialogue" should exist
And I click on "Delete" "button" in the "Delete block?" "dialogue"
Then I should not see "<blockname>"
Examples:
| blockname | settingname1 | settingplugin1 |
| Accessibility review | enableaccessibilitytools | |
| Blog menu | enableblogs | |
| Recent blog entries | enableblogs | |
| Comments | usecomments | |
| Course completion status | enablecompletion | |
| Global search | enableglobalsearch | |
| Latest badges | enablebadges | |
| Tags | usetags | |
| Learning plans | enabled | core_competency |
Scenario Outline: The block can be removed even when main feature is disabled (2 settings)
Given the following config values are set as admin:
| <settingname1> | 1 |
| <settingname2> | 1 |
And I turn editing mode on
And I add the "<blockname>" block
And I open the "<blockname>" blocks action menu
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
And "Delete block?" "dialogue" should exist
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
And I should see "<blockname>"
When the following config values are set as admin:
| <settingname1> | 0 |
| <settingname2> | 0 |
And I open the "<blockname>" blocks action menu
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
And "Delete block?" "dialogue" should exist
And I click on "Delete" "button" in the "Delete block?" "dialogue"
Then I should not see "<blockname>"
Examples:
| blockname | settingname1 | settingname2 |
| Blog tags | enableblogs | usetags |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/configure_block_throughout_site.feature
@core @core_block
Feature: Add and configure blocks throughout the site
In order to maintain some patterns across all the site
As a manager
I need to set and configure blocks throughout the site
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | [email protected] |
| teacher1 | teacher | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "system role assigns" exist:
| user | course | role |
| manager1 | Acceptance test site | manager |
# Allow at least one role assignment in the block context:
And I log in as "admin"
And I navigate to "Users > Permissions > Define roles" in site administration
And I follow "Edit Non-editing teacher role"
And I set the following fields to these values:
| Block | 1 |
And I press "Save changes"
And I log out
Scenario: Add and configure a block throughtout the site
Given I log in as "manager1"
And I am on site homepage
And I turn editing mode on
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
When I am on "Course 1" course homepage
Then I should see "Comments" in the "Comments" "block"
And I should see "Save comment" in the "Comments" "block"
And I am on site homepage
And I configure the "Comments" block
And I set the following fields to these values:
| Default weight | -10 (first) |
And I press "Save changes"
And I am on "Course 1" course homepage
# The first block matching the pattern should be top-left block
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" "xpath_element"
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
When I turn editing mode on
Then I should see "Assign roles in Recently accessed items block"
Scenario: Blocks on courses can have roles assigned to them
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Search forums" block
Then I should see "Assign roles in Search forums block"
@javascript
Scenario: Blocks can safely be customised
Given I log in as "admin"
And I am on homepage
And I turn editing mode on
And I add the "Text" block to the default region with:
| Text block title | Foo " onload="document.getElementsByTagName('body')[0].remove()" alt=" |
| Content | Example |
Then I should see "Example" in the "block_html" "block"
Then I should see "document.getElementsByTagName"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/hide_blocks.feature
@core @core_block
Feature: Block visibility
In order to configure blocks visibility
As a teacher
I need to show and hide blocks on a page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Hiding all blocks on the page should remove the column they're in
When I open the "Search forums" blocks action menu
And I click on "Configure Search forums block" "link" in the "Search forums" "block"
And I set the field "Region" to "Right"
And I press "Save changes"
And I turn editing mode off
Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
And I turn editing mode on
And I open the "Search forums" blocks action menu
And I click on "Hide Search forums block" "link" in the "Search forums" "block"
And I turn editing mode off
And ".empty-region-side-post" "css_element" should exist in the "body" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/add_blocks_overridden.feature
@block @core_block @javascript @addablocklink
Feature: Add a block when main feature is enabled
In order to add a block to my course
As a teacher
Some blocks should be only added to courses if the main feature they are based on is enabled.
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And I am on the "C1" "course" page logged in as "admin"
Scenario Outline: The block can be added when main feature is enabled
Given the following config values are set as admin:
| <settingname1> | 1 | <settingplugin1> |
| <settingname2> | 1 | |
And I turn editing mode on
When I click on "Add a block" "link"
Then I should see "<blockname>"
Examples:
| blockname | settingname1 | settingname2 | settingplugin1 |
| Accessibility review | enableaccessibilitytools | | |
| Blog menu | enableblogs | | |
| Recent blog entries | enableblogs | | |
| Blog tags | enableblogs | usetags | |
| Comments | usecomments | | |
| Course completion status | enablecompletion | | |
| Global search | enableglobalsearch | | |
| Latest badges | enablebadges | | |
| Tags | usetags | | |
| Learning plans | enabled | | core_competency |
Scenario Outline: The block cannot be added when main feature is disabled
Given the following config values are set as admin:
| <settingname1> | 0 | <settingplugin1> |
| <settingname2> | 0 | |
And I turn editing mode on
When I click on "Add a block" "link"
Then I should not see "<blockname>"
Examples:
| blockname | settingname1 | settingname2 | settingplugin1 |
| Accessibility review | enableaccessibilitytools | | |
| Blog menu | enableblogs | | |
| Recent blog entries | enableblogs | | |
| Blog tags | enableblogs | usetags | |
| Comments | usecomments | | |
| Course completion status | enablecompletion | | |
| Global search | enableglobalsearch | | |
| Latest badges | enablebadges | | |
| Tags | usetags | | |
| Learning plans | enabled | | core_competency |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/delete_block.feature
@core @core_block
Feature: Block removal via modal
In order to remove blocks
As a teacher
I need to use a modal to confirm the block to delete
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Removing a block via modal should remove the block on the page
Given I open the "Search forums" blocks action menu
When I click on "Delete Search forums block" "link" in the "Search forums" "block"
Then "Delete block?" "dialogue" should exist
And I click on "Delete" "button" in the "Delete block?" "dialogue"
And I wait to be redirected
And "Search forums" "block" should not exist
@javascript
Scenario: Cancel removing a block via modal should retain the block on the page
Given I open the "Search forums" blocks action menu
When I click on "Delete Search forums block" "link" in the "Search forums" "block"
Then "Delete block?" "dialogue" should exist
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
And I should not see "Delete block?"
And "Search forums" "block" should exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/hidden_block_region.feature
@core @core_block
Feature: Show hidden blocks in a docked block region when editing
In order to edit blocks in a hidden region
As a teacher
I need to be able to see the blocks when editing is on
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
| news_items | Course | C1 | course-view-* | side-pre |
| calendar_upcoming | Course | C1 | course-view-* | side-pre |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
# Hide all the blocks in the non-default region
And I configure the "Search forums" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Latest announcements" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Upcoming events" block
And I set the following fields to these values:
| Visible | No |
And I click on "Save changes" "button"
And I configure the "Recent activity" block
And I set the following fields to these values:
| Visible | No |
When I click on "Save changes" "button"
# Editing is on so they should be visible
Then I should see "Search forums"
And I should see "Latest announcements"
And I should see "Upcoming events"
And I should see "Recent activity"
And I turn editing mode off
# Editing is off, so they should no longer be visible
And I should not see "Search forums"
And I should not see "Latest announcements"
And I should not see "Upcoming events"
And I should not see "Recent activity"
@javascript
Scenario: Check that a region with only hidden blocks is not docked in editing mode (javascript enabled)
Scenario: Check that a region with only hidden blocks is not docked in editing mode (javascript disabled)
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tests/behat/restrict_available_blocks.feature
@core @core_block
Feature: Allowed blocks controls
In order to prevent the use of some blocks
As an admin
I need to restrict some blocks to be used in courses
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Blocks can be added with the default permissions
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Course completion status" block
And I add the "Activities" block
Then I should see "Activities" in the "Activities" "block"
And I should see "Course completion status" in the "Course completion status" "block"
Scenario: Blocks can not be added when the admin restricts the permissions
Given the following "role capability" exists:
| role | editingteacher |
| block/activity_modules:addinstance | prohibit |
And I log in as "admin"
And I am on the "Course 1" "permissions" page
And I override the system permissions of "Teacher" role with:
| block/completionstatus:addinstance | Prohibit |
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Then the add block selector should not contain "Activities" block
And the add block selector should not contain "Course completion status" block
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/navigation/tests/behat/view_my_courses.feature
@block @block_navigation
Feature: View my courses in navigation block
In order to navigate to my courses
As a student
I need my courses displayed in the navigation block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
And the following "categories" exist:
| name | category | idnumber |
| cat1 | 0 | cat1 |
| cat2 | 0 | cat2 |
| cat3 | 0 | cat3 |
| cat31 | cat3 | cat31 |
| cat32 | cat3 | cat32 |
| cat33 | cat3 | cat33 |
And the following "courses" exist:
| fullname | shortname | category |
| Course1 | c1 | cat1 |
| Course2 | c2 | cat2 |
| Course31 | c31 | cat31 |
| Course32 | c32 | cat32 |
| Course331| c331 | cat33 |
| Course332| c332 | cat33 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | c1 | student |
| student1 | c31 | student |
| student1 | c331 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
@javascript
Scenario: The plain list of enrolled courses is shown
Given the following config values are set as admin:
| navshowmycoursecategories | 0 |
And I log in as "student1"
When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should not see "cat1" in the "Navigation" "block"
And I should not see "cat2" in the "Navigation" "block"
And I should see "c1" in the "Navigation" "block"
And I should see "c31" in the "Navigation" "block"
And I should see "c331" in the "Navigation" "block"
And I should not see "c2" in the "Navigation" "block"
And I should not see "c32" in the "Navigation" "block"
And I should not see "c332" in the "Navigation" "block"
@javascript
Scenario: The nested list of enrolled courses is shown
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
And I log in as "student1"
When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "cat1" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should not see "cat2" in the "Navigation" "block"
And I expand "cat3" node
And I should see "cat31" in the "Navigation" "block"
And I should see "cat33" in the "Navigation" "block"
And I should not see "cat32" in the "Navigation" "block"
And I expand "cat31" node
And I should see "c31" in the "Navigation" "block"
And I expand "cat33" node
And I should see "c331" in the "Navigation" "block"
And I should not see "c332" in the "Navigation" "block"
@javascript
Scenario: I can expand categories and courses as guest
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
| navshowallcourses | 1 |
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should not see "cat31" in the "Navigation" "block"
And I should not see "cat32" in the "Navigation" "block"
And I should not see "cat331" in the "Navigation" "block"
And I should not see "c1" in the "Navigation" "block"
And I should not see "c2" in the "Navigation" "block"
And I should not see "c31" in the "Navigation" "block"
And I should not see "c32" in the "Navigation" "block"
When I expand "cat3" node
And I expand "cat31" node
And I expand "cat1" node
Then I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I should see "cat31" in the "Navigation" "block"
And I should see "cat32" in the "Navigation" "block"
And I should not see "cat331" in the "Navigation" "block"
And I should see "c1" in the "Navigation" "block"
And I should not see "c2" in the "Navigation" "block"
And I should see "c31" in the "Navigation" "block"
And I should not see "c32" in the "Navigation" "block"
@javascript
Scenario: The course limit setting is applied in the navigation block
Given the following config values are set as admin:
| navcourselimit | 2 |
And I log in as "student1"
And I should see "More..." in the "Navigation" "block"
When I click on "More..." "link" in the "Navigation" "block"
Then I should see "My courses" in the "page-header" "region"
@javascript
Scenario: The dashboard node is not displayed in the navigation block when it is disabled
Given the following config values are set as admin:
| enabledashboard | 0 |
When I log in as "student1"
Then I should not see "Dashboard" in the "Navigation" "block"
# Re-enable dashboard and check then it's displayed in the navigation block.
And the following config values are set as admin:
| enabledashboard | 1 |
And I reload the page
And I should see "Dashboard" in the "Navigation" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/navigation/tests/behat/expand_courses_node.feature
@block @block_navigation
Feature: Expand the courses nodes within the navigation block
In order to navigate the site
As an anonymous user, a guest, a student, and an admin
I need to expand the courses node in the navigation block and check the display of courses and categories.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "categories" exist:
| name | category | idnumber | visible |
| cat1 | 0 | cat1 | 1 |
| cat2 | 0 | cat2 | 1 |
| cat21 | cat2 | cat21 | 1 |
| cat211 | cat21 | cat211 | 1 |
| cat3 | 0 | cat3 | 0 |
And the following "courses" exist:
| fullname | shortname | category | visible |
| Course 1 | c1 | cat1 | 1 |
| Course 2 | c2 | cat2 | 1 |
| Course 3 | c3 | cat21 | 1 |
| Course 4 | c4 | cat211 | 1 |
| Course 5 | c5 | cat211 | 0 |
| Course 6 | c6 | cat211 | 0 |
| Course 7 | c7 | cat3 | 1 |
| Course 8 | c8 | cat3 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | teacher |
| teacher1 | c3 | teacher |
| teacher1 | c5 | teacher |
| student1 | c1 | student |
| student1 | c2 | student |
| student1 | c4 | student |
And the following config values are set as admin:
| navshowallcourses | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I turn editing mode off
And I am on the "Course 2" "enrolment methods" page
And I click on "Edit" "link" in the "Guest access" "table_row"
And I set the following fields to these values:
| Allow guest access | Yes |
And I press "Save changes"
And I log out
@javascript
Scenario: As an anonymous user I expand the courses node to see courses.
When I should see "You are not logged in." in the ".logininfo" "css_element"
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And navigation node "c1" should not be expandable
And navigation node "c2" should not be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
@javascript
Scenario: As the admin user I expand the courses and category nodes to see courses.
When I log in as "admin"
And I am on site homepage
And I should see "Site home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I expand "cat3" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should see "c5" in the "Navigation" "block"
And I should see "c6" in the "Navigation" "block"
And I should see "c7" in the "Navigation" "block"
And I should see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should be expandable
And navigation node "c4" should be expandable
And navigation node "c5" should be expandable
And navigation node "c6" should be expandable
And navigation node "c7" should be expandable
And navigation node "c8" should be expandable
@javascript
Scenario: As teacher1 I expand the courses and category nodes to see courses.
When I log in as "teacher1"
And I am on site homepage
And I should see "Site home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should be expandable
And navigation node "c4" should not be expandable
And navigation node "c5" should be expandable
@javascript
Scenario: As student1 I expand the courses and category nodes to see courses.
When I log in as "student1"
And I am on site homepage
And I should see "Site home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should be expandable
@javascript
Scenario: As guest I expand the courses and category nodes to see courses.
When I log in as "guest"
And I am on site homepage
And I should see "Home" in the "Navigation" "block"
And I should see "Courses" in the "Navigation" "block"
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
And I should not see "cat3" in the "Navigation" "block"
And I expand "cat1" node
And I expand "cat2" node
And I should see "cat21" in the "Navigation" "block"
And I expand "cat21" node
And I should see "cat211" in the "Navigation" "block"
And I expand "cat211" node
Then I should see "c1" in the "Navigation" "block"
And I should see "c2" in the "Navigation" "block"
And I should see "c3" in the "Navigation" "block"
And I should see "c4" in the "Navigation" "block"
And I should not see "c5" in the "Navigation" "block"
And I should not see "c6" in the "Navigation" "block"
And I should not see "c7" in the "Navigation" "block"
And I should not see "c8" in the "Navigation" "block"
And navigation node "c1" should not be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/navigation/tests/behat/participants_link.feature
@block @block_navigation
Feature: Displaying the link to the Participants page
In order to see the course / site participants
As a student / admin respectively
I need a link to the Participants page be displayed (but only if I can access that page)
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | One | [email protected] |
| student2 | Student | Two | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
@javascript
Scenario: Course participants link is displayed to enrolled students after expanding the course node
When I log in as "student1"
And I expand "C1" node
Then "Participants" "link" should exist in the "Navigation" "block"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should not exist
@javascript
Scenario: Course participants link is displayed to users depending on role permissions settings
Given the following "activities" exist:
| activity | course | name |
| forum | C1 | Test forum name |
And I am on the "Course1" "enrolment methods" page logged in as admin
And I click on "Edit" "link" in the "Guest access" "table_row"
And I set the following fields to these values:
| Allow guest access | Yes |
And I press "Save changes"
When I am on the "Course1" course page logged in as guest
Then I should not see "Participants" in the "Navigation" "block"
And I am on the "Test forum name" "forum activity" page
And I should not see "Participants" in the "Navigation" "block"
And I log out
And the following "role capability" exists:
| role | guest |
| moodle/course:viewparticipants | allow |
And I am on the "Course1" course page logged in as guest
And I should see "Participants" in the "Navigation" "block"
And I am on the "Test forum name" "forum activity" page
And I should see "Participants" in the "Navigation" "block"
Scenario: Site participants link is displayed to admins
When I log in as "admin"
Then "Participants" "link" should exist in the "Navigation" "block"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should exist
@javascript
Scenario: Site participants link is not displayed to students (MDL-55667)
Given I log in as "admin"
And I set the following administration settings values:
| defaultfrontpageroleid | Student (student) |
And I log out
When I log in as "student2"
And I expand "Site pages" node
Then "Participants" "link" should not exist in the "Navigation" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/search_forums/tests/behat/block_search_forums_frontpage.feature
@block @block_search_forums @mod_forum
Feature: The search forums block allows users to search for forum posts on frontpage
In order to search for a forum post
As an administrator
I can add the search forums block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | System | 1 | site-index | side-pre |
Scenario: Use the search forum block on the frontpage and search for posts as a user
Given I log in as "student1"
And I am on site homepage
When I set the field "Search" to "Moodle"
And I press "Search"
Then I should see "No posts"
Scenario: Use the search forum block on the frontpage and search for posts as a guest
Given I log in as "guest"
And I am on site homepage
When I set the field "Search" to "Moodle"
And I press "Search"
Then I should see "No posts"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/search_forums/tests/behat/block_search_forums_course.feature
@block @block_search_forums @mod_forum
Feature: The search forums block allows users to search for forum posts on course page
In order to search for a forum post
As a user
I can use the search forums block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
| search_forums | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" "course editing" page logged in as teacher1
And I set the field "id_newsitems" to "1"
And I press "Save and display"
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| teacher1 | Announcements | My subject | My message |
Scenario: Use the search forum block in a course without any forum posts
Given I am on the "Course 1" course page logged in as student1
When I set the field "Search" to "Moodle"
And I press "Search"
Then I should see "No posts"
Scenario: Use the search forum block in a course with a hidden forum and search for posts
Given I am on the "Announcements" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "id_visible" to "0"
And I press "Save and return to course"
When I am on the "Course 1" course page logged in as student1
And "Search forums" "block" should exist
And I set the field "Search" to "message"
And I press "Search"
Then I should see "No posts"
Scenario: Use the search forum block in a course and search for posts
Given I am on the "Course 1" course page logged in as student1
And "Search forums" "block" should exist
And I set the field "Search" to "message"
And I press "Search"
Then I should see "My subject"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/site_main_menu/tests/behat/edit_activities.feature
@block @block_site_main_menu
Feature: Edit activities in main menu block
In order to use main menu block
As an admin
I need to add and edit activities there
@javascript
Scenario: Edit name of acitivity in-place in site main menu block
Given the following "activity" exists:
| activity | forum |
| course | Acceptance test site |
| name | My forum name |
| idnumber | forum |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name"
Then I should not see "My forum name"
And I should see "New forum name"
And I follow "New forum name"
And I should not see "My forum name"
And I should see "New forum name"
@javascript
Scenario: Activities in main menu block can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
And the following "activities" exist:
| activity | course | section | name |
| forum | Acceptance test site | 0 | Visible forum |
| forum | Acceptance test site | 0 | My forum name |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I open "My forum name" actions menu in site main menu block
And I choose "Availability > Make available but don't show on course page" in the open action menu
Then I should see "Available but not shown on course page" in the "My forum name" "core_courseformat > Activity visibility"
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "My forum name" actions menu in site main menu block
And I click on "Edit settings" "link" in the "My forum name" activity in site main menu block
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "My forum name" activity in site main menu block should be available but hidden from course page
And I turn editing mode off
And "My forum name" activity in site main menu block should be available but hidden from course page
And I log out
And I should not see "My forum name" in the "Main menu" "block"
And I should see "Visible forum" in the "Main menu" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/site_main_menu/tests/behat/add_url.feature
@block @block_site_main_menu
Feature: Add URL to main menu block
In order to add helpful resources for students
As a admin
I need to add URLs to the main menu block and check it works.
Background:
Given the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
| Course 2 | C2 | 0 | |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
@javascript
Scenario: Add a URL in menu block and ensure it appears
Given I log in as "admin"
And I am on site homepage
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |
| section | 0 |
When I am on the "reference link" "url activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| id_display | In pop-up |
And I press "Save and return to course"
And I turn editing mode on
Then "reference link" "link" should exist in the "Main menu" "block"
And "Add an activity or resource" "button" should exist in the "Main menu" "block"
@javascript
Scenario: Add a URL in menu block can appear in the entire site
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |
| section | 0 |
And I am on the "reference link" "url activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| id_display | Embed |
And I press "Save and return to course"
Then I click on "reference link" "link" in the "Main menu" "block"
And "reference link" "link" should exist in the "Main menu" "block"
And I am on the "C1" "Course" page
And "reference link" "link" should exist in the "Main menu" "block"
And I navigate to "Badges > Add a new badge" in site administration
And "reference link" "link" should exist in the "Main menu" "block"
@javascript
Scenario: Add a URL in menu block can appear in any front page
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display on the site home and any pages added to the site home. |
And I press "Save changes"
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |
| section | 0 |
And I am on the "reference link" "url activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| id_display | Embed |
And I press "Save and return to course"
Then I click on "reference link" "link" in the "Main menu" "block"
And "reference link" "link" should exist in the "Main menu" "block"
And I am on the "C1" "Course" page
And "Main menu" "block" should not exist
And I navigate to "Badges > Add a new badge" in site administration
And "Main menu" "block" should not exist
@javascript
Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course
results in adding it in the course and not in the frontpage
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
When the following "activity" exists:
| activity | url |
| course | C2 |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |
| section | 0 |
| showdescription | 1 |
And I am on the "reference link" "url activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| id_display | In pop-up |
And I press "Save and return to course"
Then "reference link" "link" should not exist in the "Main menu" "block"
And I should see "mooooooooodle" in the "region-main" "region"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/html/tests/behat/course_block.feature
@block @block_html
Feature: Text blocks in a course
In order to have one or multiple Text blocks in a course
As a teacher
I need to be able to create and change such blocks
Scenario: Adding Text block in a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | [email protected] |
| student1 | Sam1 | Student1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Text" block
And I configure the "(new text block)" block
And I set the field "Content" to "First block content"
And I set the field "Text block title" to "First block header"
And I press "Save changes"
And I add the "Text" block
And I configure the "(new text block)" block
And I set the field "Content" to "Second block content"
And I set the field "Text block title" to "Second block header"
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "First block content" in the "First block header" "block"
And I should see "Second block content" in the "Second block header" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/html/tests/behat/configuring_html_block.feature
@block @block_html @core_block
Feature: Adding and configuring Text blocks
In order to have custom blocks on a page
As admin
I need to be able to create, configure and change Text blocks
@javascript
Scenario: Configuring the Text block with Javascript on
Given I log in as "admin"
And I am on site homepage
When I turn editing mode on
And I add the "Text" block to the default region with:
| Text block title | |
| Content | Static text without a header |
Then I should not see "(new text block)"
And I configure the "block_html" block
And I set the field "Text block title" to "The Text block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And "block_html" "block" should exist
And "The Text block header" "block" should exist
And I should see "Static text with a header" in the "The Text block header" "block"
Scenario: Configuring the Text block with Javascript off
Given I log in as "admin"
And I am on site homepage
When I turn editing mode on
And I add the "Text" block
And I configure the "(new text block)" block
And I set the field "Content" to "Static text without a header"
And I press "Save changes"
Then I should not see "(new text block)"
And I configure the "block_html" block
And I set the field "Text block title" to "The Text block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And "block_html" "block" should exist
And "The Text block header" "block" should exist
And I should see "Static text with a header" in the "The Text block header" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/html/tests/behat/multiple_instances.feature
@block @block_html
Feature: Adding and configuring multiple Text blocks
In order to have one or multiple Text blocks on a page
As admin
I need to be able to create, configure and change Text blocks
Background:
Given I log in as "admin"
And I am on site homepage
When I turn editing mode on
And I add the "Text" block
Scenario: Other users can not see Text block that has not been configured
Then "(new text block)" "block" should exist
And I log out
And "(new text block)" "block" should not exist
And "block_html" "block" should not exist
Scenario: Other users can see Text block that has been configured even when it has no header
And I configure the "(new text block)" block
And I set the field "Content" to "Static text without a header"
And I press "Save changes"
Then I should not see "(new text block)"
And I log out
And I am on homepage
And "block_html" "block" should exist
And I should see "Static text without a header" in the "block_html" "block"
And I should not see "(new text block)"
Scenario: Adding multiple instances of Text block on a page
And I configure the "block_html" block
And I set the field "Text block title" to "The Text block header"
And I set the field "Content" to "Static text with a header"
And I press "Save changes"
And I add the "Text" block
And I configure the "(new text block)" block
And I set the field "Text block title" to "The second Text block header"
And I set the field "Content" to "Second block contents"
And I press "Save changes"
And I log out
Then I should see "Static text with a header" in the "The Text block header" "block"
And I should see "Second block contents" in the "The second Text block header" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature
@block @block_calendar_upcoming
Feature: View a site event on the frontpage
In order to view a site event
As a teacher
I can view the event in the upcoming events block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_upcoming | System | 1 | site-index | side-pre |
@javascript
Scenario: View a site event in the upcoming events block on the frontpage
Given I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | My Site Event |
And I log out
When I log in as "teacher1"
And I am on site homepage
Then I should see "My Site Event" in the "Upcoming events" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature
@block @block_calendar_upcoming
Feature: View a upcoming site event on the dashboard
In order to view a site event
As a student
I can view the event in the upcoming events block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
@javascript
Scenario: View a site event in the upcoming events block on the dashboard
Given I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | My Site Event |
And I log out
When I log in as "student1"
And I hover over today in the mini-calendar block
Then I should see "My Site Event"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature
@block @block_calendar_upcoming
Feature: Enable the upcoming events block in a course
In order to enable the calendar block in a course
As a teacher
I can view the event in the upcoming events block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_upcoming | System | 1 | my-index | side-post |
@javascript
Scenario: View a site event in the calendar block
Given I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | My Site Event |
And I log out
When I log in as "teacher1"
Then I should see "My Site Event" in the "Upcoming events" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tags/tests/behat/tagcloud.feature
@block @block_tags @core_tag
Feature: Block tags displaying tag cloud
In order to view system tags
As a user
I need to be able to use the block tags
Background:
Given the following "users" exist:
| username | firstname | lastname | email | interests |
| teacher1 | Teacher | 1 | [email protected] | Dogs, Cats |
| student1 | Student | 1 | [email protected] | |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | c1 |
And the following "tags" exist:
| name | isstandard |
| Neverusedtag | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
Scenario: Add Tags block on a front page
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Tags" block
And I log out
And I am on site homepage
Then I should see "Dogs" in the "Tags" "block"
And I should see "Cats" in the "Tags" "block"
And I should not see "Neverusedtag" in the "Tags" "block"
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "You are not logged in"
Scenario: Add Tags block in a course
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "Dogs" in the "Tags" "block"
And I should see "Cats" in the "Tags" "block"
And I should not see "Neverusedtag" in the "Tags" "block"
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "User interests" in the ".tag-index-items h3" "css_element"
And I should see "Teacher 1"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_tags/tests/behat/blogtag.feature
@block @block_blog_tag @core_blog @core_tag
Feature: Adding blog tag block
In order to search blog post by tag
As a user
I need to be able to use block blog tag
@javascript
Scenario: Adding block blog tag to the course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | c1 |
And the following "tags" exist:
| name | isstandard |
| Neverusedtag | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog tags" block
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I navigate to course participants
And I click on "Course blogs" "link" in the "Navigation" "block"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from teacher |
| Blog entry body | Teacher blog post content |
| Tags | Cats, dogs |
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to course participants
And I click on "Course blogs" "link" in the "Navigation" "block"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from student |
| Blog entry body | Student blog post content |
| Tags | dogs, mice |
And I press "Save changes"
And I follow "c1"
Then I should see "Cats" in the "Blog tags" "block"
And I should see "dogs" in the "Blog tags" "block"
And I should see "mice" in the "Blog tags" "block"
And I click on "Cats" "link" in the "Blog tags" "block"
And I should see "Blog post from teacher"
And I should see "Teacher blog post content"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_summary/tests/behat/block_course_summary_frontpage.feature
@block @block_course_summary
Feature: Course summary block used on the frontpage
In order to help particpants know the summary of a site
As admin
I can use the course summary block on the frontpage
Background:
Given I log in as "admin"
And I enable "course_summary" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | System | 1 | site-index | side-pre |
And I am on site homepage
And I navigate to "Site home > Site home settings" in site administration
And I set the following fields to these values:
| summary | Proved the summary block works! |
And I press "Save changes"
And I log out
# The course summary block a default front page block, so no need to add it.
Scenario: Guest can view site summary
When I am on site homepage
Then "Course/site summary" "block" should exist
And I should not see "Course summary" in the "Course/site summary" "block"
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can not see edit icon when edit mode is off
When I log in as "admin"
And I am on site homepage
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/course_summary/tests/behat/block_course_summary_course.feature
@block @block_course_summary
Feature: Course summary block used in a course
In order to help particpants know the summary of a course
As a teacher
I can add the course summary block to a course page
Background:
Given the following "courses" exist:
| fullname | shortname | summary | category |
| Course 1 | C101 | Proved the course summary block works! |0 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | [email protected] |
| teacher1 | Teacher | One | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C101 | student |
| teacher1 | C101 | editingteacher |
And I enable "course_summary" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | Course | C101 | course-view-* | side-pre |
Scenario: Student can view course summary
When I am on the "Course 1" course page logged in as student1
Then "Course summary" "block" should exist
And I should see "Course summary" in the "Course summary" "block"
And I should see "Proved the course summary block works!" in the "Course summary" "block"
Scenario: Teacher can not see edit icon when edit mode is off
When I am on the "Course 1" course page logged in as teacher1
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And "Edit" "link" should not exist in the "Course summary" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature
@block @block_tag_youtube
Feature: Adding and configuring YouTube block
In order to have the YouTube block used
As a admin
I need to add the YouTube block to the tags site page
Background:
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Manage blocks" in site administration
And I click on "Enable YouTube" "icon" in the "YouTube" "table_row"
@javascript
Scenario: Category options are not available (except default) in the block settings if the YouTube API key is not set.
Given the following config values are set as admin:
| apikey | | block_tag_youtube |
And I follow "Dashboard"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost |
# TODO MDL-57120 site "Tags" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Tags" "link" in the "Navigation" "block"
And I add the "YouTube" block
When I configure the "YouTube" block
Then I should see "Category"
And I should see "Failed to obtain the list of categories."
And I should see "The YouTube API key is not set. Contact your administrator."
And the "Category" select box should contain "Any category"
And the "Category" select box should not contain "Films & Animation"
And the "Category" select box should not contain "Entertainment"
And the "Category" select box should not contain "Education"
@javascript
Scenario: Category options are not available (except default) in the block settings when invalid YouTube API key is set.
Given the following config values are set as admin:
| apikey | invalidapikeyvalue | block_tag_youtube |
And I follow "Dashboard"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost |
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Tags" "link" in the "Navigation" "block"
And I add the "YouTube" block
When I configure the "YouTube" block
Then I should see "Category"
And I should see "Failed to obtain the list of categories."
And the "Category" select box should contain "Any category"
And the "Category" select box should not contain "Comedy"
And the "Category" select box should not contain "Autos & Vehicles"
And the "Category" select box should not contain "News & Politics"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_menu/tests/behat/block_blog_menu.feature
@block @block_blog_menu
Feature: Enable Block blog menu in a course
In order to enable the blog menu in a course
As a teacher
I can add blog menu block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Add the block to a the course when blogs are disabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
And the following config values are set as admin:
| enableblogs | 0 |
And I reload the page
Then I should see "Blogging is disabled!" in the "Blog menu" "block"
Scenario: Add the block to a the course when blog associations are disabled
Given I log in as "admin"
And the following config values are set as admin:
| useblogassociations | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
Then I should see "Blog entries" in the "Blog menu" "block"
And I should see "Add a new entry" in the "Blog menu" "block"
And I should not see "View all entries for this course" in the "Blog menu" "block"
And I should not see "View my entries about this course" in the "Blog menu" "block"
And I should not see "Add an entry about this course" in the "Blog menu" "block"
Scenario: Add the block to a the course when blog associations are enabled
Given I log in as "admin"
And the following config values are set as admin:
| useblogassociations | 1 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
Then I should see "Blog entries" in the "Blog menu" "block"
And I should see "Add a new entry" in the "Blog menu" "block"
And I should see "View all entries for this course" in the "Blog menu" "block"
And I should see "View my entries about this course" in the "Blog menu" "block"
And I should see "Add an entry about this course" in the "Blog menu" "block"
Scenario: Add the block to a the course when RSS is disabled
Given I log in as "admin"
And the following config values are set as admin:
| enablerssfeeds | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
Then I should not see "Blog RSS feed" in the "Blog menu" "block"
And I should see "Add a new entry" in the "Blog menu" "block"
Scenario: Add the block to a the course when RSS is enabled
Given I log in as "admin"
And the following config values are set as admin:
| enablerssfeeds | 1 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Blog menu" block
Then I should see "Blog RSS feed" in the "Blog menu" "block"
And I should see "Add a new entry" in the "Blog menu" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_menu/tests/behat/block_blog_menu_activity.feature
@block @block_blog_menu
Feature: Enable Block blog menu in an activity
In order to enable the blog menu in an activity
As a teacher
I can add blog menu block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
Given the following "activity" exists:
| activity | assign |
| name | Test assignment 1 |
| intro | Offline text |
| course | C1 |
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Blog entries"
And I should see "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the activity
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this Assignment! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View my entries about this Assignment"
Then I should see "S2 First Blog"
And I should not see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the assignment
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this Assignment! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View all entries about this Assignment"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this Assignment! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "Blog entries"
Then I should see "S2 First Blog"
And I should see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this Assignment! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
When I am on the "Test assignment 1" "assign activity" page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_menu/tests/behat/block_blog_menu_frontpage.feature
@block @block_blog_menu
Feature: Enable Block blog menu on the frontpage
In order to enable the blog menu on the frontpage
As an admin
I can add blog menu block to the frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | System | 1 | site-index | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
And I am on site homepage
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on site homepage
And I follow "Blog entries"
And I should see "S1 First Blog"
And I should see "This is my awesome blog!"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/blog_menu/tests/behat/block_blog_menu_course.feature
@block @block_blog_menu
Feature: Students can use block blog menu in a course
In order students to use the blog menu in a course
As a student
I view blog menu block in a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I am on the "Course 1" course page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Blog entries"
And I should see "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the course
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this course! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Course: C1"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
And I am on "Course 1" course homepage
When I follow "View my entries about this course"
Then I should see "S2 First Blog"
And I should not see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the course
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this course! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Course: C1"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
And I am on "Course 1" course homepage
When I follow "View all entries for this course"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this course! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Course: C1"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
And I am on "Course 1" course homepage
When I follow "Blog entries"
Then I should see "S2 First Blog"
And I should see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
| Blog entry body | This is my awesome blog about this course! |
And I press "Save changes"
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
| Blog entry body | My unrelated blog! |
And I press "Save changes"
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Course: C1"
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S2 First Blog |
| Blog entry body | My course blog is better! |
And I press "Save changes"
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
When I am on the "Course 1" course page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student in group high scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| assign | Test assignment | Offline text | C1 | 1 | assign1 |
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I change window size to "large"
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| assignsubmission_file_enabled | 0 |
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I press "Save and return to course"
And I turn editing mode on
And I am on the "Course 1" "grades > Grader report > View" page
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Try to configure the block on the course page to show 1 high score
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
# Students cannot see user identity fields.
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/addblockinactivity.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment 1 | Offline text | C1 | 1 | assign1 | 0 |
| assign | Test assignment 2 | Offline text | C1 | 1 | assign2 | 0 |
| assign | Test assignment 3 | Offline text | C1 | 1 | assign3 | 0 |
And the following "activities" exist:
| activity | name | content | course | section | idnumber |
| page | Test page name | This is a page | C1 | 1 | page1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment 1 | student1 | 90.00 |
| Test assignment 1 | student2 | 80.00 |
| Test assignment 1 | student3 | 70.00 |
| Test assignment 1 | student4 | 60.00 |
| Test assignment 1 | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on a non-graded activity to show 3 high scores
Given I am on the "Test page name" "page activity" page
And I add the "Activity results" block to the default region with:
| config_activitygradeitemid | Test assignment 1 |
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90.00" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "80.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
@javascript @addablocklink
Scenario: Block should select current activity by default
Given I click on "Test assignment 1" "link" in the "region-main" "region"
When I add the "Activity results..." block
Then the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 1"
And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
And I am on "Course 1" course homepage
And I click on "Test assignment 2" "link" in the "region-main" "region"
And I add the "Activity results..." block
And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 2"
And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
And I am on "Course 1" course homepage
And I click on "Test assignment 3" "link" in the "region-main" "region"
And I add the "Activity results..." block
And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 3"
And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
And I am on "Course 1" course homepage
And I click on "Test page name" "link" in the "region-main" "region"
And I add the "Activity results..." block
And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" does not match value "Test page name"
And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student in visible groups low scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| assignsubmission_file_enabled | 0 |
| groupmode | 2 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
When I am on the "Course 1" course page logged in as student1
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/addunconfiguredblock.feature
@block @block_activity_results
Feature: The activity results block doesn't displays student scores for unconfigured block
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Add the block to a the course with Javascript disabled
Given I add the "Activity results" block
Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block"
@javascript
Scenario: Add the block to a the course with Javascript enabled
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block"
Scenario: Try to configure the block on the course page in a course without activities
Given I add the "Activity results" block
When I configure the "Activity results" block
And I should see "There are not yet any activities in this course."
And I press "Save changes"
Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block"
Scenario: Try to configure the block on a resource page in a course without activities
Given the following "activity" exists:
| activity | page |
| course | C1 |
| idnumber | 0001 |
| name | Test page name |
| intro | Test page description |
| section | 1 |
| content | This is a page |
And I am on "Course 1" course homepage
When I add the "Activity results" block
And I configure the "Activity results" block
And I should see "There are not yet any activities in this course."
And I press "Save changes"
Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/highscoreswithseperategroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student in separate groups scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| section | 1 |
| assignsubmission_file_enabled | 0 |
| groupmode | 1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "100.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "100%" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "90%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "80.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "100.00" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "90.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
# Students cannot see user identity fields.
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/highscoreswithoutgroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student high scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 90.00 |
| Test assignment | student2 | 80.00 |
| Test assignment | student3 | 70.00 |
| Test assignment | student4 | 60.00 |
| Test assignment | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 0 high scores
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
Then I should see "This block's configuration currently does not allow it to show any results." in the "Activity results" "block"
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90%" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "80%" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "80.00/100.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "90.00" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "80.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
Then I should see "User S1" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should see "80.00%" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "70.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
Then I should see "User" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
And I should see "80.00%" in the "Activity results" "block"
And I should see "70.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/addunsupportedactivity.feature
@block @block_activity_results
Feature: The activity results block doesn't display student scores for unsupported activity
In order to be display student scores
As a user
I need to properly configure the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Try to configure the block to use an activity without grades
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I configure the "Activity results" block
And I set the following fields to these values:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
And I press "Save changes"
When I am on the "Test assignment" "assign activity editing" page
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
Then I should see "Error: the activity selected uses a grading method that is not supported by this block." in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student low scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| assignsubmission_file_enabled | 0 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 90.00 |
| Test assignment | student2 | 80.00 |
| Test assignment | student3 | 70.00 |
| Test assignment | student4 | 60.00 |
| Test assignment | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a absolute number
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50%" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "60%" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50.00/100.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "60.00/100.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "50.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "60.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
Then I should see "User S5" in the "Activity results" "block"
And I should see "50.00%" in the "Activity results" "block"
And I should see "User S4" in the "Activity results" "block"
And I should see "60.00%" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "70.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
Then I should see "User" in the "Activity results" "block"
And I should see "50.00%" in the "Activity results" "block"
And I should see "60.00%" in the "Activity results" "block"
And I should see "70.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/lowscoreswithscales.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student low scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
Given the following "activity" exists:
| activity | assign |
| name | Test assignment |
| intro | Offline text |
| course | C1 |
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I turn editing mode on
And I am on the "Course 1" "grades > Grader report > View" page
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using full names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_nameformat | Display full names |
Then I should see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_nameformat | Display only ID numbers |
Then I should see "User S5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should see "User S4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 3 |
| config_nameformat | Anonymous results |
Then I should see "User" in the "Activity results" "block"
And I should not see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should not see "Student 4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should not see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays students in separate groups scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activities" exist:
| activity | course | idnumber | name | assignsubmission_file_enabled | groupmode |
| assign | C1 | a1 | Test assignment | 0 | 1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70%" in the "Activity results" "block"
And I should see "Student 5" in the "Activity results" "block"
And I should see "80%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "80.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "Student 5" in the "Activity results" "block"
And I should see "80.00" in the "Activity results" "block"
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
# Students cannot see user identity fields.
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays students in groups low scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| description | Offline text |
| assignsubmission_file_enabled | 0 |
| groupmode | 1 |
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I change window size to "large"
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Try to configure the block on the course page to show 1 low score
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 1 |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I should see "Group 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
# Students cannot see user identity fields.
And I am on the "Course 1" course page logged in as student5
And I should see "User" in the "Activity results" "block"
And I should not see "User S5" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should not see "User S6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 0 |
| config_showworst | 2 |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I am on the "Course 1" course page logged in as student5
And I should see "User" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/defaultsettings.feature
@block @block_activity_results
Feature: The activity results block can have administrator set defaults
In order to be customize the activity results block
As an admin
I need can assign some site wide defaults
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Assign some site-wide defaults to the block.
Given the following config values are set as admin:
| config_showbest | 0 | block_activity_results |
| config_showworst | 0 | block_activity_results |
| config_gradeformat | 2 | block_activity_results |
| config_nameformat | 2 | block_activity_results |
And I am on "Course 1" course homepage
And I add the "Activity results" block
When I configure the "Activity results" block
And the following fields match these values:
| config_showbest | 0 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display only ID numbers |
And I press "Save changes"
Then I should see "This block's configuration currently does not allow it to show any results." in the "Activity results" "block"
Scenario: Assign some site-wide defaults to the block and lock them.
Given the following config values are set as admin:
| config_showbest | 0 | block_activity_results |
| config_showbest_locked | 1 | block_activity_results |
| config_showworst | 0 | block_activity_results |
| config_showworst_locked | 1 | block_activity_results |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
When I configure the "Activity results" block
And the following fields match these values:
| config_showbest | 0 |
| config_showworst | 0 |
And the "config_showbest" "field" should be readonly
And the "config_showworst" "field" should be readonly
And I press "Save changes"
Then I should see "This block's configuration currently does not allow it to show any results." in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature
@block @block_activity_results @javascript
Feature: The activity results block displays student in visible groups scores
In order to be display student scores
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
| student6 | Student | 6 | [email protected] | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And the following "activities" exist:
| activity | name | course | idnumber | section | assignsubmission_file_enabled | groupmode |
| assign | Test assignment | C1 | assign1 | 1 | 0 | 2 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
And I am on the "Course 1" course page logged in as student1
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Fractions |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Absolute numbers |
| config_nameformat | Display full names |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Display only ID numbers |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_gradeformat | Percentages |
| config_nameformat | Anonymous results |
| config_usegroups | Yes |
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_results/tests/behat/highscoreswithscales.feature
@block @block_activity_results @javascript
Feature: The activity results block displays students high scores in group as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
| student3 | Student | 3 | [email protected] | S3 |
| student4 | Student | 4 | [email protected] | S4 |
| student5 | Student | 5 | [email protected] | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| assignsubmission_file_enabled | 0 |
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block to the default region with:
| config_showbest | 1 |
| config_showworst | 0 |
| config_nameformat | Display full names |
| config_decimalpoints | 0 |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Display full names |
Then I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Display only ID numbers |
Then I should see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block to the default region with:
| config_showbest | 3 |
| config_showworst | 0 |
| config_nameformat | Anonymous results |
Then I should see "User" in the "Activity results" "block"
And I should not see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should not see "Student 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should not see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature
@block @block_completionstatus
Feature: Enable Block Completion in a course using manual completion by others
In order to view the completion block in a course
As a teacher
I can add completion block to a course and set up manual completion by others
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| teacher2 | Teacher | 2 | [email protected] | T2 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | teacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
Scenario: Add the block to a the course and mark a student complete.
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Teacher | 1 |
And I press "Save changes"
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Teacher" "table_row"
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
And I wait "1" seconds
And I run the scheduled task "core\task\completion_regular_task"
And I am on site homepage
And I am on the "Course 1" course page logged in as student1
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I follow "More details"
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
Scenario: Add the block to a the course and require multiple roles to mark a student complete.
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Teacher | 1 |
| Non-editing teacher | 1 |
| id_role_aggregation | ALL selected roles to mark when the condition is met |
And I press "Save changes"
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Teacher" "table_row"
And I should see "No" in the "Non-editing teacher" "table_row"
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
And I am on the "Course 1" course page logged in as student1
And I should see "Status: In progress" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I should see "No" in the "Non-editing teacher" "table_row"
And I follow "More details"
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
And I should see "No" in the "Marked complete by Non-editing teacher" "table_row"
And I am on the "Course 1" course page logged in as teacher2
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
And I wait "1" seconds
And I run the scheduled task "core\task\completion_regular_task"
And I am on site homepage
And I am on the "Course 1" course page logged in as student1
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I should see "Yes" in the "Non-editing teacher" "table_row"
And I follow "More details"
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
And I should see "Yes" in the "Marked complete by Non-editing teacher" "table_row"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature
@block @block_completionstatus @core_completion
Feature: Enable Block Completion in a course using activity completion
In order to view the completion block in a course
As a teacher
I can add completion block to a course and set up activity completion
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name | gradepass | completion | completionview | completionusegrade | completionpassgrade |
| page | C1 | page1 | Test page name | | 2 | 1 | 0 | 0 |
| assign | C1 | assign1 | Test assign name | 50 | 2 | 0 | 1 | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
Scenario: Completion status block when student has not started any activities
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Test page name | 1 |
And I press "Save changes"
When I am on the "Course 1" course page logged in as student1
Then I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "0 of 1" in the "Activity completion" "table_row"
Scenario: Completion status block when student has completed a page
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Test page name | 1 |
And I press "Save changes"
When I am on the "Test page name" "page activity" page logged in as student1
And I am on "Course 1" course homepage
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "1 of 1" in the "Activity completion" "table_row"
And I follow "More details"
And I should see "Yes" in the "Activity completion" "table_row"
Scenario: Completion status block with items with passing grade
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Test assign name | 1 |
And I press "Save changes"
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assign name | student1 | 53 |
When I am on the "Course 1" course page logged in as student1
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "1 of 1" in the "Activity completion" "table_row"
And I trigger cron
And I am on "Course 1" course homepage
And I follow "More details"
And I should see "Achieving grade, Achieving passing grade" in the "Activity completion" "table_row"
And I should see "Yes" in the "Activity completion" "table_row"
Scenario: Completion status block with items with failing grade
Given I am on the "Course 1" course page logged in as teacher1
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assign name | student1 | 49 |
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Test assign name | 1 |
And I press "Save changes"
When I am on the "Course 1" course page logged in as student1
Then I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "0 of 1" in the "Activity completion" "table_row"
And I trigger cron
And I am on "Course 1" course homepage
And I follow "More details"
And I should see "Achieving grade, Achieving passing grade" in the "Activity completion" "table_row"
And I should see "No" in the "Activity completion" "table_row"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature
@block @block_completionstatus @block_selfcompletion
Feature: Enable Block Completion in a course using manual self completion
In order to view the completion block in a course
As a teacher
I can add completion block to a course and set up manual self completion
Scenario: Add the block to a the course and manually complete the course
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I enable "selfcompletion" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
| selfcompletion | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| id_criteria_self | 1 |
And I press "Save changes"
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Self completion" "table_row"
And I follow "Complete course"
And I should see "Confirm self completion"
And I press "Yes"
And I should see "Status: In progress" in the "Course completion status" "block"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
And I wait "1" seconds
And I run the scheduled task "core\task\completion_regular_task"
And I am on "Course 1" course homepage
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "Yes" in the "Self completion" "table_row"
And I follow "More details"
And I should see "Yes" in the "Self completion" "table_row"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/completionstatus/tests/behat/block_completionstatus.feature
@block @block_completionstatus
Feature: Enable Block Completion in a course
In order to view the completion block in a course
As a teacher
I can add completion block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Add the block to a the course where completion is disabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Enable completion tracking | No |
And I press "Save and display"
When I add the "Course completion status" block
Then I should see "Completion is not enabled for this course" in the "Course completion status" "block"
Scenario: Add the block to a the course where completion is not set
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Course completion status" block
Then I should see "No completion criteria set for this course" in the "Course completion status" "block"
Scenario: Add the block to a course with criteria and view as an untracked role.
Given the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Add requirements | 1 |
| View the activity | 1 |
And I press "Save and return to course"
When I add the "Course completion status" block
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Test page name | 1 |
And I press "Save changes"
Then I should see "You are currently not being tracked by completion in this course" in the "Course completion status" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/glossary_random/tests/behat/glossary_random_addblock.feature
@block @block_glossary_random @javascript @addablocklink
Feature: Add the glossary random block when main feature is enabled
In order to add the glossary random block to my course
As a teacher
It should be added to courses only if the glossary module is enabled.
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And I am on the "C1" "course" page logged in as "admin"
Scenario: The glossary random block can be added when glossary module is enabled
Given I turn editing mode on
When I click on "Add a block" "link"
Then I should see "Random glossary entry"
Scenario: The glossary random block cannot be added when glossary module is disabled
Given I navigate to "Plugins > Activity modules > Manage activities" in site administration
And I click on "Disable Glossary" "icon" in the "Glossary" "table_row"
And I am on "Course 1" course homepage with editing mode on
When I click on "Add a block" "link"
Then I should not see "Random glossary entry"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/glossary_random/tests/behat/glossary_random_global.feature
@block @block_glossary_random
Feature: Random glossary entry block linking to global glossary
In order to show the entries from glossary
As a teacher
I can add the random glossary entry to a course page
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "activity" exists:
| activity | glossary |
| name | Tips and Tricks |
| intro | Frontpage glossary description |
| course | C2 |
| idnumber | glossary0 |
| globalglossary | 1 |
| defaultapproval | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | [email protected] |
| teacher1 | Terry1 | Teacher1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: View random (last) entry in the global glossary
When I log in as "admin"
And I am on "Course 2" course homepage
And I follow "Tips and Tricks"
And I press "Add entry"
And I set the following fields to these values:
| Concept | Never come late |
| Definition | Come in time for your classes |
And I press "Save changes"
And I log out
# As a teacher add a block to the course page linking to the global glossary.
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | Tip of the day |
| Take entries from this glossary | Tips and Tricks |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
Then I should see "Never come late" in the "Tip of the day" "block"
And I should not see "Add a new entry" in the "Tip of the day" "block"
And I should see "View all entries" in the "Tip of the day" "block"
And I log out
# Student who can't see the module is still able to view entries in this block (because the glossary was marked as global)
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "Never come late" in the "Tip of the day" "block"
And I should not see "Add a new entry" in the "Tip of the day" "block"
And I should see "View all entries" in the "Tip of the day" "block"
And I log out
Scenario: Removing the global glossary that is used in random glossary block
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | Tip of the day |
| Take entries from this glossary | Tips and Tricks |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
And I log out
And I log in as "admin"
And I am on "Course 2" course homepage
And I follow "Tips and Tricks"
And I follow "Settings"
And I set the field "globalglossary" to "0"
And I press "Save and return to course"
And I am on "Course 1" course homepage
Then I should see "Please configure this block using the edit icon." in the "Tip of the day" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And "Tip of the day" "block" should not exist
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/glossary_random/tests/behat/glossary_random.feature
@block @block_glossary_random
Feature: Random glossary entry block is used in a course
In order to show the entries from glossary
As a teacher
I can add the random glossary entry to a course page
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | [email protected] |
| teacher1 | Terry1 | Teacher1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: Student can not see the block if it is not configured
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Random glossary entry" block
Then I should see "Please configure this block using the edit icon" in the "block_glossary_random" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And "block_glossary_random" "block" should not exist
And I log out
Scenario: View random (last) entry in the glossary with auto approval
Given the following "activities" exist:
| activity | name | intro | course | idnumber | defaultapproval |
| glossary | GlossaryAuto | Test glossary description | C1 | glossary1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | AutoGlossaryblock |
| Take entries from this glossary | GlossaryAuto |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept1 |
| Definition | Definition1 |
And I press "Save changes"
And I am on "Course 1" course homepage
And I should see "Concept1" in the "AutoGlossaryblock" "block"
And I should see "Definition1" in the "AutoGlossaryblock" "block"
And I should not see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept2 |
| Definition | Definition2 |
And I press "Save changes"
And I am on "Course 1" course homepage
# Only the last entry appears in the block
And I should not see "Concept1" in the "AutoGlossaryblock" "block"
And I should not see "Definition1" in the "AutoGlossaryblock" "block"
And I should see "Concept2" in the "AutoGlossaryblock" "block"
And I should see "Definition2" in the "AutoGlossaryblock" "block"
And I click on "View all entries" "link" in the "AutoGlossaryblock" "block"
And I should see "GlossaryAuto" in the "#page-navbar" "css_element"
And I should see "Concept1" in the "#page-content" "css_element"
And I should see "Concept2" in the "#page-content" "css_element"
And I log out
Scenario: View random (last) entry in the glossary with manual approval
Given the following "activities" exist:
| activity | name | intro | course | idnumber | defaultapproval |
| glossary | GlossaryManual | Test glossary description | C1 | glossary2 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | ManualGlossaryblock |
| Take entries from this glossary | GlossaryManual |
| How a new entry is chosen | Last modified entry |
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I click on "Add a new entry" "link" in the "ManualGlossaryblock" "block"
And I set the following fields to these values:
| Concept | Concept1 |
| Definition | Definition1 |
And I press "Save changes"
And I am on "Course 1" course homepage
And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
And I follow "GlossaryManual"
And I follow "Pending approval"
And I follow "Approve"
And I click on "Course 1" "link" in the "#page-navbar" "css_element"
And I should see "Concept1" in the "ManualGlossaryblock" "block"
And I should see "Definition1" in the "ManualGlossaryblock" "block"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/glossary_random/tests/behat/glossary_random_addblock_disabled.feature
@block @block_glossary_random @javascript
Feature: Add the glossary random block when main feature is disabled
In order to add the glossary random block to my course
As a teacher
It should be added to courses only if the glossary module is enabled.
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| glossary_random | Course | C1 | course-view-* | site-post |
Scenario: The glossary random block is displayed even when glossary module is disabled
When I log in as "admin"
And I navigate to "Plugins > Activity modules > Manage activities" in site administration
And I click on "Disable Glossary" "icon" in the "Glossary" "table_row"
And I am on "Course 1" course homepage with editing mode on
Then "Random glossary entry" "block" should exist
Scenario: The glossary random block can be removed even when glossary module is disabled
When I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I open the "Random glossary entry" blocks action menu
And I click on "Delete Random glossary entry block" "link" in the "Random glossary entry" "block"
And "Delete block?" "dialogue" should exist
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
And "Random glossary entry" "block" should exist
When I navigate to "Plugins > Activity modules > Manage activities" in site administration
And I click on "Disable Glossary" "icon" in the "Glossary" "table_row"
And I am on "Course 1" course homepage with editing mode on
And I open the "Random glossary entry" blocks action menu
And I click on "Delete Random glossary entry block" "link" in the "Random glossary entry" "block"
And I click on "Delete" "button" in the "Delete block?" "dialogue"
Then "Random glossary entry" "block" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/glossary_random/tests/behat/glossary_random_frontpage.feature
@block @block_glossary_random
Feature: Random glossary entry block can be added to the frontpage
In order to show the entries from glossary on the frontpage
As a teacher
I can add the random glossary entry to the frontpage
Scenario: Admin can add random glossary block to the frontpage
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
| Title | Tip of the day |
| Take entries from this glossary | Tips and Tricks |
And I press "Save changes"
And I click on "Add a new entry" "link" in the "Tip of the day" "block"
And I set the following fields to these values:
| Concept | Never come late |
| Definition | Come in time for your classes |
And I press "Save changes"
When I log out
Then I should see "Never come late" in the "Tip of the day" "block"
And I should see "Come in time for your classes" in the "Tip of the day" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/recentlyaccesseditems/tests/behat/block_recentlyaccesseditems_dashboard.feature
@block @block_recentlyaccesseditems @javascript
Feature: The recently accessed items block allows users to easily access their most recently visited items
In order to access the most recent items accessed
As a user
I can use the recently accessed items block in my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| idnumber | Test forum name |
| name | Test forum name |
And I log in as "student1"
@accessibility
Scenario: User has not accessed any item
Then I should see "No recent items" in the "Recently accessed items" "block"
And the page should meet accessibility standards
@accessibility
Scenario: User has accessed some items
Given I change window size to "large"
When I am on the "Test forum name" "forum activity" page
And I follow "Dashboard"
Then I should see "Test forum name" in the "Recently accessed items" "block"
And I should not see "Show more items" in the "Recently accessed items" "block"
And the page should meet accessibility standards
Scenario: User has accessed more than 3 items
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| assign | Test assignment name | Test assignment description | C1 | assign1 |
| book | Test book name | | C1 | book1 |
| choice | Test choice name | Test choice description | C1 | choice1 |
| data | Test database name | Test database description | C1 | data1 |
And I change window size to "large"
And I am on the "Test forum name" "forum activity" page
And I am on the "Test database name" "data activity" page
And I am on the "Test assignment name" "assign activity" page
And I am on the "Test book name" "book activity" page
And I am on the "Test choice name" "choice activity" page
When I follow "Dashboard"
Then I should see "Show more items" in the "Recently accessed items" "block"
And I should not see "Test forum name" in the "Recently accessed items" "block"
And I click on "Show more items" "button" in the "Recently accessed items" "block"
And I should see "Test forum name" in the "Recently accessed items" "block"
And I turn editing mode on
And I am on homepage
And I configure the "Recently accessed items" block
And I set the following fields to these values:
| Region | content |
And I press "Save changes"
And I turn editing mode off
And I should not see "Show more items" in the "Recently accessed items" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/timeline/tests/behat/block_timeline_search.feature
@block @block_timeline @javascript
Feature: The timeline block allows users to search for upcoming activities
As a student
I can search for the upcoming activities in the timeline block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##first day of next month## | ##last day of next month## |
| Course 4 | C4 | 0 | ##1 month ago## | ##tomorrow## |
| Course 5 | C5 | 0 | ##first day of last month## | ##last day of next month## |
| Course with advanced name | C6 | 0 | ##first day of last month## | ##last day of next month## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose | duedate |
| choice | C2 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## | |
| choice | C1 | choice2 | Test choice 2 | Test choice description | ##first day of +5 months## | ##last day of +5 months## | |
| choice | C3 | choice3 | Test choice 3 | Test choice description | ##first day of +5 months## | ##last day of +10 months## | |
| choice | C2 | choice4 | Test choice 4 | Test choice description | ##first day of +5 months## | ##last day of +15 months## | |
| choice | C1 | choice5 | Test choice 5 | Test choice description | ##first day of +5 months## | ##last day of +20 months## | |
| choice | C3 | choice6 | Test choice 6 | Test choice description | ##first day of +5 months## | ##last day of +25 months## | |
| choice | C4 | choice7 | Test choice 7 | Test choice description | ##first day of +5 months## | ##last day of +5 months## | |
| choice | C5 | choice8 | Test choice 8 | Test choice description | ##first day of +5 months## | ##last day of +10 months## | |
| feedback | C2 | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow## | |
| feedback | C1 | feedback2 | Test feedback 2 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## | |
| feedback | C3 | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +10 months## | |
| assign | C6 | assign1 | Assign with advanced name | Test assign description | ##yesterday## | | ##tomorrow## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
Scenario: The search should return no events if I enter the wrong value
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "Fake example"
Then I should see "No activities require action" in the "Timeline" "block"
Scenario: Search for Course name
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "Course 1"
Then I should see "Test choice 2" in the "Timeline" "block"
And I should see "Test choice 5" in the "Timeline" "block"
And I should see "Test feedback 2" in the "Timeline" "block"
And I should not see "Test choice 1" in the "Timeline" "block"
And I should not see "Test choice 3" in the "Timeline" "block"
And I should not see "Test choice 4" in the "Timeline" "block"
And I should not see "Test feedback 1" in the "Timeline" "block"
And I should not see "Test feedback 3" in the "Timeline" "block"
Scenario: Search for Course name - Advanced
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "Course advanced"
Then I should see "Assign with advanced name" in the "Timeline" "block"
Scenario: Search for Activity name
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "Test choice 1"
And I wait until "Test choice 2" "text" does not exist
Then I should see "Test choice 1" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
And I should not see "Test choice 3" in the "Timeline" "block"
And I should not see "Test choice 4" in the "Timeline" "block"
And I should not see "Test choice 5" in the "Timeline" "block"
And I should not see "Test choice 6" in the "Timeline" "block"
And I should not see "Test feedback 1" in the "Timeline" "block"
And I should not see "Test feedback 2" in the "Timeline" "block"
And I should not see "Test feedback 3" in the "Timeline" "block"
Scenario: Search for Activity name - Advanced
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "Assign advanced"
Then I should see "Assign with advanced name" in the "Timeline" "block"
Scenario: Search for Activity type
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "feedback"
Then I should see "Test feedback 1" in the "Timeline" "block"
And I should see "Test feedback 2" in the "Timeline" "block"
And I should see "Test feedback 3" in the "Timeline" "block"
And I should not see "Test choice 1" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
And I should not see "Test choice 3" in the "Timeline" "block"
And I should not see "Test choice 4" in the "Timeline" "block"
And I should not see "Test choice 5" in the "Timeline" "block"
Scenario: Timeline paginated search
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I set the field "Search" in the "Timeline" "block" to "choice"
Then I should see "Test choice 1" in the "Timeline" "block"
And I should see "Test choice 2" in the "Timeline" "block"
And I should see "Test choice 3" in the "Timeline" "block"
And I should see "Test choice 7" in the "Timeline" "block"
And I should see "Test choice 8" in the "Timeline" "block"
And I should not see "Test choice 4" in the "Timeline" "block"
And I should not see "Test choice 5" in the "Timeline" "block"
And I should not see "Test choice 6" in the "Timeline" "block"
And I click on "Show more activities" "button"
And I should see "Test choice 4" in the "Timeline" "block"
And I should see "Test choice 5" in the "Timeline" "block"
And I should see "Test choice 6" in the "Timeline" "block"
Scenario: Courses view is refreshed when search changes
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Test choice 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Test choice 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Test choice 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Test choice 7" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Test choice 8" in the ".block-timeline [data-region='view-courses']" "css_element"
When I set the field "Search by activity type or name" to "choice 1"
And I wait until "Course 4" "text" does not exist
Then I should see "Test choice 1" in the "Timeline" "block"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Test choice 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Test choice 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Test choice 7" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Test choice 8" in the ".block-timeline [data-region='view-courses']" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/timeline/tests/behat/block_timeline_lazy_loading.feature
@block @block_timeline @javascript
Feature: The timeline block allows users to use the lazy loading to view more activities
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##yesterday## | ##last day of next month## |
| Course 2 | C2 | 0 | ##yesterday## | ##last day of next month## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose |
| choice | C1 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## |
| choice | C1 | choice2 | Test choice 2 | Test choice description | ##yesterday## | ##+1 days## |
| choice | C1 | choice3 | Test choice 3 | Test choice description | ##yesterday## | ##+2 days## |
| choice | C1 | choice4 | Test choice 4 | Test choice description | ##yesterday## | ##+3 days## |
| choice | C1 | choice5 | Test choice 5 | Test choice description | ##yesterday## | ##+4 days## |
| choice | C1 | choice6 | Test choice 6 | Test choice description | ##yesterday## | ##+5 days## |
| choice | C1 | choice7 | Test choice 7 | Test choice description | ##yesterday## | ##+6 days## |
| choice | C1 | choice8 | Test choice 8 | Test choice description | ##yesterday## | ##+7 days## |
| choice | C1 | choice9 | Test choice 9 | Test choice description | ##yesterday## | ##+8 days## |
| choice | C1 | choice10 | Test choice 10 | Test choice description | ##yesterday## | ##+9 days## |
| choice | C2 | choice10 | Test choice 11 | Test choice description | ##yesterday## | ##+9 days## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | duedate |
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
Scenario: Lazy loading for date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "All" "link" in the "Timeline" "block"
Then I should see "Test choice 1" in the "Timeline" "block"
And "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And "Test choice 2" "link" should exist in the "Timeline" "block"
And "Test choice 3" "link" should exist in the "Timeline" "block"
And "Test choice 4" "link" should exist in the "Timeline" "block"
And "Test choice 5" "link" should not exist in the "Timeline" "block"
And "Test choice 6" "link" should not exist in the "Timeline" "block"
And "Test choice 7" "link" should not exist in the "Timeline" "block"
And "Test choice 8" "link" should not exist in the "Timeline" "block"
And "Test choice 9" "link" should not exist in the "Timeline" "block"
And "Test choice 10" "link" should not exist in the "Timeline" "block"
And "Test choice 11" "link" should not exist in the "Timeline" "block"
And I click on "Show more activities" "button" in the "[data-region='view-dates']" "css_element"
And "Test choice 5" "link" should exist in the "Timeline" "block"
And "Test choice 6" "link" should exist in the "Timeline" "block"
And "Test choice 7" "link" should exist in the "Timeline" "block"
And "Test choice 8" "link" should exist in the "Timeline" "block"
And "Test choice 9" "link" should exist in the "Timeline" "block"
And "Test choice 10" "link" should exist in the "Timeline" "block"
And "Test choice 11" "link" should exist in the "Timeline" "block"
Scenario: Lazy loading for course view
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
When I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And "Test choice 2" "link" should exist in the "Timeline" "block"
And "Test choice 3" "link" should exist in the "Timeline" "block"
And "Test choice 4" "link" should exist in the "Timeline" "block"
And "Test choice 5" "link" should exist in the "Timeline" "block"
And "Test choice 11" "link" should exist in the "Timeline" "block"
And "Test choice 6" "link" should not exist in the "Timeline" "block"
And "Test choice 7" "link" should not exist in the "Timeline" "block"
And "Test choice 8" "link" should not exist in the "Timeline" "block"
And "Test choice 9" "link" should not exist in the "Timeline" "block"
And "Test choice 10" "link" should not exist in the "Timeline" "block"
And I click on "Show more activities" "button" in the "[data-region='view-courses']" "css_element"
And "Test choice 6" "link" should exist in the "Timeline" "block"
And "Test choice 7" "link" should exist in the "Timeline" "block"
And "Test choice 8" "link" should exist in the "Timeline" "block"
And "Test choice 9" "link" should exist in the "Timeline" "block"
And "Test choice 10" "link" should exist in the "Timeline" "block"
Scenario: The lazy loading button will not be shown if the number of events is smaller than 5
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by dates" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And "Show more activities" "button" should not exist in the "[data-region='view-courses']" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/timeline/tests/behat/block_timeline_courses_overdue.feature
@block @block_timeline @javascript
Feature: The timeline block allows users to see courses with overdue activities
In order to view overdue activities in the timeline block
As a student
I can select the overdue filter in courses view
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##now -3 months## | ##tomorrow## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | 0 | ##yesterday## | ##tomorrow## |
| Course 5 | C5 | 0 | ##yesterday## | ##tomorrow## |
| Course 6 | C6 | 0 | ##yesterday## | ##tomorrow## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | duedate |
| assign | C1 | assign1 | Test assign 1 | Assign due last month | ##now -2 months## | ##now -1 month## |
| assign | C2 | assign2 | Test assign 2 | Assign due yesterday | ##now -2 days## | ##yesterday## |
| assign | C3 | assign3 | Test assign 3 | Assign due yesterday | ##now -2 days## | ##yesterday## |
| assign | C4 | assign4 | Test assign 4 | Assign due later today | ##yesterday## | ##now +10 minutes## |
| assign | C5 | assign5 | Test assign 5 | Assign due yesterday | ##now -2 days## | ##yesterday## |
| assign | C6 | assign6 | Test assign 6 | Assign due tomorrow | ##yesterday## | ##tomorrow## |
Scenario: No activities to display as overdue displays expected message
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C4 | student |
| student1 | C6 | student |
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
Then I should see "No activities require action" in the "Timeline" "block"
And I reload the page
And I should see "No activities require action" in the "Timeline" "block"
Scenario: If filtering by overdue, only courses with a matching item are included
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
When I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Overdue" "link" in the "Timeline" "block"
Then I should not see "Show more courses" in the "Timeline" "block"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And I reload the page
And I should not see "Show more courses" in the "Timeline" "block"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
Scenario: If filtering by overdue, only courses with a matching item are included and loading more is supported
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
When I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Overdue" "link" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
Then I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Show more courses" in the "Timeline" "block"
And I reload the page
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/timeline/tests/behat/block_timeline_dates.feature
@block @block_timeline @javascript
Feature: The timeline block allows users to see upcoming activities
In order to enable the timeline block
As a student
I can add the timeline block to my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##first day of next month## | ##last day of next month## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose |
| choice | C2 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## |
| choice | C1 | choice2 | Test choice 2 | Test choice description | ##1 month ago## | ##15 days ago## |
| choice | C3 | choice3 | Test choice 3 | Test choice description | ##first day of +5 months## | ##last day of +5 months## |
| feedback | C2 | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow## |
| feedback | C1 | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months## |
| feedback | C3 | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
| feedback | C2 | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##now +1 minute## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | duedate |
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
| assign | C2 | assign2 | Test assign 2 | Test assign description | ##yesterday## | ##now -1 minute## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
And I change window size to "large"
Scenario: Next 7 days in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Next 7 days" "link" in the "Timeline" "block"
Then "Test choice 1" "link" should exist in the "Timeline" "block"
And I should see "Choice closes · Course 2" in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 2" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test assign 1" "link" should not exist in the "Timeline" "block"
And I should not see "Assignment is due · Course 1" in the "Timeline" "block"
Scenario: Overdue in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 1" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
And "Test choice 1" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
Scenario: All in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "All" "link" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 1" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 2" in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 2" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And I should see "Choice closes · Course 2" in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 2" in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And I click on "Show more activities" "button"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 1" in the "Timeline" "block"
And "Test choice 3" "link" should exist in the "Timeline" "block"
And I should see "Test assign 1" in the "Timeline" "block"
And I should see "Test feedback 1" in the "Timeline" "block"
And I should see "Test choice 1" in the "Timeline" "block"
And I should see "Test choice 3" in the "Timeline" "block"
And I should see "Test feedback 3" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
Scenario: Persistent All in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "All" "link" in the "Timeline" "block"
And I reload the page
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 1" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 2" in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 2" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And I should see "Choice closes · Course 2" in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 2" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
And I should not see "Test feedback 2" in the "Timeline" "block"
And I click on "Show more activities" "button"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes · Course 1" in the "Timeline" "block"
And I should see "Test assign 1" in the "Timeline" "block"
And I should see "Test feedback 1" in the "Timeline" "block"
And I should see "Test feedback 3" in the "Timeline" "block"
And I should see "Test choice 1" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
And I should see "Test choice 3" in the "Timeline" "block"
Scenario: Persistent Overdue in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
And I reload the page
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 1" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due · Course 2" in the "Timeline" "block"
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
And "Test choice 1" "link" should not exist in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
Scenario: Current filtering always applies in date view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Overdue" "link" in the "Timeline" "block"
And I reload the page
And "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
# Confirm that when we switch back to date view, the "All" filer continues to be applied (and not "overdue")
When I click on "All" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by dates" "link" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And I click on "Show more activities" "button"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
Scenario: Student not enrolled in any courses sees a message
Given I log in as "student2"
When I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by dates" "link" in the "Timeline" "block"
Then I should see "No in-progress courses" in the "Timeline" "block"
And I should not see "Test choice 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/timeline/tests/behat/block_timeline_courses.feature
@block @block_timeline @javascript
Feature: The timeline block allows users to see upcoming courses
In order to enable the timeline block
As a student
I can add the timeline block to my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate |
| Course 1 | C1 | 0 | ##yesterday## | ##tomorrow## |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
| Course 4 | C4 | 0 | ##first day of next month## | ##last day of next month## |
| Course 5 | C5 | 0 | ##yesterday## | ##tomorrow## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose |
| choice | C2 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## |
| choice | C1 | choice2 | Test choice 2 | Test choice description | ##1 month ago## | ##15 days ago## |
| choice | C3 | choice3 | Test choice 3 | Test choice description | ##first day of +5 months## | ##last day of +5 months## |
| feedback | C2 | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow## |
| feedback | C1 | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months## |
| feedback | C3 | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
| feedback | C4 | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##tomorrow## |
| feedback | C1 | feedback5 | Test feedback 5 | Test feedback description | ##yesterday## | ##now +1 minute## |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | duedate |
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
| assign | C2 | assign2 | Test assign 2 | Test assign description | ##yesterday## | ##now -1 minute## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
Scenario: Next 30 days in course view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Next 30 days" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
When I click on "Sort by courses" "link" in the "Timeline" "block"
Then I should see "Course 1" in the ".block_timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block_timeline [data-region='view-courses']" "css_element"
And I should see "Show more courses" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 4" in the ".block_timeline [data-region='view-courses']" "css_element"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And I should see "Choice closes" in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And I should see "Feedback closes" in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
And "Test feedback 5" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should not see "Course 3" in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test assign 1" "link" should not exist in the "Timeline" "block"
Scenario: All in course view
Given I log in as "student1"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
When I click on "Show more courses" "button" in the "Timeline" "block"
Then I should see "Course 3" in the "Timeline" "block"
And I should see "Course 2" in the "Timeline" "block"
And I should see "Course 1" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And "Test choice 3" "link" should exist in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
And "Test feedback 3" "link" should exist in the "Timeline" "block"
And "Test feedback 5" "link" should exist in the "Timeline" "block"
And "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should see "Assignment is due" in the "Timeline" "block"
And I should see "Choice closes" in the "Timeline" "block"
And I should see "Course 4" in the "Timeline" "block"
And I should see "Test feedback 4" in the "Timeline" "block"
And I should not see "Show more courses" in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
Scenario: Persistent sort filter
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by dates" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
When I reload the page
Then I should see "Course 1" in the "Timeline" "block"
And I should see "Course 2" in the "Timeline" "block"
And I should see "Show more courses" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 4" in the ".block_timeline [data-region='view-courses']" "css_element"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
And "Test feedback 5" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should not see "Course 3" in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test assign 1" "link" should not exist in the "Timeline" "block"
Scenario: Persistent All in course view
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
When I reload the page
And I should not see "Course 3" in the "Timeline" "block"
And I should see "Course 2" in the "Timeline" "block"
And I should see "Course 1" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
Then I should see "Course 3" in the "Timeline" "block"
And I should see "Course 2" in the "Timeline" "block"
And I should see "Course 1" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And "Test choice 3" "link" should exist in the "Timeline" "block"
And "Test feedback 1" "link" should exist in the "Timeline" "block"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
And "Test feedback 3" "link" should exist in the "Timeline" "block"
And "Test assign 1" "link" should exist in the "Timeline" "block"
And I should not see "Show more courses" in the "Timeline" "block"
And I should see "Course 4" in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 4" "link" should exist in the "Timeline" "block"
Scenario: Current filtering always applies in courses view
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Overdue" "link" in the "Timeline" "block"
And I reload the page
And "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by dates" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
# Confirm that when we switch back to courses view, the "All" filer continues to be applied (and not "overdue").
When I click on "All" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test feedback 2" "link" should exist in the "Timeline" "block"
Scenario: Overdue in course view
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And I should not see "Test feedback 1" in the "Timeline" "block"
And I should not see "Test feedback 2" in the "Timeline" "block"
And I should not see "Test feedback 3" in the "Timeline" "block"
And I should not see "Test feedback 4" in the "Timeline" "block"
And I should not see "Test feedback 5" in the "Timeline" "block"
And I should not see "Test choice 1" in the "Timeline" "block"
And I should not see "Test choice 2" in the "Timeline" "block"
And I should not see "Test choice 3" in the "Timeline" "block"
Scenario: Persistent Overdue in course view
Given I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
When I click on "Overdue" "link" in the "Timeline" "block"
And I reload the page
Then "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
And "Test feedback 5" "link" should not exist in the "Timeline" "block"
And "Test choice 1" "link" should not exist in the "Timeline" "block"
And "Test choice 2" "link" should not exist in the "Timeline" "block"
And "Test choice 3" "link" should not exist in the "Timeline" "block"
Scenario: Student not enrolled in any courses sees a message
Given I log in as "student2"
When I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
Then I should see "No in-progress courses" in the "Timeline" "block"
And I should not see "Test choice 1"
Scenario: Only courses with matching events are displayed and are refreshed when filtering changes
Given the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | duedate |
| assign | C5 | assign3 | Test assign 3 | Test assign description | ##yesterday## | ##now +1 minute## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C5 | student |
When I log in as "student1"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
And I click on "Sort by courses" "link" in the "Timeline" "block"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "All" "link" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test feedback 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Overdue" "link" in the "Timeline" "block"
Then I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 3" in the "Timeline" "block"
And I should not see "Course 5" in the "Timeline" "block"
And I should not see "Show more courses" in the "Timeline" "block"
And "Test assign 1" "link" should exist in the "Timeline" "block"
And "Test assign 2" "link" should exist in the "Timeline" "block"
And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 2" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test feedback 5" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
And I click on "Next 7 days" "link" in the "Timeline" "block"
And I click on "Show more courses" "button" in the "Timeline" "block"
And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
And I should not see "Course 3" in the "Timeline" "block"
And I should not see "Show more courses" in the "Timeline" "block"
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test feedback 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 2" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
And "Test choice 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/recentlyaccessedcourses/tests/behat/block_recentlyaccessedcourses_dashboard.feature
@block @block_recentlyaccessedcourses @javascript
Feature: The recently accessed courses block allows users to easily access their most recently accessed courses
In order to access the most recently accessed courses
As a user
I can use the Recently accessed courses block in my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
And the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 3 | C3 | 0 |
| Course 4 | C4 | CATA |
| Course 5 | C5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recentlyaccessedcourses | System | 1 | my-index | content |
Scenario: User has not accessed any course
Given I log in as "student1"
Then I should see "No recent courses" in the "Recently accessed courses" "block"
Scenario: User has accessed two courses
Given I log in as "student1"
And I should not see "Course 1" in the "Recently accessed courses" "block"
And I should not see "Course 2" in the "Recently accessed courses" "block"
When I am on "Course 1" course homepage
And I am on "Course 2" course homepage
And I follow "Dashboard"
And I change window size to "large"
Then I should see "Course 1" in the "Recently accessed courses" "block"
And I should see "Course 2" in the "Recently accessed courses" "block"
And I should not see "Course 3" in the "Recently accessed courses" "block"
And I should not see "Course 4" in the "Recently accessed courses" "block"
And I should not see "Course 5" in the "Recently accessed courses" "block"
Scenario: Show course category name
Given the following config values are set as admin:
| displaycategories | 1 | block_recentlyaccessedcourses |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on "Course 4" course homepage
And I follow "Dashboard"
And I should see "Category 1" in the "Recently accessed courses" "block"
And I should see "Category A" in the "Recently accessed courses" "block"
Scenario: Hide course category name
Given the following config values are set as admin:
| displaycategories | 0 | block_recentlyaccessedcourses |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on "Course 4" course homepage
And I follow "Dashboard"
And I should not see "Category 1" in the "Recently accessed courses" "block"
And I should not see "Category A" in the "Recently accessed courses" "block"
Scenario: Show short course name
Given the following config values are set as admin:
| courselistshortnames | 1 |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on "Course 4" course homepage
And I follow "Dashboard"
And I should see "C1" in the "Recently accessed courses" "block"
And I should see "C4" in the "Recently accessed courses" "block"
Scenario: Hide short course name
Given the following config values are set as admin:
| courselistshortnames | 0 |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on "Course 4" course homepage
And I follow "Dashboard"
And I should not see "C1" in the "Recently accessed courses" "block"
And I should not see "C4" in the "Recently accessed courses" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/online_users/tests/behat/block_online_users_frontpage.feature
@block @block_online_users
Feature: The online users block allow you to see who is currently online on frontpage
There should be some commonality for the users to show up
In order to enable the online users block on the frontpage
As an admin
I can add the online users block to the frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
| student2 | Student | 2 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: View the online users block on the front page and see myself
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I add the "Online users" block
Then I should see "Admin User" in the "Online users" "block"
And I should see "1 online user" in the "Online users" "block"
Scenario: View the online users block on the front page as a logged in user
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Online users" block
And I log out
And I log in as "student2"
And I log out
When I log in as "student1"
And I am on site homepage
Then I should not see "Admin User" in the "Online users" "block"
And I should see "Other users (1)" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
Scenario: View the online users block on the front page as a guest
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Online users" block
And I log out
And I log in as "student2"
And I log out
And I log in as "student1"
And I log out
When I log in as "guest"
And I am on site homepage
Then I should not see "Admin User" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I should not see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
@javascript
Scenario: Hide/show user's online status from/to other users in the online users block on front page
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Online users" block
And I log out
When I log in as "student1"
And I am on site homepage
Then "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "student2"
And I am on site homepage
Then I should see "2 online user" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
When I log in as "student1"
And I am on site homepage
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "student2"
And I am on site homepage
Then I should see "3 online users" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
@javascript
Scenario: Hide/show icon is not visible in the online users block on front page when the setting is disabled
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Online users" block
And I log out
And I log in as "student1"
And I am on site homepage
And "Hide" "icon" should exist in the ".block.block_online_users" "css_element"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
When I log in as "student1"
And I am on site homepage
Then I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should not exist in the ".block.block_online_users" "css_element"
@javascript
Scenario: User is displayed in the online users block on front page when visibility setting is disabled,
ignoring the previously set visibility state
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Online users" block
And I log out
And I log in as "student1"
And I am on site homepage
And "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
And "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
And I log in as "student2"
And I am on site homepage
And I should see "2 online user" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
And I log in as "student2"
When I am on site homepage
Then I should see "3 online users" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/online_users/tests/behat/block_online_users_dashboard.feature
@block @block_online_users
Feature: The online users block allow you to see who is currently online on dashboard
There should be some commonality for the users to show up
In order to use the online users block on the dashboard
As a user
I can view the online users block on my dashboard
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
| student2 | Student | 2 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | System | 1 | my-index | side-post |
Scenario: View the online users block on the dashboard and see myself
Given I log in as "teacher1"
Then I should see "Teacher 1" in the "Online users" "block"
And I should see "1 online user" in the "Online users" "block"
Scenario: View the online users block on the dashboard and see other logged in users
Given I log in as "student2"
And I log out
And I log in as "student1"
And I log out
When I log in as "teacher1"
Then I should see "Teacher 1" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
@javascript
Scenario: Hide/show user's online status from/to other users in the online users block on dashboard
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "student1"
And I should see "1 online user" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "student2"
Then I should see "1 online user" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
When I log in as "student1"
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "student2"
Then I should see "2 online users" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
@javascript
Scenario: Hide/show icon is not visible in the online users block when the setting is disabled
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "student1"
And I should see "1 online user" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should exist in the ".block.block_online_users" "css_element"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
When I log in as "student1"
Then I should see "1 online user" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should not exist in the ".block.block_online_users" "css_element"
@javascript
Scenario: User is displayed in the online users block when visibility setting is disabled,
ignoring the previously set visibility state
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "student1"
And I should see "1 online user" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
And "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
And I log in as "student2"
And I should see "1 online user" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
When I log in as "student2"
Then I should see "2 online users" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/online_users/tests/behat/block_online_users_course.feature
@block @block_online_users
Feature: The online users block allow you to see who is currently online
In order to enable the online users block on an course page
As a teacher
I can add the online users block to a course page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
| student2 | Student | 2 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Add the online users on course page and see myself
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Online users" block
Then I should see "Teacher 1" in the "Online users" "block"
And I should see "1 online user" in the "Online users" "block"
Scenario: Add the online users on course page and see other logged in users
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Online users" block
And I log out
And I log in as "student2"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "Teacher 1" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should not see "Student 2" in the "Online users" "block"
And I should see "2 online users" in the "Online users" "block"
@javascript
Scenario: Hide/show user's online status from/to other users in the online users block on course page
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Online users" block
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
Then I should see "1 online user" in the "Online users" "block"
And I should see "Teacher 1" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then "Show" "icon" should exist in the "#change-user-visibility" "css_element"
When I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
Then "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
Then I should see "2 online users" in the "Online users" "block"
And I should see "Teacher 1" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
@javascript
Scenario: Hide/show icon is not visible in the online users block on course page when the setting is disabled
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Online users" block
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And "Hide" "icon" should exist in the ".block.block_online_users" "css_element"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "Student 1" in the "Online users" "block"
And "Hide" "icon" should not exist in the ".block.block_online_users" "css_element"
@javascript
Scenario: User is displayed in the online users block on course page when visibility setting is disabled,
ignoring the previously set visibility state
Given the following config values are set as admin:
| block_online_users_onlinestatushiding | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Online users" block
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And "Hide" "icon" should exist in the "#change-user-visibility" "css_element"
And I click on "#change-user-visibility" "css_element"
And I wait "1" seconds
And "Show" "icon" should exist in the "#change-user-visibility" "css_element"
And I log out
And the following config values are set as admin:
| block_online_users_onlinestatushiding | 0 |
And I log in as "teacher1"
When I am on "Course 1" course homepage
Then I should see "2 online users" in the "Online users" "block"
And I should see "Teacher 1" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/badges/tests/behat/block_badges_course.feature
@block @block_badges @core_badges @_file_upload @javascript
Feature: Enable Block Badges in a course
In order to enable the badges block in a course
As a teacher
I can add badges block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
# Issue badge 1 of 2
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
| id_name | Badge 1 |
| id_description | Badge 1 |
And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
And I press "Create badge"
And I select "Manual issue by role" from the "Add badge criteria" singleselect
And I set the field "Teacher" to "1"
And I press "Save"
And I press "Enable access"
And I press "Continue"
And I select "Recipients (0)" from the "jump" singleselect
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 ([email protected])"
And I press "Award badge"
# Issue Badge 2 of 2
And I am on "Course 1" course homepage
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
| id_name | Badge 2 |
| id_description | Badge 2 |
And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
And I press "Create badge"
And I select "Manual issue by role" from the "Add badge criteria" singleselect
And I set the field "Teacher" to "1"
And I press "Save"
And I press "Enable access"
And I press "Continue"
And I select "Recipients (0)" from the "jump" singleselect
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 ([email protected])"
And I press "Award badge"
And I log out
Scenario: Add the recent badges block to a course.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Latest badges" block
Then I should see "Badge 1" in the "Latest badges" "block"
And I should see "Badge 2" in the "Latest badges" "block"
Scenario: Add the recent badges block to a course and limit it to only display 1 badge.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Latest badges" block
And I configure the "Latest badges" block
And I set the following fields to these values:
| Number of latest badges to display | 1 |
And I press "Save changes"
Then I should see "Badge 2" in the "Latest badges" "block"
And I should not see "Badge 1" in the "Latest badges" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/badges/tests/behat/block_badges.feature
@block @block_badges
Feature: Enable Block Badges in a course without badges
In order to view the badges block in a course
As a teacher
I can add badges block to a course and view the contents
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Add the block to a the course when badges are disabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Latest badges" block
And the following config values are set as admin:
| enablebadges | 0 |
And I reload the page
Then I should see "Badges are not enabled on this site." in the "Latest badges" "block"
Scenario: Add the block to a the course when badges are enabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Latest badges" block
Then I should see "You have no badges to display" in the "Latest badges" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/badges/tests/behat/block_badges_dashboard.feature
@block @block_badges @core_badges @_file_upload @javascript
Feature: Enable Block Badges on the dashboard and view awarded badges
In order to view recent badges on the dashboard
As a teacher
I can add badges block to the dashboard
Scenario: Add the recent badges block to a course.
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| badges | System | 1 | my-index | side-post |
And I log in as "teacher1"
And I am on "Course 1" course homepage
# Issue badge 1 of 2
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
| id_name | Badge 1 |
| id_description | Badge 1 |
And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
And I press "Create badge"
And I select "Manual issue by role" from the "Add badge criteria" singleselect
And I set the field "Teacher" to "1"
And I press "Save"
And I press "Enable access"
And I press "Continue"
And I select "Recipients (0)" from the "jump" singleselect
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 ([email protected])"
And I press "Award badge"
And I log out
When I log in as "teacher1"
Then I should see "Badge 1" in the "Latest badges" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/badges/tests/behat/block_badges_frontpage.feature
@block @block_badges @core_badges @_file_upload @javascript
Feature: Enable Block Badges on the frontpage and view awarded badges
In order to enable the badges block on the frontpage
As a admin
I can add badges block to the frontpage
Scenario: Add the recent badges block on the frontpage and view recent badges
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| badges | System | 1 | site-index | side-pre |
And I am on the "Course 1" course page logged in as teacher1
# Issue badge 1 of 2
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
| id_name | Badge 1 |
| id_description | Badge 1 |
And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
And I press "Create badge"
And I select "Manual issue by role" from the "Add badge criteria" singleselect
And I set the field "Teacher" to "1"
And I press "Save"
And I press "Enable access"
And I press "Continue"
And I select "Recipients (0)" from the "jump" singleselect
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 ([email protected])"
And I press "Award badge"
When I am on site homepage
Then I should see "Badge 1" in the "Latest badges" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/activity_modules/tests/behat/block_activity_modules.feature
@block @block_activity_modules
Feature: Block activity modules
In order to overview activity modules in a course
As a manager
I can add activities block in a course or on the frontpage
Scenario: Add activities block on the frontpage
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| assign | Frontpage assignment name | Frontpage assignment description | Acceptance test site | assign0 |
| book | Frontpage book name | Frontpage book description | Acceptance test site | book0 |
| chat | Frontpage chat name | Frontpage chat description | Acceptance test site | chat0 |
| choice | Frontpage choice name | Frontpage choice description | Acceptance test site | choice0 |
| data | Frontpage database name | Frontpage database description | Acceptance test site | data0 |
| feedback | Frontpage feedback name | Frontpage feedback description | Acceptance test site | feedback0 |
| forum | Frontpage forum name | Frontpage forum description | Acceptance test site | forum0 |
| label | Frontpage label name | Frontpage label description | Acceptance test site | label0 |
| lti | Frontpage lti name | Frontpage lti description | Acceptance test site | lti0 |
| page | Frontpage page name | Frontpage page description | Acceptance test site | page0 |
| quiz | Frontpage quiz name | Frontpage quiz description | Acceptance test site | quiz0 |
| resource | Frontpage resource name | Frontpage resource description | Acceptance test site | resource0 |
| imscp | Frontpage imscp name | Frontpage imscp description | Acceptance test site | imscp0 |
| folder | Frontpage folder name | Frontpage folder description | Acceptance test site | folder0 |
| glossary | Frontpage glossary name | Frontpage glossary description | Acceptance test site | glossary0 |
| scorm | Frontpage scorm name | Frontpage scorm description | Acceptance test site | scorm0 |
| lesson | Frontpage lesson name | Frontpage lesson description | Acceptance test site | lesson0 |
| survey | Frontpage survey name | Frontpage survey description | Acceptance test site | survey0 |
| url | Frontpage url name | Frontpage url description | Acceptance test site | url0 |
| wiki | Frontpage wiki name | Frontpage wiki description | Acceptance test site | wiki0 |
| workshop | Frontpage workshop name | Frontpage workshop description | Acceptance test site | workshop0 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Activities" block
And I click on "Assignments" "link" in the "Activities" "block"
Then I should see "Frontpage assignment name"
And I am on site homepage
And I click on "Chats" "link" in the "Activities" "block"
And I should see "Frontpage chat name"
And I am on site homepage
And I click on "Choices" "link" in the "Activities" "block"
And I should see "Frontpage choice name"
And I am on site homepage
And I click on "Databases" "link" in the "Activities" "block"
And I should see "Frontpage database name"
And I am on site homepage
And I click on "Feedback" "link" in the "Activities" "block"
And I should see "Frontpage feedback name"
And I am on site homepage
And I click on "Forums" "link" in the "Activities" "block"
And I should see "Frontpage forum name"
And I am on site homepage
And I click on "External tools" "link" in the "Activities" "block"
And I should see "Frontpage lti name"
And I am on site homepage
And I click on "Quizzes" "link" in the "Activities" "block"
And I should see "Frontpage quiz name"
And I am on site homepage
And I click on "Glossaries" "link" in the "Activities" "block"
And I should see "Frontpage glossary name"
And I am on site homepage
And I click on "SCORM packages" "link" in the "Activities" "block"
And I should see "Frontpage scorm name"
And I am on site homepage
And I click on "Lessons" "link" in the "Activities" "block"
And I should see "Frontpage lesson name"
And I am on site homepage
And I click on "Wikis" "link" in the "Activities" "block"
And I should see "Frontpage wiki name"
And I am on site homepage
And I click on "Workshop" "link" in the "Activities" "block"
And I should see "Frontpage workshop name"
And I am on site homepage
And I click on "Resources" "link" in the "Activities" "block"
And I should see "Frontpage book name"
And I should see "Frontpage page name"
And I should see "Frontpage resource name"
And I should see "Frontpage imscp name"
And I should see "Frontpage folder name"
And I should see "Frontpage url name"
Scenario: Add activities block in a course
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| assign | Test assignment name | Test assignment description | C1 | assign1 |
| book | Test book name | Test book description | C1 | book1 |
| chat | Test chat name | Test chat description | C1 | chat1 |
| choice | Test choice name | Test choice description | C1 | choice1 |
| data | Test database name | Test database description | C1 | data1 |
| feedback | Test feedback name | Test feedback description | C1 | feedback1 |
| folder | Test folder name | Test folder description | C1 | folder1 |
| forum | Test forum name | Test forum description | C1 | forum1 |
| glossary | Test glossary name | Test glossary description | C1 | glossary1 |
| imscp | Test imscp name | Test imscp description | C1 | imscp1 |
| label | Test label name | Test label description | C1 | label1 |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
| lti | Test lti name | Test lti description | C1 | lti1 |
| page | Test page name | Test page description | C1 | page1 |
| quiz | Test quiz name | Test quiz description | C1 | quiz1 |
| resource | Test resource name | Test resource description | C1 | resource1 |
| scorm | Test scorm name | Test scorm description | C1 | scorm1 |
| survey | Test survey name | Test survey description | C1 | survey1 |
| url | Test url name | Test url description | C1 | url1 |
| wiki | Test wiki name | Test wiki description | C1 | wiki1 |
| workshop | Test workshop name | Test workshop description | C1 | workshop1 |
When I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Activities" block
And I click on "Assignments" "link" in the "Activities" "block"
Then I should see "Test assignment name"
And I am on "Course 1" course homepage
And I click on "Chats" "link" in the "Activities" "block"
And I should see "Test chat name"
And I am on "Course 1" course homepage
And I click on "Choices" "link" in the "Activities" "block"
And I should see "Test choice name"
And I am on "Course 1" course homepage
And I click on "Databases" "link" in the "Activities" "block"
And I should see "Test database name"
And I am on "Course 1" course homepage
And I click on "Feedback" "link" in the "Activities" "block"
And I should see "Test feedback name"
And I am on "Course 1" course homepage
And I click on "Forums" "link" in the "Activities" "block"
And I should see "Test forum name"
And I am on "Course 1" course homepage
And I click on "External tools" "link" in the "Activities" "block"
And I should see "Test lti name"
And I am on "Course 1" course homepage
And I click on "Quizzes" "link" in the "Activities" "block"
And I should see "Test quiz name"
And I am on "Course 1" course homepage
And I click on "Glossaries" "link" in the "Activities" "block"
And I should see "Test glossary name"
And I am on "Course 1" course homepage
And I click on "SCORM packages" "link" in the "Activities" "block"
And I should see "Test scorm name"
And I am on "Course 1" course homepage
And I click on "Lessons" "link" in the "Activities" "block"
And I should see "Test lesson name"
And I am on "Course 1" course homepage
And I click on "Wikis" "link" in the "Activities" "block"
And I should see "Test wiki name"
And I am on "Course 1" course homepage
And I click on "Workshop" "link" in the "Activities" "block"
And I should see "Test workshop name"
And I am on "Course 1" course homepage
And I click on "Resources" "link" in the "Activities" "block"
And I should see "Test book name"
And I should see "Test page name"
And I should see "Test resource name"
And I should see "Test imscp name"
And I should see "Test folder name"
And I should see "Test url name"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/login/tests/behat/login_block.feature
@block @block_login
Feature: Login from a block
In order to make it easier to login
As an user
In need to login through a block
Background:
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | [email protected] |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| login | System | 1 | site-index | side-pre |
Scenario: Login block visible to non-logged in users
When I am on homepage
Then "Login" "block" should exist
Scenario: Login as student through login block
Given I am on homepage
When I set the field "Username" to "testuser"
And I set the field "Password" to "testpass"
And I click on "Log in" "button" in the "Login" "block"
Then I should see "You are logged in as Test User"
And "Login" "block" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_month/tests/behat/block_calendar_month_dashboard.feature
@block @block_calendar_month
Feature: View a site event on the dashboard
In order to view a site event
As a student
I can view the event in the calendar
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
And I log out
@javascript
Scenario: View a site event in the calendar block on the dashboard
Given I log in as "student1"
When I hover over today in the mini-calendar block
Then I should see "Site Event"
@javascript
Scenario: The calendar block on the dashboard should be responsive
Given I log in as "student1"
When I change viewport size to "1200x1000"
Then I should see "Site Event"
And I change viewport size to "600x1000"
# We need to give the browser a couple seconds to re-render the page after the screen has been resized.
And I wait "1" seconds
And I should not see "Site Event"
When I hover over today in the mini-calendar block responsive view
And I should see "Site Event"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_month/tests/behat/block_calendar_month.feature
@block @block_calendar_month
Feature: Enable the calendar block in a course and test it's functionality
In order to enable the calendar block in a course
As a teacher
I can add the calendar block to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
| student1 | Student | 1 | [email protected] | S1 |
| student2 | Student | 2 | [email protected] | S2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: Add the block to a the course
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add the "Calendar" block
Then "Calendar" "block" should exist
@javascript
Scenario: View a site event in the calendar block
Given I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
And I hover over today in the mini-calendar block
Then I should see "Site Event"
@javascript
Scenario: View a course event in the calendar block
Given I log in as "teacher1"
And I create a calendar event with form data:
| Type of event | course |
| Course | Course 1 |
| Event title | Course Event |
When I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
And I hover over today in the mini-calendar block
Then I should see "Course Event"
@javascript
Scenario: View a user event in the calendar block
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
When I am on "Course 1" course homepage
And I hover over today in the mini-calendar block
Then I should see "User Event"
@javascript
Scenario: View a group event in the calendar block
Given the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G2 |
When I am on the "Course 1" "course editing" page logged in as teacher1
And I set the following fields to these values:
| id_groupmode | Separate groups |
| id_groupmodeforce | Yes |
And I press "Save and display"
And I turn editing mode on
And I add the "Calendar" block
And I click on "Full calendar" "link"
And I set the field "course" to "C1"
And I create a calendar event:
| Type of event | group |
| Group | Group 1 |
| Event title | Group Event |
And I am on the "Course 1" course page logged in as student1
And I hover over today in the mini-calendar block
Then I should see "Group Event"
And I am on the "Course 1" course page logged in as student2
And I should not see "Group Event"
@javascript
Scenario: Click on today's course event on the calendar view page's calendar block
Given I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
And I am on site homepage
And I turn editing mode on
And I add the "Calendar" block
And I configure the "Calendar" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
When I am on "Course 1" course homepage
And I follow "Full calendar"
And I click on today in the mini-calendar block
Then I should see "Site Event" in the "Calendar" "block"
And ".popover" "css_element" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_month/tests/behat/block_calendar_month_course.feature
@block @block_calendar_month
Feature: Enable the calendar block in a course
In order to enable the calendar block in a course
As a teacher
I can add the calendar block to a course
@javascript
Scenario: View a site event in the calendar block in a course
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | [email protected] | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
When I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
And I hover over today in the mini-calendar block
And I should see "Site Event"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature
@block @block_calendar_month
Feature: Enable the calendar block on the site front page
In order to enable the calendar block on the site front page
As an admin
I can add the calendar block on the site front page
@javascript
Scenario: View a site event in the calendar block on the front page
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | [email protected] | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | System | 1 | site-index | side-pre |
And I log in as "admin"
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
And I log out
When I log in as "student1"
And I am on site homepage
And I hover over today in the mini-calendar block
Then I should see "Site Event"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/mnet_hosts/tests/behat/mnet_hosts_addblock_disabled.feature
@block @block_mnet_hosts @javascript
Feature: Add the network servers block when main feature is disabled
In order to add the Network servers block to my course
As a teacher
It should be added only if the MNet authentication is enabled.
Scenario: The network servers block is displayed even when mnet authentication is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
When I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Disable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
And I turn editing mode on
Then I should see "Network servers"
Scenario: The network servers block can be removed even when mnet authentication is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
And I am on site homepage
And I turn editing mode on
And I open the "Network servers" blocks action menu
And I click on "Delete Network servers block" "link" in the "Network servers" "block"
And "Delete block?" "dialogue" should exist
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
And I should see "Network servers"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Disable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
And I turn editing mode on
And I open the "Network servers" blocks action menu
And I click on "Delete Network servers block" "link" in the "Network servers" "block"
And "Delete block?" "dialogue" should exist
And I click on "Delete" "button" in the "Delete block?" "dialogue"
Then I should not see "Network servers"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//blocks/mnet_hosts/tests/behat/mnet_hosts_addblock.feature
@block @block_mnet_hosts @javascript @addablocklink
Feature: Add the network servers block when main feature is enabled
In order to add the Network servers block to my course
As a teacher
It should be added only if the MNet authentication is enabled.
Scenario: The network servers block can be added when mnet authentication is enabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
And I turn editing mode on
When I click on "Add a block" "link"
Then I should see "Network servers"
Scenario: The network servers block cannot be added when mnet authentication is disabled
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I click on "Add a block" "link"
Then I should not see "Network servers"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/create_folders.feature
@core @core_filepicker
Feature: Create folders in the file manager
In order to create a directory structure in a file area
As a user
I need to create folders and subfolders in a file area
@javascript @_bug_phantomjs
Scenario: Create folders and subfolders
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "0"
And I set the following fields to these values:
| Name | Folder resource |
| Description | The description |
And I create "Folder 1" folder in "Files" filemanager
And I open "Folder 1" folder from "Files" filemanager
And I create "SubFolder 1" folder in "Files" filemanager
When I open "Files" folder from "Files" filemanager
Then I should see "Folder 1"
And I open "Folder 1" folder from "Files" filemanager
And I should see "SubFolder 1"
And I press "Save and return to course"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/delete_files.feature
@core @core_filepicker @_file_upload
Feature: Delete files and folders from the file manager
In order to clean the file manager contents
As a user
I need to delete files from file areas
Background:
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
@javascript @_bug_phantomjs
Scenario: Delete a file and a folder
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I create "Delete me" folder in "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
When I delete "empty.txt" from "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
Then I should not see "empty.txt" in the "Manage private files" "dialogue"
And I delete "Delete me" from "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I should not see "Delete me" in the "Manage private files" "dialogue"
@javascript
Scenario: Delete a file and a folder using bulk functionality (individually)
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I create "Delete me later" folder in "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I click on "Display folder with file details" "link"
And I set the field "Select file 'empty.txt'" to "1"
When I click on "Delete" "link"
Then I should see "Are you sure you want to delete the selected 1 file(s)?"
When I click on "Yes" "button" in the "Confirm" "dialogue"
Then I should not see "empty.txt" in the "Manage private files" "dialogue"
But I should see "Delete me later" in the "Manage private files" "dialogue"
When I press "Save changes"
And I follow "Manage private files..."
Then I should not see "empty.txt" in the "Manage private files" "dialogue"
But I should see "Delete me later" in the "Manage private files" "dialogue"
And I set the field "Select file 'Delete me later'" to "1"
And I click on "Delete" "link"
And I click on "Yes" "button" in the "Confirm" "dialogue"
Then I should not see "Delete me later" in the "Manage private files" "dialogue"
When I press "Save changes"
And I follow "Manage private files..."
Then I should not see "Delete me later" in the "Manage private files" "dialogue"
@javascript
Scenario: Delete a file and a folder using bulk functionality (multiple)
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I create "Delete me" folder in "Files" filemanager
And I create "Do not delete me" folder in "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I click on "Display folder with file details" "link"
And I set the field "Select file 'empty.txt'" to "1"
And I set the field "Select file 'Delete me'" to "1"
When I click on "Delete" "link"
Then I should see "Are you sure you want to delete the selected 2 file(s)?"
When I click on "Yes" "button" in the "Confirm" "dialogue"
Then I should not see "Delete me" in the "Manage private files" "dialogue"
And I should not see "empty.txt" in the "Manage private files" "dialogue"
But I should see "Do not delete me" in the "Manage private files" "dialogue"
When I press "Save changes"
And I follow "Manage private files..."
Then I should not see "Delete me" in the "Manage private files" "dialogue"
And I should not see "empty.txt" in the "Manage private files" "dialogue"
And I am on homepage
Then I should not see "Delete me" in the "Private files" "block"
And I should not see "empty.txt" in the "Private files" "block"
But I should see "Do not delete me" in the "Private files" "block"
@javascript
Scenario: Delete files using the select all checkbox
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I create "Delete me" folder in "Files" filemanager
And I create "Delete me too" folder in "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I click on "Display folder with file details" "link"
When I click on "Select all/none" "checkbox"
Then the following fields match these values:
| Select file 'empty.txt' | 1 |
| Select file 'Delete me' | 1 |
| Select file 'Delete me too' | 1 |
When I click on "Delete" "link"
Then I should see "Are you sure you want to delete the selected 3 file(s)?"
When I click on "Yes" "button" in the "Confirm" "dialogue"
Then I should not see "Delete me" in the "Manage private files" "dialogue"
And I should not see "empty.txt" in the "Manage private files" "dialogue"
And I should not see "Delete me too" in the "Manage private files" "dialogue"
When I press "Save changes"
And I follow "Manage private files..."
Then I should not see "Delete me" in the "Manage private files" "dialogue"
And I should not see "empty.txt" in the "Manage private files" "dialogue"
And I am on homepage
Then I should not see "Delete me" in the "Private files" "block"
And I should not see "empty.txt" in the "Private files" "block"
And I should not see "Delete me too" in the "Private files" "block"
@javascript
Scenario: Verify system logs for deleted draft files
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/update_validator/zips/multidir.zip" file to "Files" filemanager
And I follow "multidir.zip"
And I click on "Unzip" "button"
And I click on "Display folder with file details" "link"
And I set the field "Select file 'one'" to "1"
And I click on "Delete" "link"
And I should see "Are you sure you want to delete the selected 1 file(s)?"
And I click on "Yes" "button" in the "Confirm" "dialogue"
And I click on "Save changes" "button"
And I am on the "System logs report" page
And I click on "Get these logs" "button"
And I should see "The user with id '2' has deleted folder '/one/.' from the draft file area with item id" in the "has deleted folder '/one/.'" "table_row"
And I should see "Size: 0 bytes. Content hash:" in the "has deleted folder '/one/.'" "table_row"
Then I should see "The user with id '2' has deleted file '/one/version.php' from the draft file area with item id" in the "has deleted file '/one/version.php'" "table_row"
And I should see "Size: 40 bytes. Content hash:" in the "has deleted file '/one/version.php'" "table_row"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/create_shortcut.feature
@core @core_filepicker @repository @repository_user @_file_upload
Feature: Create shortcuts
In order to automatically synchronize copies of the file with the source
As a teacher
I need to be able to pick file as a shortcut
@javascript @_bug_phantomjs
Scenario: Upload a file as a copy and as a shortcut in filemanager
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry | Teacher | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
When I log in as "teacher1"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
Then I should see "empty.txt" in the "div.fp-content" "css_element"
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Test folder |
| Description | Test folder description |
And I add "empty.txt" file from "Private files" to "Files" filemanager
And I should see "1" elements in "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
And ".fp-content .fp-file.fp-isreference" "css_element" should not exist
And I add "empty.txt" file from "Private files" to "Files" filemanager as:
| Save as | empty_ref.txt |
| Link to the file | 1 |
And I should see "2" elements in "Files" filemanager
And I should see "empty_ref.txt" in the ".fp-content .fp-file.fp-isreference" "css_element"
And I press "Save and display"
And I should see "empty.txt"
And I should see "empty_ref.txt"
And I press "Edit"
And I should see "2" elements in "Files" filemanager
And I should see "empty_ref.txt" in the ".fp-content .fp-file.fp-isreference" "css_element"
# ------ Overwriting the reference with a non-reference ---------
And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager as:
| Save as | empty_ref.txt |
And I should see "2" elements in "Files" filemanager
And ".fp-content .fp-file.fp-isreference" "css_element" should not exist
And I press "Save changes"
And I should see "empty.txt"
And I should see "empty_ref.txt"
And I press "Edit"
And I should see "2" elements in "Files" filemanager
And ".fp-content .fp-file.fp-isreference" "css_element" should not exist
# ------ Overwriting non-reference with a reference ---------
And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager as:
| Save as | empty_ref.txt |
| Link to the file | 1 |
And I should see "2" elements in "Files" filemanager
And I should see "empty_ref.txt" in the ".fp-content .fp-file.fp-isreference" "css_element"
And I press "Save changes"
And I should see "empty.txt"
And I should see "empty_ref.txt"
And I press "Edit"
And I should see "2" elements in "Files" filemanager
And I should see "empty_ref.txt" in the ".fp-content .fp-file.fp-isreference" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/select_file.feature
@core @core_filepicker @_file_upload
Feature: Select file feature
In order to add a file to a filearea
As a user
I need to be able to select the file using the file picker
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And the following "activities" exist:
| activity | course | name |
| folder | C1 | Test folder |
And I am on the "Test folder" "folder activity" page logged in as admin
And I press "Edit"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
@javascript
Scenario: Select a file from the "Recent files" repository using "icons" view
Given I follow "Dashboard"
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
And I click on "Display folder with file icons" "link" in the ".file-picker" "css_element"
And I click on "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')][normalize-space(.)='empty.txt']" "xpath_element"
And I should see "Select empty.txt"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
@javascript
Scenario: Select a file from the "Recent files" repository using "list" view
Given I follow "Dashboard"
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
And I click on "Display folder with file details" "link" in the ".file-picker" "css_element"
And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' file-picker ')]/descendant::span[normalize-space(.)='empty.txt']/ancestor::a" "xpath_element"
And I should see "Select empty.txt"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
@javascript
Scenario: Select a file from the "Recent files" repository using "tree" view
Given I follow "Dashboard"
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
And I click on "Display folder as file tree" "link" in the ".file-picker" "css_element"
And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' file-picker ')]/descendant::span[normalize-space(.)='empty.txt']/ancestor::a" "xpath_element"
And I should see "Select empty.txt"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/zip_and_unzip.feature
@core @core_filepicker
Feature: Zip folders and unzip compressed files
In order to download or add contents to file areas easily
As a user
I need to zip and unzip folders and files
@javascript @_bug_phantomjs
Scenario: Zip and unzip folders and files
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "0"
And I set the following fields to these values:
| Name | Folder resource |
| Description | The description |
And I create "Folder 1" folder in "Files" filemanager
And I open "Folder 1" folder from "Files" filemanager
And I create "SubFolder 1" folder in "Files" filemanager
And I open "Files" folder from "Files" filemanager
And I zip "Folder 1" folder from "Files" filemanager
And I delete "Folder 1" from "Files" filemanager
When I unzip "Folder 1.zip" file from "Files" filemanager
And I delete "Folder 1.zip" from "Files" filemanager
Then I should see "Folder 1"
And I open "Folder 1" folder from "Files" filemanager
And I should see "SubFolder 1"
And I press "Save and return to course"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/overwrite_file.feature
@core @core_filepicker @_file_upload
Feature: Overwrite file feature
In order to update an existing file
As a user
I need to pick the file with the same name and select to overwrite
@javascript @_bug_phantomjs
Scenario: Upload a file in filemanager and overwrite it
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry | Teacher | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
When I log in as "teacher1"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
Then I should see "1" elements in "Files" filemanager
And I upload and overwrite "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I should see "1" elements in "Files" filemanager
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
And I should see "2" elements in "Files" filemanager
And I upload and overwrite "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
And I should see "2" elements in "Files" filemanager
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Test folder |
| Description | Test folder description |
And I add "empty.txt" file from "Private files" to "Files" filemanager
And I should see "1" elements in "Files" filemanager
And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager
And I should see "1" elements in "Files" filemanager
And I add "empty.txt" file from "Private files" to "Files" filemanager as:
| Save as | empty_copy.txt |
And I should see "2" elements in "Files" filemanager
And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager as:
| Save as | empty_copy.txt |
And I should see "2" elements in "Files" filemanager
And I press "Save and display"
And I should see "empty.txt"
And I should see "empty_copy.txt"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/cancel_add_file.feature
@core @core_filepicker @_file_upload
Feature: A selected file can be cancelled
In order to refine the file manager contents
As a user
I need to cancel a selected file
@javascript @_bug_phantomjs
Scenario: Cancel a selected recent file from being added to a folder
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And the following "activities" exist:
| activity | course | name | intro |
| folder | C1 | Folder name | Folder description |
And I log in as "admin"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I am on the "Folder name" "folder activity" page
And I press "Edit"
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
And I click on "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')][normalize-space(.)='empty.txt']" "xpath_element"
And I click on ".moodle-dialogue-focused .fp-select .fp-select-cancel" "css_element"
And I click on "Close" "button" in the "File picker" "dialogue"
And I press "Save changes"
Then I should see "upload_users.csv"
And I should not see "empty.txt"
And I should see "Folder description"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/tests/behat/edit_file.feature
@core @core_filepicker @_file_upload
Feature: Edit file feature
In order to edit a file
As a user
I need to be able to select the file in filemanager and modify the file information
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And I log in as "admin"
@javascript
Scenario: Select file from "Files" filemanager using "icons" view and edit the name
Given I follow "Manage private files"
And I click on "Display folder with file icons" "link" in the ".filemanager" "css_element"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')]/descendant::a[normalize-space(.)='empty.txt']" "xpath_element"
And I should see "Edit empty.txt"
And I set the following fields to these values:
| Name | empty_edited.txt |
When I click on "Update" "button"
Then I should see "empty_edited.txt" in the ".fp-content .fp-file" "css_element"
And I should not see "empty.txt" in the ".fp-content .fp-file" "css_element"
@javascript
Scenario: Select file from "Files" filemanager using "list" view and edit the name
Given I follow "Manage private files"
And I click on "Display folder with file details" "link" in the ".filemanager" "css_element"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-filename" "css_element"
And I click on "//span[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename-icon ')]/descendant::a[normalize-space(.)='empty.txt']" "xpath_element"
And I should see "Edit empty.txt"
And I set the following fields to these values:
| Name | empty_edited.txt |
When I click on "Update" "button"
Then I should see "empty_edited.txt" in the ".fp-content .fp-filename" "css_element"
And I should not see "empty.txt" in the ".fp-content .fp-filename" "css_element"
@javascript
Scenario: Select file from "Files" filemanager using "tree" view and edit the name
Given I follow "Manage private files"
And I click on "Display folder as file tree" "link" in the ".filemanager" "css_element"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I should see "empty.txt" in the ".fp-content .fp-hascontextmenu .fp-filename" "css_element"
And I click on "//span[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename-icon ')]/descendant::a[normalize-space(.)='empty.txt']" "xpath_element"
And I should see "Edit empty.txt"
And I set the following fields to these values:
| Name | empty_edited.txt |
When I click on "Update" "button"
Then I should see "empty_edited.txt" in the ".fp-content .fp-hascontextmenu .fp-filename" "css_element"
And I should not see "empty.txt" in the ".fp-content .fp-hascontextmenu .fp-filename" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/contentbank/tests/behat/select_content.feature
@repository @repository_contentbank @javascript
Feature: Select content bank files using the content bank files repository
In order to re-use content bank files
As a user
I need to be able to view and select content bank files using the content bank repository
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student | Student | 1 | [email protected] |
| teacher1 | Teacher 1 | 1 | [email protected] |
| teacher2 | Teacher 2 | 1 | [email protected] |
And the following "categories" exist:
| name | category | idnumber |
| Category1 | 0 | CAT1 |
| SubCategory1 | CAT1 | SUBCAT1 |
And the following "courses" exist:
| fullname | shortname | category |
| MiscellaneousCourse1 | mscC1 | 0 |
| MiscellaneousCourse2 | mscC2 | 0 |
| Category1Course1 | cat1C1 | CAT1 |
| SubCategory1Course1 | subcat1C1 | SUBCAT1 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | mscC1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | mscC2 | contenttype_h5p | admin | find-the-words.h5p | /h5p/tests/fixtures/find-the-words.h5p |
| Course | subcat1C1 | contenttype_h5p | admin | greeting-card.h5p | /h5p/tests/fixtures/greeting-card.h5p |
| Category | CAT1 | contenttype_h5p | admin | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p |
| Category | SUBCAT1 | contenttype_h5p | admin | multiple-choice-2-6.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p |
| System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And the following "activities" exist:
| activity | name | intro | introformat | course | idnumber |
| forum | Forum | | 1 | mscC1 | forum1 |
| folder | Folder | FolderDesc | 1 | mscC1 | folder1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | mscC1 | editingteacher |
| teacher2 | mscC1 | teacher |
| student | mscC1 | student |
Scenario: Admin can navigate and see all existing content bank files using the content bank repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System > Category 1" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "MiscellaneousCourse1" "folder" in repository content area
And I should see "MiscellaneousCourse2" "folder" in repository content area
And I click on "MiscellaneousCourse2" "folder" in repository content area
And I should see "System > Category 1 > MiscellaneousCourse2" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "find-the-words.h5p" "file" in repository content area
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System" breadcrumb navigation in repository
And I should see "3" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I should see "Category 1" "folder" in repository content area
And I should see "Category1" "folder" in repository content area
And I click on "Category1" "folder" in repository content area
And I should see "System > Category1" breadcrumb navigation in repository
And I should see "3" elements in repository content area
And I should see "SubCategory1" "folder" in repository content area
And I should see "Category1Course1" "folder" in repository content area
And I should see "ipsums.h5p" "file" in repository content area
And I click on "SubCategory1" "folder" in repository content area
And I should see "System > Category1 > SubCategory1" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "SubCategory1Course1" "folder" in repository content area
And I should see "multiple-choice-2-6.h5p" "file" in repository content area
And I click on "SubCategory1Course1" "folder" in repository content area
And I should see "System > Category1 > SubCategory1 > SubCategory1Course1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "greeting-card.h5p" "file" in repository content area
Scenario: Admin can select and re-use content bank files using the content bank repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I click on "Category1" "folder" in repository content area
And I should see "ipsums.h5p" "file" in repository content area
And I click on "ipsums.h5p" "file" in repository content area
And I should see "Select ipsums.h5p"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "ipsums.h5p" in the ".fp-content .fp-file" "css_element"
Scenario: Editing teacher can navigate and see content bank files available to him using the content bank repository
Given I am on the Folder "Folder activity" page logged in as teacher1
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System > Category 1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "MiscellaneousCourse1" "folder" in repository content area
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I should see "Category 1" "folder" in repository content area
Scenario: Editing teacher can select and re-use content bank files available to him using the content bank repository
Given I am on the Folder "Folder activity" page logged in as teacher1
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "filltheblanks.h5p" "file" in repository content area
And I should see "Select filltheblanks.h5p"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "filltheblanks.h5p" in the ".fp-content .fp-file" "css_element"
Scenario: Non-editing teacher can not see the content bank repository
Given I am on the Forum "Forum activity" page logged in as teacher2
And I click on "Add discussion topic" "link"
And I click on "Advanced" "button"
When I click on "Add..." "button"
Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
Scenario: Student can not see the content bank repository
Given I am on the Forum "Forum activity" page logged in as student
And I click on "Add discussion topic" "link"
And I click on "Advanced" "button"
When I click on "Add..." "button"
Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
Scenario: Both content name and file name are shown when a content is selected
Given the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | mscC1 | contenttype_h5p | admin | My content | /h5p/tests/fixtures/ipsums.h5p |
And I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "My content"
And I click on "My content" "link"
And I should see "Select My content"
And the field "Save as" matches value "ipsums.h5p"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/contentbank/tests/behat/search_content.feature
@repository @repository_contentbank @javascript
Feature: Search content bank files using the content bank files repository
In order to find the content I need to select in the file picker
As a user
I need to be able to search in the content bank files repository by content name
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student | Student | 1 | [email protected] |
| teacher | Teacher | 1 | [email protected] |
And the following "categories" exist:
| name | category | idnumber |
| Category1 | 0 | CAT1 |
| Category2 | 0 | CAT2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course1 | C1 | CAT1 |
| Course2 | C2 | CAT2 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | admin | coursecontent1.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | C2 | contenttype_h5p | admin | coursecontent2.h5p | /h5p/tests/fixtures/find-the-words.h5p |
| Category | CAT1 | contenttype_h5p | admin | categorycontent1.h5p | /h5p/tests/fixtures/ipsums.h5p |
| Category | CAT2 | contenttype_h5p | admin | categorycontent2.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p |
| System | | contenttype_h5p | admin | systemcontent.h5p | /h5p/tests/fixtures/greeting-card.h5p |
And the following "activities" exist:
| activity | name | intro | introformat | course | idnumber |
| folder | Folder | FolderDesc | 1 | C1 | folder |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C1 | editingteacher |
Scenario: User can see a search field and reset search button in the content bank files repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then "Search repository" "field" should be visible
And "Refresh" "link" should be visible
Scenario: User can see search results when there is content that matches the search criteria
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "content"
When I press enter
Then I should see "5" elements in repository content area
And I should see "systemcontent.h5p" "file" in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "categorycontent2.h5p" "file" in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "coursecontent2.h5p" "file" in repository content area
Scenario: User can see search results when there is content that matches the search criteria ignoring case sensitivity
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "COURSE"
When I press enter
Then I should see "2" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "coursecontent2.h5p" "file" in repository content area
Scenario: User can not see any search results when there is not a content that matches the search criteria
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "somecontent"
When I press enter
Then I should see "0" elements in repository content area
And I should see "No files available" in the ".filepicker .fp-content" "css_element"
Scenario: User can reset search criteria and see all content displayed prior the search action
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "1" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I set the field "Search repository" to "category"
And I press enter
And I should see "2" elements in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "categorycontent2.h5p" "file" in repository content area
When I click on "Refresh" "link"
Then I should see "1" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
Scenario: Editing teacher can see search results when the content is available to him and matches the search criteria
Given I am on the Folder "Folder activity" page logged in as teacher
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "content"
When I press enter
Then I should see "3" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "systemcontent.h5p" "file" in repository content area
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/contentbank/tests/behat/file_update.feature
@repository @repository_contentbank @javascript @core_h5p
Feature: Updating a file in the content bank after using in a course
In order to use file alias
As a user
Updated files must update references when is an alias
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course1 | C1 | CAT1 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | admin | package.h5p | /h5p/tests/fixtures/guess-the-answer.h5p |
Scenario: Referenced files is the default option and updates alias as well
When I log in as "admin"
And I am on "Course1" course homepage with editing mode on
And I add a "H5P" to section "1"
And I set the following fields to these values:
| Name | guessFile |
And I click on "Add..." "link" in the ".fp-toolbar" "css_element"
And I select "Content bank" repository in file picker
And I click on "package.h5p" "file" in repository content area
And I click on "Select this file" "button"
And I click on "Save and display" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "Press here to reveal answer"
And I switch to the main frame
# Now edit the content in the content bank.
When I am on "Course1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
And I click on "package.h5p" "link"
And I click on "Edit" "link"
And I wait until the page is ready
And I switch to "h5p-editor-iframe" class iframe
And I set the field "Title" to "Required title"
And I set the field "Descriptive solution label" to "This is a new text"
And I switch to the main frame
And I click on "Save" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "This is a new text"
And I switch to the main frame
# Check the course page is updated.
When I am on "Course1" course homepage with editing mode on
And I click on "guessFile" "link" in the "page-content" "region"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "This is a new text"
And I switch to the main frame
Scenario: Copied files should not be updated if the original is edited
When I log in as "admin"
And I am on "Course1" course homepage with editing mode on
And I add a "H5P" to section "1"
And I set the following fields to these values:
| Name | guessFile |
And I click on "Add..." "link" in the ".fp-toolbar" "css_element"
And I select "Content bank" repository in file picker
And I click on "package.h5p" "file" in repository content area
And I click on "Make a copy of the file" "radio"
And I click on "Select this file" "button"
And I click on "Save and display" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "Press here to reveal answer"
And I switch to the main frame
# Now edit the content in the content bank.
When I am on "Course1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
And I click on "package.h5p" "link"
And I click on "Edit" "link"
And I wait until the page is ready
And I switch to "h5p-editor-iframe" class iframe
And I set the field "Title" to "Required title"
And I set the field "Descriptive solution label" to "This is a new text"
And I switch to the main frame
And I click on "Save" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "This is a new text"
And I switch to the main frame
# Check the course page is not updated.
When I am on "Course1" course homepage with editing mode on
And I click on "guessFile" "link" in the "page-content" "region"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "Press here to reveal answer"
And I switch to the main frame
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/upload/tests/behat/upload_file.feature
@repository @repository_upload @_file_upload
Feature: Upload files
In order to add contents
As a user
I need to upload files
@javascript
Scenario: Upload a file in a multiple file filemanager
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I turn editing mode on
And I add the "Private files" block if not present
When I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
Then I should see "1" elements in "Files" filemanager
And I should see "empty.txt" in the "div.fp-content" "css_element"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
Then I should see "2" elements in "Files" filemanager
And I should see "empty.txt"
And I should see "empty_copy.txt"
@javascript
Scenario: Verify logs for file upload
Given I am on the "My private files" page logged in as "admin"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the "System logs report" page
And I click on "Get these logs" "button"
Then I should see "The user with id '2' has uploaded file '/empty.txt' to the draft file area with item id" in the "File added to draft area" "table_row"
And I should see "Size: 32 bytes. Content hash: " in the "File added to draft area" "table_row"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/wikimedia/tests/behat/add_files.feature
@repository @repository_wikimedia @javascript
Feature: Wikimedia repository
In order to update my profile picture
As an admin
I need to choose a picture from Wikimedia
Scenario: Users can add profile picture using wikimedia
Given I log in as "admin"
And I open my profile in edit mode
And I click on "Add..." "button" in the "New picture" "form_row"
# Upload a new user picture using Wikimedia repository.
And I follow "Wikimedia"
And I set the field "Search for:" to "cat"
And I click on "Submit" "button"
# Click on the link of the first search result.
And I click on "a.fp-file" "css_element"
And I click on "Select this file" "button"
When I click on "Update profile" "button"
# New profile picture.
Then "//img[contains(@class, 'userpicture')]" "xpath_element" should exist
# Default profile picture should not exist any more.
And "//img[contains(@class, 'defaultuserpic')]" "xpath_element" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//repository/recent/tests/behat/add_recent.feature
@repository @repository_recent @_file_upload
Feature: Recent files repository lists the recently used files
In order to save time when selecting files
As a user
I need to use again the files I've just used
@javascript
Scenario: Add files recently uploaded
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And the following "activities" exist:
| activity | course | name | intro |
| folder | C1 | Folder name | Folder description |
And I log in as "admin"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager
And I press "Save changes"
And I am on the "Folder name" "folder activity" page
And I press "Edit"
And I add "empty.txt" file from "Recent files" to "Files" filemanager
And I add "empty.txt" file from "Recent files" to "Files" filemanager as:
| Save as | empty_copy.txt |
And I press "Save changes"
Then I should see "empty.txt"
And I should see "empty_copy.txt"
And I should see "Folder description"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/frontpage_display_modes.feature
@core @core_course
Feature: Site home displays items in different modes
In order to show a clean and clear list of the site categories and course
As an admin
I need to set different frontpage display modes
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Category A | 0 | CATA |
| Category B | 0 | CATB |
| Category A child | CATA | CATA1 |
| Category B child | CATB | CATB1 |
| Category A child child | CATA1 | CATA11 |
| Category C | 0 | CATC |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 1 | COURSE1_1 | CATA |
| Course 2 1 | COURSE2_1 | CATB |
| Course 11 1 | COURSE11_1 | CATA1 |
| Course 2 2 | COURSE2_2 | CATB |
| Course 21 1 | COURSE21_1 | CATB1 |
| Course 111 1 | COURSE111_1 | CATA11 |
| Course 111 2 | COURSE111_2 | CATA11 |
And I log in as "admin"
@javascript
Scenario: Displays a list of categories
When I set the following administration settings values:
| Site home items when logged in | List of categories |
| Maximum category depth | 2 |
And I am on site homepage
Then I should see "Category A" in the "region-main" "region"
And I should see "Category A child" in the "region-main" "region"
And I should not see "Category A child child" in the "region-main" "region"
And I toggle "Category A" category children visibility in frontpage
And I should not see "Category A child" in the "region-main" "region"
And I toggle "Category A" category children visibility in frontpage
And I should see "Category A child" in the "region-main" "region"
And I toggle "Category A child" category children visibility in frontpage
And I should see "Category A child child" in the "region-main" "region"
@javascript
Scenario: Displays a combo list
When I set the following administration settings values:
| Site home items when logged in | Combo list |
| Maximum category depth | 2 |
And I am on site homepage
Then I should see "Category A" in the "region-main" "region"
And I should see "Category A child" in the "region-main" "region"
And I should not see "Category A child child" in the "region-main" "region"
And I should see "Course 1 1" in the "region-main" "region"
And I should see "Course 2 2" in the "region-main" "region"
And I should not see "Course 11 1" in the "region-main" "region"
And I toggle "Category A child" category children visibility in frontpage
And I should see "Course 11 1" in the "region-main" "region"
And I should see "Category A child child" in the "region-main" "region"
And I toggle "Category A" category children visibility in frontpage
And I should not see "Course 1 1" in the "region-main" "region"
And I should not see "Category A child" in the "region-main" "region"
And I toggle "Category A" category children visibility in frontpage
And I should see "Course 11 1" in the "region-main" "region"
Scenario: Displays Enrolled users in frontpage
Given the following "users" exist:
| username | firstname | lastname | email | profile_field_frog |
| user1 | User | One | [email protected] | Kermit |
And the following "course enrolments" exist:
| user | course | role |
| admin | COURSE1_1 | student |
| admin | COURSE2_1 | student |
| admin | COURSE2_2 | student |
And I set the following administration settings values:
| Site home items when logged in | Enrolled courses |
| frontpagecourselimit | 2 |
And I log in as "admin"
And I am on site homepage
When I click on "My courses" "link" in the "frontpage-course-list" "region"
Then I should see "My courses" in the "page-header" "region"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/coursetags.feature
@core @core_course @core_tag @javascript
Feature: Tagging courses
In order to search courses
As a teacher
I need to be able to tag courses
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| teacher2 | Teacher | 2 | [email protected] |
| user1 | User | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | c1 |
| Course 2 | c2 |
And the following "tags" exist:
| name | isstandard |
| Neverusedtag | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| teacher2 | c1 | teacher |
| teacher1 | c2 | editingteacher |
| teacher2 | c2 | teacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Tags | Mathematics |
And I press "Save and display"
And I log out
Scenario: Set course tags using the course edit form
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then "Mathematics" "autocomplete_suggestions" should exist
And I set the following fields to these values:
| Tags | Mathematics, Algebra |
And I press "Save and display"
And I am on "Course 2" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Tags | Mathematics, Geometry |
And I press "Save and display"
And I log out
And I log in as "user1"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 "Tags" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Tags" "link" in the "Navigation" "block"
And I follow "Mathematics"
Then I should see "Course 1"
And I should see "Course 2"
And I follow "Tags"
And I follow "Algebra"
And I should see "Course 1"
And I should not see "Course 2"
And I follow "Tags"
And I follow "Geometry"
And I should not see "Course 1"
And I should see "Course 2"
And I log out
Scenario: User can set course tags using separate form
Given the following "role capability" exists:
| role | teacher |
| moodle/course:tag | allow |
When I log in as "teacher2"
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 | Mathematics, Algebra |
And I press "Save changes"
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 |
And I press "Save changes"
And I log out
And I log in as "user1"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 "Tags" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Tags" "link" in the "Navigation" "block"
And I follow "Mathematics"
Then I should see "Course 1"
And I should see "Course 2"
And I follow "Tags"
And I follow "Algebra"
And I should see "Course 1"
And I should not see "Course 2"
And I follow "Tags"
And I follow "Geometry"
And I should not see "Course 1"
And I should see "Course 2"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/move_activities.feature
@core @core_course
Feature: Activities can be moved between sections
In order to rearrange my course contents
As a teacher
I need to move activities between sections
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| forum | Test forum name | C1 | 00001 | 1 |
| forum | Second forum name | C1 | 00002 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Move activities in a single page course with Javascript disabled
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Scenario: Move activities in the course home with Javascript disabled using paged mode
Given I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Scenario: Move activities in a course section with Javascript disabled using paged mode
Given I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
And I follow "Topic 1"
When I move "Second forum name" activity to section "1"
Then "Second forum name" "link" should appear before "Test forum name" "link"
@javascript
Scenario: Move activity with javascript
When I move "Test forum name" activity to section "3"
Then I should see "Test forum name" in the "Topic 3" "section"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_activity_dates.feature
@core @core_course
Feature: Allow teachers to edit the visibility of activity dates in a course
In order to show students the activity dates in a course
As a teacher
I need to be able to edit activity dates settings
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | idnumber | name | intro | timeopen | timeclose |
| choice | C1 | choice1 | Test choice | Test choice description | ##yesterday## | ##tomorrow## |
Scenario: Activity dates setting can be enabled to display activity dates in a course
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Settings" in current page administration
When I set the following fields to these values:
| Show activity dates | Yes |
And I click on "Save and display" "button"
And I follow "Test choice"
Then the activity date information in "Test choice" should exist
And the activity date in "Test choice" should contain "Opened:"
And the activity date in "Test choice" should contain "Closes:"
And I am on "Course 1" course homepage
# When showactivitydates is enabled, activity dates should be shown on the course homepage.
And the activity date information in "Test choice" should exist
And the activity date in "Test choice" should contain "Opened:"
And the activity date in "Test choice" should contain "Closes:"
Scenario: Activity dates setting can be disabled to hide activity dates in a course
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Settings" in current page administration
When I set the following fields to these values:
| Show activity dates | No |
And I click on "Save and display" "button"
And I follow "Test choice"
# Activity dates are always shown in the module's view page.
Then the activity date information in "Test choice" should exist
And the activity date in "Test choice" should contain "Opened:"
And the activity date in "Test choice" should contain "Closes:"
And I am on "Course 1" course homepage
# When showactivitydates is disabled, activity dates should not be shown on the course homepage.
And the activity date information in "Test choice" should not exist
Scenario: Default activity dates setting default value can changed to No
Given I log in as "admin"
And I navigate to "Courses > Default settings > Course default settings" in site administration
When I set the following fields to these values:
| Show activity dates | No |
And I click on "Save changes" "button"
And I navigate to "Courses > Add a new course" in site administration
Then the field "showactivitydates" matches value "No"
Scenario: Default activity dates setting default value can changed to Yes
Given I log in as "admin"
And I navigate to "Courses > Default settings > Course default settings" in site administration
When I set the following fields to these values:
| Show activity dates | Yes |
And I click on "Save changes" "button"
And I navigate to "Courses > Add a new course" in site administration
Then the field "showactivitydates" matches value "Yes"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/category_change_visibility.feature
@core @core_course
Feature: We can change the visibility of categories in the management interface.
As a moodle admin
I need to test hiding and showing a category.
I need to test hiding and showing a sub category.
I need to test visibility is applied to sub categories.
I need to test visibility is applied to courses.
I need to test visibility of children is reset when changing back.
# Tests hiding and then showing a single category.
Scenario: Test making a category hidden and then visible again.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be dimmed "CAT1"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be visible "CAT1"
# Tests hiding and then showing a single category.
@javascript
Scenario: Test using AJAX to make a category hidden and then visible again.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be dimmed "CAT1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
# Tests hiding and then showing a subcategory.
Scenario: Test making a subcategory hidden and then visible again.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | CAT1 | CAT2 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And I toggle visibility of category "CAT2" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be dimmed "CAT2"
And I toggle visibility of category "CAT2" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
# Tests hiding and then showing a subcategory.
@javascript
Scenario: Test using AJAX to make a subcategory hidden and then visible again.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | CAT1 | CAT2 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And I toggle visibility of category "CAT2" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be dimmed "CAT2"
And I toggle visibility of category "CAT2" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
# The test below this is identical except with JavaScript enabled.
Scenario: Test relation between category and course when changing visibility.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 3 | CAT1 | CAT3 |
| Cat 4 | CAT1 | CAT4 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I should see "Cat 4" in the "#category-listing ul" "css_element"
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And I should see "Course 2" in the "#course-listing ul.course-list" "css_element"
And I should see "Course 3" in the "#course-listing ul.course-list" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And category in management listing should be visible "CAT4"
And course in management listing should be visible "C1"
And course in management listing should be visible "C2"
And course in management listing should be visible "C3"
And I toggle visibility of course "C2" in management listing
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
And I toggle visibility of category "CAT3" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be dimmed "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be dimmed "CAT3"
And category in management listing should be dimmed "CAT4"
And course in management listing should be dimmed "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be dimmed "C3"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be dimmed "CAT3"
And category in management listing should be visible "CAT4"
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
# The test above this is identical except without JavaScript enabled.
@javascript @_cross_browser
Scenario: Test the relation between category and course when changing visibility with AJAX
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 3 | CAT1 | CAT3 |
| Cat 4 | CAT1 | CAT4 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I should see "Cat 4" in the "#category-listing ul" "css_element"
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And I should see "Course 2" in the "#course-listing ul.course-list" "css_element"
And I should see "Course 3" in the "#course-listing ul.course-list" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And category in management listing should be visible "CAT4"
And course in management listing should be visible "C1"
And course in management listing should be visible "C2"
And course in management listing should be visible "C3"
And I toggle visibility of course "C2" in management listing
And a new page should not have loaded since I started watching
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
And I toggle visibility of category "CAT3" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be dimmed "CAT3"
And category in management listing should be visible "CAT4"
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be dimmed "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be dimmed "CAT3"
And category in management listing should be dimmed "CAT4"
And course in management listing should be dimmed "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be dimmed "C3"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be dimmed "CAT3"
And category in management listing should be visible "CAT4"
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
@javascript @_cross_browser
Scenario: Test courses are hidden when selected category parent is hidden.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | CAT1 | CAT2 |
| Cat 3 | CAT2 | CAT3 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT3 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 2" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 3" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And course in management listing should be visible "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be dimmed "CAT1"
And category in management listing should be dimmed "CAT2"
And category in management listing should be dimmed "CAT3"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be dimmed "CAT1"
And category in management listing should be dimmed "CAT2"
And category in management listing should be dimmed "CAT3"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And course in management listing should be dimmed "C1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/recommend_activities.feature
@core @core_course @javascript
Feature: Recommending activities
As an admin I want to recommend activities in the activity chooser
Scenario: As an admin I can recommend activities from an admin setting page.
Given I log in as "admin"
And I am on site homepage
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
And I navigate to "Courses > Add a new course" in site administration
When I navigate to "Courses > Activity chooser > Recommended activities" in site administration
Then "input[aria-label=\"Recommend activity: Assignment\"][checked=checked]" "css_element" should exist
And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
Scenario: As an admin I can remove recommend activities from an admin setting page.
Given I log in as "admin"
And I am on site homepage
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
And I navigate to "Courses > Add a new course" in site administration
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
And "input[aria-label=\"Recommend activity: Assignment\"][checked=checked]" "css_element" should exist
And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
And I navigate to "Courses > Add a new course" in site administration
When I navigate to "Courses > Activity chooser > Recommended activities" in site administration
Then "input[aria-label=\"Recommend activity: Assignment\"]:not([checked=checked])" "css_element" should exist
And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_groupmode.feature
@core @core_course @javascript
Feature: Activities group mode icons behavior in course page
Scenario Outline: Teachers should see group mode icons in both view and edit mode
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | <courseformat> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| forum | No groups forum | Forum with groupmode = 0 | C1 | forum1 | 0 |
| data | Visible groups database | Database with groupmode = 2 | C1 | data1 | 2 |
| assign | Separate groups assignment | Assignment with groupmode = 1 | C1 | assign1 | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode <editmode>
Then "Separate groups" "icon" should not exist in the "No groups forum" "activity"
And "Visible groups" "icon" should not exist in the "No groups forum" "activity"
And "Separate groups" "icon" should not exist in the "Visible groups database" "activity"
And "Visible groups" "icon" should exist in the "Visible groups database" "activity"
And "Separate groups" "icon" should exist in the "Separate groups assignment" "activity"
And "Visible groups" "icon" should not exist in the "Separate groups assignment" "activity"
Examples:
| editmode | courseformat |
| off | topics |
| on | topics |
| off | weeks |
| on | weeks |
Scenario Outline: Students should not see group mode icons in both view and edit mode
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | <courseformat> |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| forum | No groups forum | Forum with groupmode = 0 | C1 | forum1 | 0 |
| data | Visible groups database | Database with groupmode = 2 | C1 | data1 | 2 |
| assign | Separate groups assignment | Assignment with groupmode = 1 | C1 | assign1 | 1 |
When I am on the "C1" "Course" page logged in as "student1"
Then "Separate groups" "icon" should not exist in the "No groups forum" "activity"
And "Visible groups" "icon" should not exist in the "No groups forum" "activity"
And "Separate groups" "icon" should not exist in the "Visible groups database" "activity"
And "Visible groups" "icon" should not exist in the "Visible groups database" "activity"
And "Separate groups" "icon" should not exist in the "Separate groups assignment" "activity"
And "Visible groups" "icon" should not exist in the "Separate groups assignment" "activity"
# Giving moodle/course:manageactivities capability would let them see the icons.
And the following "role capability" exists:
| role | student |
| moodle/course:manageactivities | allow |
And I am on the "C1" "Course" page
And "Visible groups" "icon" should exist in the "Visible groups database" "activity"
And "Separate groups" "icon" should exist in the "Separate groups assignment" "activity"
Examples:
| courseformat |
| topics |
| weeks |
Scenario Outline: Resources don't support group mode never show groupmode icon in the course page
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | <courseformat> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| page | No groups page | Page with groupmode = 0 | C1 | page0 | 0 |
| page | Visible groups page | Page with groupmode = 2 | C1 | page2 | 2 |
| page | Separate groups page | Page with groupmode = 1 | C1 | page1 | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
Then "Separate groups" "icon" should not exist in the "No groups page" "activity"
And "Visible groups" "icon" should not exist in the "No groups page" "activity"
And "Separate groups" "icon" should not exist in the "Visible groups page" "activity"
And "Visible groups" "icon" should not exist in the "Visible groups page" "activity"
And "Separate groups" "icon" should not exist in the "Separate groups page" "activity"
And "Visible groups" "icon" should not exist in the "Separate groups page" "activity"
Examples:
| courseformat |
| topics |
| weeks |
Scenario Outline: Group mode icon behavior in the course page when forcing group mode in course settings
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | groupmodeforce | groupmode |
| Course 1 | C1 | <courseformat> | 1 | <groupmode> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| forum | No groups forum | Forum with groupmode = 0 | C1 | forum1 | 0 |
| data | Visible groups database | Database with groupmode = 2 | C1 | data1 | 2 |
| assign | Separate groups assignment | Assignment with groupmode = 1 | C1 | assign1 | 1 |
| page | No groups page | Doesn't support groupmode | C1 | page | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
Then "Separate groups" "icon" <separate> in the "No groups forum" "activity"
And "Visible groups" "icon" <visible> in the "No groups forum" "activity"
And "Separate groups" "icon" <separate> in the "Visible groups database" "activity"
And "Visible groups" "icon" <visible> in the "Visible groups database" "activity"
And "Separate groups" "icon" <separate> in the "Separate groups assignment" "activity"
And "Visible groups" "icon" <visible> in the "Separate groups assignment" "activity"
And "Separate groups" "icon" should not exist in the "No groups page" "activity"
And "Visible groups" "icon" should not exist in the "No groups page" "activity"
Examples:
| courseformat | groupmode | separate | visible |
| topics | 0 | should not exist | should not exist |
| topics | 1 | should exist | should not exist |
| topics | 2 | should not exist | should exist |
| weeks | 0 | should not exist | should not exist |
| weeks | 1 | should exist | should not exist |
| weeks | 2 | should not exist | should exist |
Scenario Outline: Group mode icon in the course page in small devices
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | <courseformat> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| forum | Forum | Forum with groupmode = 0 | C1 | forum1 | 0 |
| data | Database | Database with groupmode = 2 | C1 | data1 | 2 |
| assign | Assignment | Assignment with groupmode = 1 | C1 | assign1 | 1 |
| page | Page | Doesn't support groupmode | C1 | page | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
And I should not see "Separate groups"
And I should not see "Visible groups"
And I change viewport size to "480x800"
And I should see "Separate groups"
And I should see "Visible groups"
Examples:
| courseformat |
| topics |
| weeks |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_tags_deletion.feature
@core @core_course @core_tag
Feature: Delete activity tags during course reset
As an admin,
I should be able to delete activity tags by performing course reset
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "activities" exist:
| activity | name | course | idnumber |
| book | Test Book | C1 | book1 |
| forum | Test Forum | C1 | forum1 |
| glossary | Test Glossary | C1 | glossary1 |
@javascript
Scenario: Delete book chapter tags using course reset
# Added multiple tags to confirm that all tags are deleted on course reset.
Given the following "mod_book > chapters" exist:
| book | title | content | tags |
| Test Book | Chapter 1 | Chapter 1 content | SampleTag, ChapterTag |
# Perform course reset without checking anything.
And I log in as "admin"
And I am on the "Course 1" "reset" page
And I press "Reset"
And I press "Continue"
# Confirm that book chapter tags are not deleted.
When I am on the "Test Book" "book activity" page
Then I should see "SampleTag"
And I should see "ChapterTag"
# Delete book chapter tags using course reset.
And I am on the "Course 1" "reset" page
And I expand all fieldsets
And I click on "Remove all book tags" "checkbox"
And I press "Reset"
# Confirm that book chapter tags are deleted.
And I should see "Book tags have been deleted" in the "Books" "table_row"
And I press "Continue"
And I am on the "Test Book" "book activity" page
And I should not see "SampleTag"
And I should not see "ChapterTag"
@javascript
Scenario Outline: Delete forum discussion tags using course reset
Given the following "mod_forum > discussions" exist:
| user | forum | name | message | tags |
| admin | forum1 | Discussion 1 | Discussion 1 message | SampleTag, DiscussionTag |
# Perform course reset without checking anything.
And I am on the "Course 1" "reset" page logged in as admin
And I press "Reset"
And I press "Continue"
# Confirm that forum discussion tags are not deleted.
When I am on the "Test Forum" "forum activity" page
And I follow "Discussion 1"
Then I should see "SampleTag"
And I should see "DiscussionTag"
And I am on the "Course 1" "reset" page
And I expand all fieldsets
# Depending on <resetcheck> value, either delete all discussion posts or remove all forum discussion tags only.
And I click on "<resetcheck>" "checkbox"
# Confirm `Remove all forum tags` is disabled when `Delete all posts` on previous step is checked.
And the "Remove all forum tags" "checkbox" should be <canbechecked>
And I press "Reset"
And I should see "<resetmessage>" in the "Forums" "table_row"
And I press "Continue"
And I am on the "Test Forum" "forum activity" page
# Confirm discussion is deleted when `Delete all posts` was checked.
And I <forumview> see "There are no discussion topics yet in this forum"
# Confirm all discussion tags are deleted.
And I should not see "SampleTag"
And I should not see "DiscussionTag"
Examples:
| resetcheck | resetmessage | canbechecked | forumview |
| Delete all posts | Delete all posts | disabled | should |
| Remove all forum tags | Forum tags have been deleted | enabled | should not |
@javascript
Scenario Outline: Delete glossary entry tags using course reuse
Given the following "mod_glossary > entries" exist:
| glossary | concept | definition | user | tags |
| Test Glossary | Aubergine | Also eggpgplant | admin | SampleTag, GlossaryTag |
# Perform course reset without checking anything.
And I am on the "Course 1" "reset" page logged in as admin
And I press "Reset"
And I press "Continue"
# Confirm that glossary entry tags are not deleted.
When I am on the "Test Glossary" "glossary activity" page
Then I should see "SampleTag"
And I should see "GlossaryTag"
And I am on the "Course 1" "reset" page
And I expand all fieldsets
# Depending on <resetcheck> value, either delete all glossary entries or remove all glossary entry tags only.
And I click on "<resetcheck>" "checkbox"
# Confirm `Remove all forum tags` is disabled when `Delete entries from all glossaries` on previous step is checked.
And the "Remove all glossary tags" "checkbox" should be <canbechecked>
And I press "Reset"
And I should see "<resetmessage>" in the "Glossaries" "table_row"
And I press "Continue"
And I am on the "Test Glossary" "glossary activity" page
# Confirm glossary entries are deleted when `Delete entries from all glossaries` is checked.
And I <glossaryview> see "No entries found in this section"
# Confirm that glossary entry tags are deleted.
And I should not see "SampleTag"
And I should not see "GlossaryTag"
Examples:
| resetcheck | resetmessage | canbechecked | glossaryview |
| Delete entries from all glossaries | Delete entries from all glossaries | disabled | should |
| Remove all glossary tags | Glossary tags have been deleted | enabled | should not |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activities_visibility_icons.feature
@core @core_course @_cross_browser
Feature: Toggle activities visibility from the course page
In order to delay activities availability
As a teacher
I need to quickly change the visibility of an activity
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | section | idnumber | name | intro | id_visible |
| assign | C1 | 1 | 1 | Test assignment name | Test assignment description | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
@javascript
Scenario: Hide/Show toggle with javascript enabled
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | C1F1 |
| name | Test forum name |
| visible | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I open "Test forum name" actions menu
And I choose "Availability > Hide on course page" in the open action menu
Then "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And I choose "Availability > Show on course page" in the open action menu
And "Test forum name" activity should be visible
And I open "Test forum name" actions menu
And I choose "Availability > Hide on course page" in the open action menu
And "Test forum name" activity should be hidden
And I reload the page
And "Test forum name" activity should be hidden
# Make sure that "Availability" dropdown in the edit menu has two options: Show/Hide.
And I open "Test forum name" actions menu
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should not contain "Make available but don't show on course page"
And the field "Availability" matches value "Hide on course page"
And I press "Save and return to course"
And "Test forum name" activity should be hidden
# Student should not see this activity.
And I am on the "Course 1" course page logged in as student1
And I should not see "Test forum name"
@javascript
Scenario: Activities can be made available and unavailable inside a hidden section
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | C1F1 |
| section | 2 |
| name | Test forum name |
| visible | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I hide section "2"
And "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And I choose "Availability > Make available but don't show on course page" in the open action menu
Then "Test forum name" activity should be available but hidden from course page
And I open "Test forum name" actions menu
And I choose "Availability > Hide on course page" in the open action menu
And "Test forum name" activity should be hidden
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "Test forum name" actions menu
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Hide on course page"
And the "Availability" select box should contain "Make available but don't show on course page"
And the "Availability" select box should not contain "Show on course page"
And I set the field "Availability" to "Make available but don't show on course page"
And I press "Save and return to course"
And "Test forum name" activity should be available but hidden from course page
And I turn editing mode off
And "Test forum name" activity should be available but hidden from course page
# Student will not see the module on the course page but can access it from other reports and blocks:
And I am on the "Course 1" course page logged in as student1
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"
And I should see "There are no discussion topics yet in this forum"
@javascript
Scenario: Activities can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I open "Test assignment name" actions menu
And I choose "Availability > Make available but don't show on course page" in the open action menu
Then "Test assignment name" activity should be available but hidden from course page
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "Test assignment name" actions menu
And I click on "Edit settings" "link" in the "Test assignment name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "Test assignment name" activity should be available but hidden from course page
And I turn editing mode off
And "Test assignment name" activity should be available but hidden from 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 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"
And I should see "Submission status"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/force_group_mode.feature
@core @core_course @_cross_browser
Feature: Force group mode in a course
In order to use the same group mode all over the course
As a teacher
I need to force the group mode of all course's activities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name |
| chat | C1 | Chat room |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Settings" in current page administration
@javascript
Scenario: Forced group mode using separate groups
Given I set the following fields to these values:
| Group mode | Separate groups |
| Force group mode | Yes |
When I press "Save and display"
Then "//a/child::img[contains(@alt, 'Separate groups (forced mode)')]" "xpath_element" should not exist
And "//img[contains(@alt, 'Separate groups (forced mode)')]" "xpath_element" should not exist
@javascript
Scenario: Forced group mode using visible groups
Given I set the following fields to these values:
| Group mode | Visible groups |
| Force group mode | Yes |
And I press "Save and display"
Then "//a/child::img[contains(@alt, 'Visible groups (forced mode)')]" "xpath_element" should not exist
And "//img[contains(@alt, 'Visible groups (forced mode)')]" "xpath_element" should not exist
@javascript
Scenario: Forced group mode without groups
Given I set the following fields to these values:
| Group mode | No groups |
| Force group mode | Yes |
And I press "Save and display"
Then "//a/child::img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exist
And "//img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/create_delete_course.feature
@core @core_course
Feature: Test we can both create and delete a course.
As a Moodle admin
I need to test I can create a course
I need to test I can delete a course
Scenario: Create a course
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "No courses in this category" in the "#course-listing" "css_element"
And I click on "Create new course" "link" in the ".course-listing-actions" "css_element"
And I set the following fields to these values:
| Course full name | Test course: create a course |
| Course short name | TCCAC |
| Course ID number | TC3401 |
| Course summary | This course has been created by automated tests. |
And I press "Save and return"
# Redirect
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course: create a course" in the "#course-listing" "css_element"
@javascript
Scenario: Delete a course via its management listing
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Test course: create a course | TCCAC | TC3401 |
| CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course: create a course" in the "#course-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
And I click on "delete" action for "Test course: create a course" in management course listing
# Redirect
And I should see "Delete TCCAC"
And I should see "Test course: create a course (TCCAC)"
And I press "Delete"
# Redirect
And I should see "Deleting TCCAC"
And I should see "TCCAC has been completely deleted"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
@javascript
Scenario: Delete a course via its management details page
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Test course: create a course | TCCAC | TC3401 |
| CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course: create a course" in the "#course-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
And I click on course "Test course: create a course" in the management interface
# Redirect
And I should see the "Course categories and courses" management page with a course selected
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course: create a course" in the "#course-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
And I should see "Test course: create a course" in the "#course-detail" "css_element"
And I click on "Delete" "link" in the ".course-detail-listing-actions" "css_element"
# Redirect
And I should see "Delete TCCAC"
And I should see "Test course: create a course (TCCAC)"
And I press "Delete"
# Redirect
And I should see "Deleting TCCAC"
And I should see "TCCAC has been completely deleted"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/add_activities.feature
@core @core_course
Feature: Add activities to courses
In order to provide tools for students learning
As a teacher
I need to add activites to a course
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | Course 1 | topics |
@javascript
Scenario: Add an activity to a course
Given I log in as "admin"
When I add a data activity to course "Course 1" section "3" and I fill the form with:
| Name | Test name |
| Description | Test database description |
| ID number | TESTNAME |
| Allow comments on entries | Yes |
| Force language | English |
Then I should not see "Adding a new"
And I turn editing mode on
And I open "Test name" actions menu
And I click on "Edit settings" "link" in the "Test name" activity
And the following fields match these values:
| Name | Test name |
| ID number | TESTNAME |
| Allow comments on entries | Yes |
| Force language | English ‎(en)‎ |
Scenario: Add an activity supplying only the name
Given I log in as "admin"
When I add a data activity to course "Course 1" section "3" and I fill the form with:
| Name | Test name |
Then I should see "Test name"
Scenario: Set activity description to required then add an activity supplying only the name
Given the following config values are set as admin:
| requiremodintro | 1 |
And I log in as "admin"
And I add a data activity to course "Course 1" section "3" and I fill the form with:
| Name | Test name |
Then I should see "Required"
Scenario: The activity description should use the user's preferred editor on creation
Given the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | textarea |
And I am logged in as admin
When I add a data activity to course "Course 1" section "3"
Then the field "Description format" matches value "0"
@javascript
Scenario: The activity description should preserve the format used once edited (markdown version)
Given the following "activities" exist:
| activity | name | intro | introformat | course |
| assign | A4 | Desc 4 | 4 | Course 1 |
And the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | textarea |
And I am logged in as admin
And I am on "Course 1" course homepage with editing mode on
And I open "A4" actions menu
When I click on "Edit settings" "link" in the "A4" activity
Then the field "Description format" matches value "4"
@javascript
Scenario: The activity description should preserve the format used once edited (plain text version)
Given the following "activities" exist:
| activity | name | intro | introformat | course |
| assign | A2 | Desc 2 | 2 | Course 1 |
And the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | textarea |
And I am logged in as admin
And I am on "Course 1" course homepage with editing mode on
And I open "A2" actions menu
When I click on "Edit settings" "link" in the "A2" activity
Then the field "Description format" matches value "2"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/view_subfolders_inline.feature
@core @core_course
Feature: View subfolders in a course in-line
In order to provide different view options for folders
As a teacher
I need to add a folders and subfolders and view them inline
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | display | showexpanded |
| folder | C1 | Test folder | 0 | 0 |
And I am on the "Test folder" "folder activity" page logged in as "teacher1"
And I press "Edit"
And I press "Create folder"
And I set the field "New folder name" to "Test subfolder 1"
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
And I press "Save changes"
@javascript
Scenario: Add a folder with two subfolders - view on separate page
Given I am on "Course 1" course homepage
And I should not see "Test subfolder 1"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 1"
And I press "Edit"
And I press "Create folder"
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 1" course homepage
Then I should not see "Test subfolder 2"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
@javascript
Scenario: Make the subfolders viewable inline on the course page
Given I press "Edit"
And I click on "div.fp-filename" "css_element" in the "div.fp-filename-field" "css_element"
And I press "Create folder"
And I set the field "New folder name" to "Test sub subfolder"
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
And I press "Save changes"
And I navigate to "Settings" in current page administration
When I set the field "Display folder contents" to "Inline on a course page"
And I press "Save and return to course"
Then I should see "Test subfolder 1"
And I should not see "Test sub subfolder"
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
And I press "Save and return to course"
Then I should see "Test subfolder 1"
And I should see "Test sub subfolder"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/role_renaming.feature
@core @core_course
Feature: Rename roles in a course
In order to account for course-level differences
As a teacher
I need to be able to rename roles
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: Teacher can rename roles
Given I am on the "Course 1" "renameroles" page logged in as "teacher1"
When I set the following fields to these values:
| Your word for 'Teacher' | Lecturer |
| Your word for 'Student' | Learner |
And I press "Save"
And I navigate to course participants
Then I should see "Lecturer (Teacher)" in the "Teacher 1" "table_row"
And I should see "Learner (Student)" in the "Student 1" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to course participants
And I should see "Lecturer" in the "Teacher 1" "table_row"
And I should see "Learner" in the "Student 1" "table_row"
And I should not see "Lecturer (Teacher)" in the "Teacher 1" "table_row"
And I should not see "Learner (Student)" in the "Student 1" "table_row"
Scenario: Ability to rename roles can be prevented
Given the following "role capability" exists:
| role | editingteacher |
| moodle/course:renameroles | inherit |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to course participants
Then I should not see "Role renaming"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_force_language.feature
@core_course
Feature: Force course language
To be able to force a language for the course
As a teacher
I need to be able to set force language setting for the course
Background:
Given remote langimport tests are enabled
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "language pack" exists:
| language | fr | es |
Scenario: A teacher can set a course language
Given I am on the "Course 1" course page logged in as "teacher1"
# Site default language is English.
And I should see "Settings"
And I follow "Preferences" in the user menu
And I follow "Preferred language"
# Change preferred language to French.
And I set the field "Preferred language" to "fr"
And I press "Save changes"
And I am on "Course 1" course homepage
And I should see "Paramètres"
# Change course language to Spanish.
And I navigate to "Paramètres" in current page administration
When I set the following fields to these values:
| id_lang | es |
And I press "Enregistrer et afficher"
# Course language is now Spanish.
Then I should see "Configuración"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_summary_format.feature
@core @core_course
Feature: Summary text format should be preserved on edit and set by preferred editor format on creation
In order to edit the course summary
As a course creator
The format specified for the summary must be honored
Scenario: Preferred editor format should be used for summary field on course creation
Given the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | textarea |
And I log in as "admin"
And I go to the courses management page
When I click on "Create new course" "link"
Then the field "Course summary format" matches value "0"
Scenario: Summary format must be preserved on course edit
Given the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | textarea |
And I log in as "admin"
And I go to the courses management page
And I click on "Create new course" "link"
And I set the following fields to these values:
| Course full name | C1 |
| Course short name | C1 |
| Course summary | Course description |
# 4 is assumed to be Markdown format.
And I set the field with xpath "//select[@name='summary_editor[format]']" to "4"
And I press "Save and display"
When I click on "Settings" "link"
Then the field "Course summary format" matches value "4"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/section_visibility.feature
@core @core_course @_cross_browser
Feature: Show/hide course sections
In order to delay sections availability
As a teacher
I need to show or hide sections
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | hiddensections | enablecompletion | coursedisplay |
| Course 1 | C1 | topics | 0 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | section | name | visible |
| forum | C1 | 1 | Test hidden forum 11 name | 0 |
| forum | C1 | 1 | Test hidden forum 12 name | 1 |
| forum | C1 | 2 | Test hidden forum 21 name | 0 |
| forum | C1 | 2 | Test hidden forum 22 name | 1 |
| forum | C1 | 3 | Test hidden forum 31 name | 0 |
| forum | C1 | 3 | Test hidden forum 32 name | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Show / hide section icon functions correctly
When I hide section "1"
Then section "1" should be hidden
And section "2" should be visible
And section "3" should be visible
And I hide section "2"
And section "2" should be hidden
And I show section "2"
And section "2" should be visible
And I hide section "3"
And I show section "3"
And I hide section "3"
And section "3" should be hidden
And I reload the page
And section "1" should be hidden
And all activities in section "1" should be hidden
And section "2" should be visible
And section "3" should be hidden
And all activities in section "1" should be hidden
And I am on the "Course 1" course page logged in as student1
And section "1" should be hidden
And all activities in section "1" should be hidden
And section "2" should be visible
And section "3" should be hidden
And all activities in section "1" should be hidden
@javascript
Scenario: Students can not navigate to hidden sections
Given I hide section "2"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I click on "Topic 1" "link" in the "region-main" "region"
Then I should see "Topic 2" in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I am on the "Course 1" course page logged in as student1
And I click on "Topic 1" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I click on "Topic 3" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
@javascript
Scenario: Students can not navigate to restricted sections
Given the following "activities" exist:
| activity | course | section | name | completion |
| label | C1 | 1 | Test label | 1 |
And I edit the section "2"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| cm | Test label |
| Required completion status | must be marked complete |
And I press "Save changes"
When I click on "Topic 1" "link" in the "region-main" "region"
Then I should see "Topic 2" in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I am on the "Course 1" course page logged in as student1
And I click on "Topic 1" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I click on "Topic 3" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_creation.feature
@core @core_course
Feature: Managers can create courses
In order to group users and contents
As a manager
I need to create courses and set default values on them
@javascript
Scenario: Courses are created with the default announcements forum
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
And I enrol "Teacher 1" user as "Teacher"
And I enrol "Student 1" user as "Student"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
And I am on the Announcements "forum activity" page
And "Add discussion topic" "link" should exist
And I navigate to "Subscriptions" in current page administration
And I should see "Forced subscription"
And I log out
And I am on the Announcements "forum activity" page logged in as student1
And "Add a new topic" "link" should not exist
Scenario: Create a course from the management interface and return to it
Given the following "courses" exist:
| fullname | shortname | idnumber | startdate | enddate |
| Course 1 | Course 1 | C1 | 957139200 | 960163200 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Categories" management page
And I click on category "Category 1" in the management interface
And I should see the "Course categories and courses" management page
And I click on "Create new course" "link" in the "#course-listing" "css_element"
When I set the following fields to these values:
| Course full name | Course 2 |
| Course short name | Course 2 |
| Course summary | Course 2 summary |
| id_startdate_day | 24 |
| id_startdate_month | October |
| id_startdate_year | 2015 |
| id_enddate_day | 24 |
| id_enddate_month | October |
| id_enddate_year | 2016 |
And I press "Save and return"
Then I should see the "Course categories and courses" management page
And I click on "Sort by Course time created ascending" "link" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I click on "Course 2" "link" in the "region-main" "region"
And I click on "Edit" "link" in the ".course-detail" "css_element"
And the following fields match these values:
| Course full name | Course 2 |
| Course short name | Course 2 |
| Course summary | Course 2 summary |
| id_startdate_day | 24 |
| id_startdate_month | October |
| id_startdate_year | 2015 |
| id_enddate_day | 24 |
| id_enddate_month | October |
| id_enddate_year | 2016 |
Scenario: Create a course as a custom course creator
Given the following "users" exist:
| username | firstname | lastname | email |
| kevin | Kevin | the | [email protected] |
And the following "roles" exist:
| shortname | name | archetype |
| creator | Creator | |
And the following "system role assigns" exist:
| user | role | contextlevel |
| kevin | creator | System |
And the following "role capability" exists:
| role | creator |
| moodle/course:create | allow |
| moodle/course:manageactivities | allow |
| moodle/course:viewparticipants | allow |
And I log in as "kevin"
And I am on site homepage
When I press "Add a new course"
And I set the following fields to these values:
| Course full name | My first course |
| Course short name | myfirstcourse |
And I press "Save and display"
And I follow "Participants"
Then I should see "My first course"
And I should see "Participants"
Scenario: Creators' role in new courses setting behavior
Given the following "users" exist:
| username | firstname | lastname | email |
| kevin | Kevin | the | [email protected] |
And the following "system role assigns" exist:
| user | role | contextlevel |
| kevin | coursecreator | System |
And I log in as "admin"
And I set the following administration settings values:
| Creators' role in new courses | Non-editing teacher |
And I log out
And I log in as "kevin"
And I am on site homepage
When I press "Add a new course"
And I set the following fields to these values:
| Course full name | My first course |
| Course short name | myfirstcourse |
And I press "Save and display"
And I click on "Participants" "link"
Then I should see "Non-editing teacher" in the "Kevin the" "table_row"
@javascript
Scenario: Create a course as admin
Given I log in as "admin"
And the following config values are set as admin:
| enroladminnewcourse | 0 |
And I navigate to "Courses > Add a new course" in site administration
And I set the following fields to these values:
| Course full name | My first course |
| Course short name | myfirstcourse |
And I press "Save and display"
And I navigate to course participants
Then I should not see "Teacher"
And I should see "Nothing to display"
And the following config values are set as admin:
| enroladminnewcourse | 1 |
And I navigate to "Courses > Add a new course" in site administration
And I set the following fields to these values:
| Course full name | My second course |
| Course short name | mysecondcourse |
And I press "Save and display"
And I navigate to course participants
And I should see "Teacher"
And I should not see "Nothing to display"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/paged_course_information.feature
@core @core_course
Feature: Course paged mode information
In order to split the course in parts
As a teacher
I need to display the proper section information in a paged mode course
@javascript
Scenario Outline: Section summary information for teachers and students in paged courses
Given the following "courses" exist:
| fullname | shortname | category | format | numsections | coursedisplay | enablecompletion |
| Course 1 | C1 | 0 | <courseformat> | 3 | 1 | <completion> |
And the following "activities" exist:
| activity | course | name | section | completion |
| chat | C1 | Chat room | 1 | <completion> |
| data | C1 | Database | 1 | <completion> |
| forum | C1 | First forum | 2 | <completion> |
| forum | C1 | Second forum | 2 | <completion> |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | First | [email protected] |
| teacher1 | Teacher | First | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
When I log in as "<user>"
And I am on "Course 1" course homepage
Then I should see "Chat: 1" in the "#section-1" "css_element"
And I should see "Database: 1" in the "#section-1" "css_element"
And I should <show> "Progress:" in the "#section-1" "css_element"
And I should see "Forums: 2" in the "#section-2" "css_element"
And I should <show> "Progress:" in the "#section-2" "css_element"
Examples:
| user | courseformat | completion | show |
| student1 | topics | 0 | not see |
| student1 | weeks | 0 | not see |
| student1 | topics | 1 | see |
| student1 | weeks | 1 | see |
| teacher1 | topics | 0 | not see |
| teacher1 | weeks | 0 | not see |
| teacher1 | topics | 1 | see |
| teacher1 | weeks | 1 | see |
@javascript
Scenario Outline: Section summary information for guest in paged courses
Given the following "courses" exist:
| fullname | shortname | category | format | numsections | coursedisplay | enablecompletion |
| Course 1 | C1 | 0 | <courseformat> | 3 | 1 | <completion> |
And the following "activities" exist:
| activity | course | name | section | completion |
| chat | C1 | Chat room | 1 | <completion> |
| data | C1 | Database | 1 | <completion> |
| forum | C1 | First forum | 2 | <completion> |
| forum | C1 | Second forum | 2 | <completion> |
And I am on the "Course 1" "enrolment methods" page logged in as admin
And I click on "Enable" "link" in the "Guest access" "table_row"
And I log out
When I log in as "guest"
And I am on "Course 1" course homepage
Then I should see "Chat: 1" in the "#section-1" "css_element"
And I should see "Database: 1" in the "#section-1" "css_element"
And I should not see "Progress:" in the "#section-1" "css_element"
And I should see "Forums: 2" in the "#section-2" "css_element"
And I should not see "Progress:" in the "#section-2" "css_element"
Examples:
| courseformat | completion |
| topics | 0 |
| weeks | 0 |
| topics | 1 |
| weeks | 1 |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_communication_defaults.feature
@core @core_course @communication
Feature: Course communication
In order to create a new communication room in for course
As an admin
I should not have any plugins enabled by default for new and existing courses
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And I enable communication experimental feature
And I log in as "admin"
Scenario: I should have matrix plugin by default for new courses
Given I go to the courses management page
And I click on category "Category 1" in the management interface
And I follow "Create new course"
And I set the following fields to these values:
| Course full name | Course 2 |
| Course short name | C2 |
And I press "Save and display"
When I navigate to "Communication" in current page administration
Then the field "Provider" matches value "None"
Scenario: I should have communication disabled by default for existing courses
Given I am on "Course 1" course homepage
When I navigate to "Communication" in current page administration
Then the field "Provider" matches value "None"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_request.feature
@core @core_course @javascript
Feature: Users can request and approve courses
As a moodle admin
In order to improve course creation process
I need to be able to enable course approval
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | [email protected] |
| user2 | User | 2 | [email protected] |
| user3 | User | 3 | [email protected] |
Scenario: Simple course request workflow
Given the following "system role assigns" exist:
| user | course | role |
| user2 | Acceptance test site | manager |
And the following config values are set as admin:
| lockrequestcategory | 1 |
And the following "role capability" exists:
| role | user |
| moodle/course:request | allow |
When I log in as "user1"
And I am on course index
And I click on "More actions" "button"
And I click on "Request a course" "link"
And I set the following fields to these values:
| Course full name | My new course |
| Course short name | Mynewcourse |
| Supporting information | pretty please |
And I press "Request a course"
And I should see "Course request submitted."
And I press "Continue"
And I am on course index
And I should not see "My new course"
And I log out
And I log in as "user2"
And I am on course index
And I click on "More actions" "button"
And I click on "Courses pending approval" "link"
And the following should exist in the "pendingcourserequests" table:
| Requested by | Course short name | Course full name | Category | Reason for course request |
| User 1 | Mynewcourse | My new course | Category 1 | pretty please |
And I click on "Approve" "button" in the "My new course" "table_row"
And I press "Save and return"
And I should see "There are no courses pending approval"
And I press "Back to course listing"
And I should see "My new course"
And I log out
And I log in as "user1"
And I am on course index
And I follow "My new course"
And I navigate to course participants
And I should see "Teacher" in the "User 1" "table_row"
And I log out
Scenario: Course request with category selection
Given the following "categories" exist:
| name | category | idnumber |
| Science category | 0 | SCI |
| English category | 0 | ENG |
| Other category | 0 | MISC |
Given the following "roles" exist:
| name | shortname | description | archetype |
| Course requestor | courserequestor | My custom role 1 | |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | courserequestor | Category | SCI |
| user1 | courserequestor | Category | ENG |
| user2 | manager | Category | SCI |
| user3 | manager | Category | ENG |
And the following "role capability" exists:
| role | courserequestor |
| moodle/course:request | allow |
And I log in as "user1"
And I am on course index
And I follow "English category"
And I click on "More actions" "button"
And I click on "Request a course" "link"
And I should see "English category" in the ".form-autocomplete-selection" "css_element"
And I set the following fields to these values:
| Course full name | My new course |
| Course short name | Mynewcourse |
| Supporting information | pretty please |
And I press "Request a course"
And I log out
And I log in as "user2"
And I am on course index
And I follow "English category"
And I should not see "More" in the "region-main" "region"
And I should not see "Courses pending approval"
And I am on course index
And I follow "Science category"
And I click on "More actions" "button"
And I click on "Courses pending approval" "link"
And I should not see "Mynewcourse"
And I press "Back to course listing"
And I log out
And I log in as "user3"
And I am on course index
And I follow "English category"
And I click on "More actions" "button"
And I click on "Courses pending approval" "link"
And the following should exist in the "pendingcourserequests" table:
| Requested by | Course short name | Course full name | Category | Reason for course request |
| User 1 | Mynewcourse | My new course | English category | pretty please |
And I click on "Approve" "button" in the "Mynewcourse" "table_row"
And I press "Save and return"
And I am on course index
And I follow "English category"
And I should see "My new course"
And I log out
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/other_users.feature
@core @core_course @javascript
Feature: Test if displaying the course other users works correctly:
As a user I need to see the other users who have permissions in a course without being enrolled.
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | CAT1 | topics |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| manager1 | Manager | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Test other users list in a course
Given I log in as "admin"
And I am on the "Course 1" "other users" page
And I should see "Course 1: 0 other users"
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager1 | manager | System | |
And I am on the "Course 1" "other users" page
And I should see "Course 1: 1 other users"
And I should see "Manager 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/restrict_available_activities.feature
@core @core_course
Feature: Restrict activities availability
In order to prevent the use of some activities
As an admin
I need to control which activities can be used in courses
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | 0 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name |
| chat | C1 | Test chat name |
@javascript
Scenario: Activities can be added with the default permissions
Given I log in as "teacher1"
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 |
Then I should see "Test glossary name"
And I should see "Test chat name"
@javascript @skip_chrome_zerosize
Scenario: Activities can not be added when the admin restricts the permissions
Given the following "role capability" exists:
| role | editingteacher |
| mod/chat:addinstance | prohibit |
And I log in as "admin"
And I am on the "Course 1" "permissions" page
And I override the system permissions of "Teacher" role with:
| mod/glossary:addinstance | Prohibit |
And I log out
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
Then "Add a new Chat" "link" should not exist in the "Add an activity or resource" "dialogue"
Then "Add a new Glossary" "link" should not exist in the "Add an activity or resource" "dialogue"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_search.feature
@core @core_course
Feature: Courses can be searched for and moved in bulk.
In order to manage a large number of courses
As a Moodle Administrator
I need to be able to search courses in bulk and move them around
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Science | 0 | SCI |
| English | 0 | ENG |
| Miscellaneous | 0 | MISC |
And the following "courses" exist:
| fullname | shortname | category |
| Biology Y1 | BIO1 | MISC |
| Biology Y2 | BIO2 | MISC |
| English Y1 | ENG1 | ENG |
| English Y2 | ENG2 | MISC |
Scenario: Search courses finds correct results
Given I log in as "admin"
And I go to the courses management page
When I set the field "Search" to "Biology"
And I press "Search"
Then I should see "Biology Y1"
And I should see "Biology Y2"
And I should not see "English Y1"
And I should not see "English Y2"
@javascript
Scenario: Search courses and move results in bulk
Given I log in as "admin"
And I go to the courses management page
And I set the field "Search" to "Biology"
And I press "Search"
When I select course "Biology Y1" in the management interface
And I select course "Biology Y2" in the management interface
And I set the field "menumovecoursesto" to "Science"
And I press "Move"
Then I should see "Successfully moved 2 courses into Science"
And I wait to be redirected
And I click on category "Science" in the management interface
And I should see "Biology Y1"
And I should see "Biology Y2"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/category_resort.feature
@core @core_course
Feature: Test we can resort categories in the management interface.
As a moodle admin
I need to test we can resort top level categories.
I need to test we can resort sub categories.
I need to test we can manually sort categories.
Scenario Outline: Test bulk sorting all categories.
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Social studies | Ext003 | 1 |
| 0 | Applied sciences | Sci001 | 2 |
| 0 | Extended social studies | Ext002 | 3 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I set the field "menuselectsortby" to "All categories"
And I set the field "menuresortcategoriesby" to <sortby>
And I press "Sort"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "Sort by Category name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Category name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Category ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Category ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
Scenario Outline: Test bulk sorting current category.
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Test category | Tes001 | 1 |
| Tes001 | Social studies | Ext003 | 2 |
| Tes001 | Applied sciences | Sci001 | 3 |
| Tes001 | Extended social studies | Ext002 | 4 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "Test category" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I set the field "menuselectsortby" to "This category"
And I set the field "menuresortcategoriesby" to <sortby>
And I press "Sort"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "Sort by Category name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Category name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Category ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Category ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
Scenario Outline: Test resorting subcategories.
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Master cat | CAT1 | 1 |
| CAT1 | Social studies | Ext003 | 1 |
| CAT1 | Applied sciences | Sci001 | 2 |
| CAT1 | Extended social studies | Ext002 | 3 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "Master cat" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I click on <sortby> action for "Master cat" in management category listing
# Redirect.
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "resortbyname" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "resortbynamedesc" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "resortbyidnumber" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "resortbyidnumberdesc" | "Applied sciences" | "Social studies" | "Extended social studies" |
@javascript
Scenario Outline: Test resorting subcategories with JS enabled.
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Master cat | CAT1 | 1 |
| CAT1 | Social studies | Ext003 | 1 |
| CAT1 | Applied sciences | Sci001 | 2 |
| CAT1 | Extended social studies | Ext002 | 3 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on "Master cat" category in the management category listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on <sortby> action for "Master cat" in management category listing
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "resortbyname" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "resortbynamedesc" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "resortbyidnumber" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "resortbyidnumberdesc" | "Applied sciences" | "Social studies" | "Extended social studies" |
# The scenario below this is the same but with JS enabled.
Scenario: Test moving categories up and down by one.
Given the following "categories" exist:
| category | idnumber | name |
| 0 | CAT1 | Cat 1 |
| 0 | CAT2 | Cat 2 |
| CAT1 | CATA | Cat 1a |
| CAT1 | CATB | Cat 1b |
| CAT1 | CATC | Cat 1c |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect. We should a 1, 1a, 1b, 1c, 2.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 2"
And I click to move category "CATA" down one
# Redirect.We should a 1, 1b, 1a, 1c, 2.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 2"
And I click to move category "CATC" up one
# Redirect. We should a 1, 1b, 1c, 1a, 2.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 2"
And I click to move category "CATA" down one
# Redirect. We should a 1, 1b, 1c, 1a, 2.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 2"
And I click to move category "CATB" up one
# Redirect. We should a 1, 1b, 1c, 1a, 2.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 2"
And I click to move category "CAT2" up one
# Redirect. We should a 2, 1.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 2" before "Cat 1"
And I click on category "Cat 1" in the management interface
# Redirect. We should a 2, 1, 1b, 1c, 1a.
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 2" before "Cat 1"
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 1a"
@javascript @_cross_browser
Scenario: Test using AJAX to move categories up and down by one.
Given the following "categories" exist:
| category | idnumber | name |
| 0 | CAT1 | Cat 1 |
| 0 | CAT2 | Cat 2 |
| CAT1 | CATA | Cat 1a |
| CAT1 | CATB | Cat 1b |
| CAT1 | CATC | Cat 1c |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see category listing "Cat 1" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 2"
And I click to move category "CATA" down one
And a new page should not have loaded since I started watching
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 2"
And I click to move category "CATC" up one
And a new page should not have loaded since I started watching
And I should see category listing "Cat 1" before "Cat 1b"
And I should see category listing "Cat 1b" before "Cat 1c"
And I should see category listing "Cat 1c" before "Cat 1a"
And I should see category listing "Cat 1a" before "Cat 2"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/paged_course_navigation.feature
@core @core_course
Feature: Course paged mode
In order to split the course in parts
As a teacher
I need to display the course in a paged mode and navigate through the different sections
@javascript @_cross_browser
Scenario Outline: Weekly and topics course formats with Javascript enabled
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage
Then I click on <section2> "link" in the <section2> "section"
And I am on "Course 1" course homepage
And I click on <section3> "link" in the <section3> "section"
And I am on "Course 1" course homepage
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.nextsection" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
And I click on <section2> "link" in the ".single-section" "css_element"
And I should see <section2> in the "div.single-section" "css_element"
And I should see <section1> in the ".single-section div.prevsection" "css_element"
And I should see <section3> in the ".single-section div.nextsection" "css_element"
And I click on <section1> "link" in the ".single-section" "css_element"
And I should see <section1> in the "div.single-section" "css_element"
And I click on <section2> "link" in the ".single-section" "css_element"
And I click on <section3> "link" in the ".single-section" "css_element"
And I should see <section3> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.prevsection" "css_element"
And I should not see <section1> in the ".single-section .section-navigation" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
And I should not see <nextunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | section1 | section2 | section3 | prevunexistingsection | nextunexistingsection |
| topics | "Topic 1" | "Topic 2" | "Topic 3" | "Topic 0" | "Topic 4" |
| weeks | "1 January - 7 January" | "8 January - 14 January" | "15 January - 21 January" | "25 December - 31 December" | "22 January - 28 January" |
@javascript
Scenario Outline: Paged section redirect after creating an activity
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 | 0 |
And the following "activities" exist:
| activity | course | name |
| chat | C1 | Chat room |
When I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.nextsection" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
Then I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.nextsection" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | section1 | section2 | prevunexistingsection |
| topics | "Topic 1" | "Topic 2" | "Topic 0" |
| weeks | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" |
Scenario Outline: Weekly and topics course formats with Javascript disabled
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage
Then I click on <section2> "link" in the <section2> "section"
And I am on "Course 1" course homepage
And I click on <section3> "link" in the <section3> "section"
And I am on "Course 1" course homepage
And I click on <section1> "link" in the <section1> "section"
And I should see <section1> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.nextsection" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
And I click on <section2> "link" in the ".single-section" "css_element"
And I should see <section2> in the "div.single-section" "css_element"
And I should see <section1> in the ".single-section div.prevsection" "css_element"
And I should see <section3> in the ".single-section div.nextsection" "css_element"
And I click on <section1> "link" in the ".single-section" "css_element"
And I should see <section1> in the "div.single-section" "css_element"
And I click on <section2> "link" in the ".single-section" "css_element"
And I click on <section3> "link" in the ".single-section" "css_element"
And I should see <section3> in the "div.single-section" "css_element"
And I should see <section2> in the ".single-section div.prevsection" "css_element"
And I should not see <section1> in the ".single-section .section-navigation" "css_element"
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
And I should not see <nextunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | section1 | section2 | section3 | prevunexistingsection | nextunexistingsection |
| topics | "Topic 1" | "Topic 2" | "Topic 3" | "Topic 0" | "Topic 4" |
| weeks | "1 January - 7 January" | "8 January - 14 January" | "15 January - 21 January" | "25 December - 31 December" | "22 January - 28 January" |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/section_highlighting.feature
@core @core_course @_cross_browser @javascript
Feature: Topic's course sections highlighting
In order to highlight parts of the course to students
As a teacher
I need to highlight one specific section
@javascript
Scenario Outline: Highlight a topic's course section with course paged mode and without it
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay |
| Course 1 | C1 | topics | <coursedisplay> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
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 1" course homepage
And section "2" should be highlighted
And section "1" should not be highlighted
And I turn section "2" highlighting off
And I wait until the page is ready
And section "2" should not be highlighted
And I reload the page
And section "2" should not be highlighted
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 1" course homepage
And section "1" should not be highlighted
And section "2" should not be highlighted
Examples:
| coursedisplay |
| 0 |
| 1 |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_browsing.feature
@core @core_course
Feature: Restricting access to course lists
In order to provide more targeted content
As a Moodle Administrator
I need to be able to give/revoke capabilities to view list of courses
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Science category | 0 | SCI |
| English category | 0 | ENG |
| Other category | 0 | MISC |
And the following "courses" exist:
| fullname | shortname | category |
| Biology Y1 | BIO1 | SCI |
| Biology Y2 | BI02 | SCI |
| English Y1 | ENG1 | ENG |
| English Y2 | ENG2 | ENG |
| Humanities Y1 | HUM2 | MISC |
And the following "users" exist:
| username | firstname | lastname | email |
| user0 | User | Z | [email protected] |
| userb | User | B | [email protected] |
| usere | User | E | [email protected] |
And the following "roles" exist:
| name | shortname | description | archetype |
| Category viewer | coursebrowse | My custom role 1 | |
And the following "role capability" exist:
| role | moodle/category:viewcourselist |
| user | prevent |
| guest | prevent |
| coursebrowse | allow |
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I log out
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| usere | coursebrowse | Category | ENG |
| userb | coursebrowse | Category | ENG |
| userb | coursebrowse | Category | SCI |
Scenario: Browse courses as a user without any browse capability
When I log in as "user0"
And I am on site homepage
Then I should not see "Available courses"
And "Courses" "link" should not exist in the "Navigation" "block"
And I log out
Scenario: Browse own courses as a user without any browse capability
Given the following "course enrolments" exist:
| user | course | role |
| user0 | BIO1 | student |
When I log in as "user0"
And I am on site homepage
And I should see "Available courses"
And I should see "Biology Y1"
And "Courses" "link" should not exist in the "Navigation" "block"
And I log out
Scenario: Browse courses as a user who has access to only one category
When I log in as "usere"
And I am on site homepage
Then I should see "Available courses"
And I should see "English Y1"
And I should see "English Y2"
And I should not see "Biology"
And I should not see "Humanities"
And I click on "Courses" "link" in the "Navigation" "block"
And "English category" "text" should exist in the ".breadcrumb" "css_element"
And I should see "English Y1"
And I should see "English Y2"
And I should not see "Biology"
And I should not see "Humanities"
And I should not see "Other category"
And I follow "English Y2"
And I should see "You cannot enrol yourself in this course."
And I log out
Scenario: Browse courses as a user who has access to several but not all categories
When I log in as "userb"
And I am on site homepage
Then I should see "Available courses"
And I should see "English Y1"
And I should see "English Y2"
And I should see "Biology"
And I should not see "Humanities"
And I click on "Courses" "link" in the "Navigation" "block"
# And "category" "text" should not exist in the ".breadcrumb" "css_element"
And I should see "Science category"
And I should see "English category"
And I should not see "Other category"
And I follow "Science category"
And I should see "Biology Y2"
And I should not see "English Y1"
And the "Course categories" select box should contain "Science category"
And the "Course categories" select box should contain "English category"
And the "Course categories" select box should not contain "Other category"
And I follow "Biology Y1"
And I should see "You cannot enrol yourself in this course."
And I log out
@javascript
Scenario: Browse courses as a user who has a disabled enrolment in them
Given the following "course enrolments" exist:
| user | course | role | status |
| usere | ENG1 | student | 1 |
When I am on the "ENG1" course page logged in as usere
Then I should see "You cannot enrol yourself in this course."
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/category_management.feature
@core @core_course
Feature: Test category management actions
As a moodle admin
Test we can create a category
Test we can create a sub category
Test we can edit a category
Test we can delete a category
Test deleting categories interface when user permissions are restricted
Test we can move a category
Test we can assign roles within a category
Test we can set permissions on a category
Test we can manage cohorts within a category
Test we can manage filters for a category
Scenario: Test editing a category through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "edit" action for "Cat 1" in management category listing
# Redirect
And I should see "Edit category settings"
And I should see "Cat 1"
And I press "Cancel"
# Redirect
And I should see the "Course categories and courses" management page
And I click on "edit" action for "Cat 1" in management category listing
# Redirect
And I should see "Edit category settings"
And I should see "Cat 1"
And I set the following fields to these values:
| Category name | Category 1 (edited) |
| Category ID number | CAT1e |
And I press "Save changes"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Category 1 (edited)" in the "#category-listing" "css_element"
And I should see "Category 1 (edited)" in the "#course-listing h3" "css_element"
@javascript
Scenario: Test deleting a categories through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 3 | 0 | CAT3 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT3 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 2" in management category listing
# Redirect
And I should see "Delete category: Cat 2"
And I should see "Contents of Cat 2"
And I should see "This category is empty"
And I press "Cancel"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 2" in management category listing
# Redirect
And I should see "Delete category: Cat 2"
And I should see "Contents of Cat 2"
And I should see "This category is empty"
And I press "Delete"
# Redirect
And I should see "Delete category: Cat 2"
And I should see "Deleted course category Cat 2"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 3" in management category listing
# Redirect
And I should see "Delete category: Cat 3"
And I set the following fields to these values:
| What to do | Move contents to another category |
| Move into | Cat 1 |
And I press "Delete"
# Redirect
And I should see "Delete category: Cat 3"
And I should see "Deleted course category Cat 3"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And I should not see "Cat 3" in the "#category-listing ul" "css_element"
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
Scenario: Test deleting categories action is not listed when permissions are restricted.
Given the following "users" exist:
| username | firstname | lastname |
| manager | Manager | Manager |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
And the following "courses" exist:
| category | fullname | shortname |
| CAT1 | Course 1 | C1 |
And the following "system role assigns" exist:
| user | role | contextlevel |
| manager | manager | System |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:delete | Prevent | manager | Course | C1 |
| moodle/course:create | Prevent | manager | System | |
When I log in as "manager"
And I go to the courses management page
Then I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I open the action menu for "Cat 1" in management category listing
And "Cat 1" category actions menu should not have "Delete" item
Scenario: Test deleting categories interface when course create permission is restricted in system.
Given the following "users" exist:
| username | firstname | lastname |
| manager | Manager | Manager |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
And the following "courses" exist:
| category | fullname | shortname |
| CAT1 | Course 1 | C1 |
And the following "system role assigns" exist:
| user | role | contextlevel |
| manager | manager | System |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:delete | Allow | manager | Course | C1 |
| moodle/course:create | Prevent | manager | System | |
When I log in as "manager"
And I go to the courses management page
And I open the action menu for "Cat 1" in management category listing
Then "Cat 1" category actions menu should have "Delete" item
And I click on "delete" action for "Cat 1" in management category listing
# Redirect
And I should see "Delete category: Cat 1"
And I should see "Contents of Cat 1"
And I should see "Delete all - cannot be undone"
And "What to do" "select" should not exist
And "Move into" "select" should not exist
And I press "Cancel"
Scenario: Test deleting categories interface when course delete permission is restricted for category.
Given the following "users" exist:
| username | firstname | lastname |
| manager | Manager | Manager |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
And the following "courses" exist:
| category | fullname | shortname |
| CAT1 | Course 1 | C1 |
And the following "system role assigns" exist:
| user | role | contextlevel |
| manager | manager | System |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:delete | Prevent | manager | Course | C1 |
| moodle/course:create | Allow | manager | System | |
When I log in as "manager"
And I go to the courses management page
And I open the action menu for "Cat 1" in management category listing
Then "Cat 1" category actions menu should have "Delete" item
And I click on "delete" action for "Cat 1" in management category listing
# Redirect
And I should see "Delete category: Cat 1"
And I should see "Contents of Cat 1"
And I should see "Move contents to another category"
And "What to do" "select" should not exist
And "Move into" "select" should exist
And the "Move into" select box should contain "Cat 2"
And the "Move into" select box should contain "Category 1"
And I press "Cancel"
@javascript
Scenario: Test deleting categories interface when course create permissions are restricted for some categories.
Given the following "users" exist:
| username | firstname | lastname |
| manager | Manager | Manager |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
And the following "courses" exist:
| category | fullname | shortname |
| CAT1 | Course 1 | C1 |
And the following "system role assigns" exist:
| user | role | contextlevel |
| manager | manager | System |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:delete | Allow | manager | Course | C1 |
| moodle/course:create | Allow | manager | System | |
| moodle/course:create | Prevent | manager | Category | CAT2 |
When I log in as "manager"
And I go to the courses management page
And I open the action menu for "Cat 1" in management category listing
Then "Cat 1" category actions menu should have "Delete" item
And I click on "delete" action for "Cat 1" in management category listing
# Redirect
And I should see "Delete category: Cat 1"
And I should see "Contents of Cat 1"
And "What to do" "select" should exist
And I expand the "Move into" autocomplete
And "Cat 2" "autocomplete_suggestions" should not exist
And "Category 1" "autocomplete_selection" should be visible
And I set the field "What to do" to "Delete all - cannot be undone"
And "Move into" "select" should not be visible
And I press "Cancel"
@javascript
Scenario: Test I can assign roles for a category through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "permissions" action for "Cat 1" in management category listing
And I set the field "Participants tertiary navigation" to "Assign roles"
# Redirect
And I should see "Assign roles in Category: Cat 1"
And I should see "Please choose a role to assign"
Scenario: Test I can set access permissions for a category through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "permissions" action for "Cat 1" in management category listing
# Redirect
And I should see "Permissions in Category: Cat 1"
And I click on "Back to Category: Cat 1" "link"
# Redirect
And I should see "Cat 1" in the "h1" "css_element"
Scenario: Test clicking to manage cohorts for a category through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "cohorts" action for "Cat 1" in management category listing
# Redirect
And I should see "Cohorts"
Scenario: Test configuring filters for a category
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "filters" action for "Cat 1" in management category listing
# Redirect
And I should see "Filter settings in Category: Cat 1"
And I click on "Back to Category: Cat 1" "link"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-listing h3" "css_element"
@javascript
Scenario: Test that I can create a category and view it in the management interface
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "Create new category" "link" in the ".category-listing-actions" "css_element"
# Redirect.
And I should see "Add new category"
And I set the following fields to these values:
| Parent category | Top |
| Category name | Test category 2 |
| Category ID number | TC2 |
And I press "Create category"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Test category 2" in the "#course-listing h3" "css_element"
And I should see category listing "Cat 1" before "Test category 2"
And I should see "No courses in this category"
And I click on "createnewsubcategory" action for "Test category 2" in management category listing
# Redirect
And I should see "Add new category"
And I set the following fields to these values:
| Parent category | Top |
| Category name | Test category 3 |
| Category ID number | TC3 |
And I press "Create category"
# Redirect
And I should see the "Course categories and courses" management page
And I should see "Test category 3" in the "#course-listing h3" "css_element"
And I should see category listing "Cat 1" before "Test category 2"
And I should see "No courses in this category"
@javascript
Scenario: Test moving a categories through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 3 | 0 | CAT3 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I select category "Cat 2" in the management interface
And I select category "Cat 3" in the management interface
And I set the field "menumovecategoriesto" to "Cat 1"
When I press "bulkmovecategories"
# Redirect
And I click on category "Cat 1" in the management interface
# Redirect
Then I should see category "CAT3" as subcategory of "CAT1" in the management interface
And I move category "Cat 3" to top level in the management interface
# Redirect
And I should not see category "CAT3" as subcategory of "CAT1" in the management interface
Then I should see category "CAT2" as subcategory of "CAT1" in the management interface
@javascript
Scenario: Test bulk action is shown only when some category/course is selected
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 3 | 0 | CAT3 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT3 | Course 1 | Course 1 | C1 |
| CAT3 | Course 2 | Course 2 | C2 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Cat 2" in the "#category-listing ul" "css_element"
And I should see "Cat 3" in the "#category-listing ul" "css_element"
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
When I set the field "selectsortby" to "allcategories"
Then the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And the "movecategoriesto" "select" should be disabled
And I select category "Cat 2" in the management interface
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I set the field "selectsortby" to "selectedcategories"
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I unselect category "Cat 2" in the management interface
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I select category "Cat 3" in the management interface
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I select category "Cat 2" in the management interface
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I unselect category "Cat 2" in the management interface
And I unselect category "Cat 3" in the management interface
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And the "movecoursesto" "select" should be disabled
And I click on category "Cat 3" in the management interface
#Redirect
And I should see the "Course categories and courses" management page
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And I should see "Course 2" in the "#course-listing ul.course-list" "css_element"
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And the "movecoursesto" "select" should be disabled
And I select course "Course 1" in the management interface
And the "movecoursesto" "select" should be enabled
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I select course "Course 2" in the management interface
And the "movecoursesto" "select" should be enabled
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I select category "Cat 3" in the management interface
And the "movecoursesto" "select" should be enabled
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I unselect course "Course 2" in the management interface
And the "movecoursesto" "select" should be enabled
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I unselect course "Course 1" in the management interface
And the "movecoursesto" "select" should be disabled
And the "movecategoriesto" "select" should be enabled
And the "resortcategoriesby" "select" should be enabled
And the "resortcoursesby" "select" should be enabled
And I unselect category "Cat 3" in the management interface
And the "movecoursesto" "select" should be disabled
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
Scenario: Test that is not possible to create a course category with a duplicate idnumber
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I navigate to "Courses > Add a category" in site administration
And I set the following fields to these values:
| Category name | Test duplicate |
| Category ID number | CAT1 |
When I press "Create category"
Then I should see "ID number is already used for another category"
Scenario: Test that is possible to remove an idnumber from a course category
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 ||
And I log in as "admin"
And I go to the courses management page
And I should see "CAT1" in the "#category-listing" "css_element"
When I click on "edit" action for "Cat 1" in management category listing
And I set the following fields to these values:
| Category name | Category 1 (edited) |
| Category ID number ||
And I press "Save changes"
# Redirect
Then I should see "Category 1 (edited)" in the "#category-listing" "css_element"
And I should not see "CAT1" in the "#course-listing" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/rename_roles.feature
@core @core_course
Feature: Rename roles within a course
In order to set course roles names according to their responsabilities
As a teacher
I need to edit the course role names
@javascript
Scenario: Rename roles within a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| teacher2 | Teacher | 2 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | teacher |
| student1 | C1 | student |
And I am on the "Course 1" "renameroles" page logged in as "teacher1"
And I set the following fields to these values:
| Your word for 'Non-editing teacher' | Tutor |
| Your word for 'Student' | Learner |
And I press "Save"
And I follow "Switch role to..." in the user menu
Then "Tutor" "button" should exist
And "Learner" "button" should exist
And I navigate to course participants
And I set the field "type" in the "Filter 1" "fieldset" to "Roles"
And I open the autocomplete suggestions list in the "Filter 1" "fieldset"
And I should see "Learner (Student)" in the ".form-autocomplete-suggestions" "css_element"
And I press the escape key
And I set the field "Type or select..." in the "Filter 1" "fieldset" to "Tutor (Non-editing teacher)"
And I click on "Student 1's role assignments" "link"
And I open the autocomplete suggestions list in the "Student 1" "table_row"
And "Tutor (Non-editing teacher)" "autocomplete_suggestions" should exist
And I click on "Cancel" "link"
And I press "Enrol users"
And the "Assign role" select box should contain "Learner (Student)"
And I click on "Cancel" "button" in the "Enrol users" "dialogue"
And I am on the "Course 1" "renameroles" page
And I set the following fields to these values:
| Your word for 'Non-editing teacher' | |
| Your word for 'Student' | |
And I press "Save"
And I follow "Switch role to..." in the user menu
And I should see "Teacher"
And "Student" "button" should exist
And "Learner" "button" should not exist
And I navigate to course participants
And I set the field "type" in the "Filter 1" "fieldset" to "Roles"
And I open the autocomplete suggestions list in the "Filter 1" "fieldset"
And I should see "Non-editing teacher" in the ".form-autocomplete-suggestions" "css_element"
And I should see "Student" in the ".form-autocomplete-suggestions" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_chooser_plus.feature
@core @core_course @javascript
Feature: Use the activity chooser to insert activities anywhere in a section
In order to add activities to a course
As a teacher
I should be able to add an activity anywhere in a section.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course | C | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C | editingteacher |
And the following "activities" exist:
| activity | course | idnumber | intro | name | section |
| page | C | p1 | x | Test Page | 1 |
| forum | C | f1 | x | Test Forum | 1 |
| label | C | l1 | x | Test Label | 1 |
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
Scenario: The activity chooser icon is hidden by default and be made visible on hover
Given I hover ".navbar-brand" "css_element"
And "[data-action='insert-before-Test Forum'] button" "css_element" should not be visible
When I hover "Insert an activity or resource before 'Test Forum'" "button"
Then "[data-action='insert-before-Test Forum'] button" "css_element" should be visible
Scenario: The activity chooser can be used to insert modules before existing modules
Given I hover "Insert an activity or resource before 'Test Forum'" "button"
And I press "Insert an activity or resource before 'Test Forum'"
And I should see "Add an activity or resource" in the ".modal-title" "css_element"
When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
And I set the following fields to these values:
| Assignment name | Test Assignment |
And I press "Save and return to course"
And I should see "Test Assignment" in the "Topic 1" "section"
# Ensure the new assignment is in the middle of the two existing modules.
Then "Test Page" "text" should appear before "Test Assignment" "text"
And "Test Assignment" "text" should appear before "Test Forum" "text"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_navigation.feature
@core @core_course
Feature: Activity navigation
In order to quickly switch between activities
As a user
I need to use the activity navigation controls in activities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
| Course 2 | C2 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
| student1 | C2 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Assignment 1 | Test assignment description | C1 | assign1 | 0 |
| book | Book 1 | Test book description | C1 | book1 | 0 |
| chat | Chat 1 | Test chat description | C1 | chat1 | 0 |
| choice | Choice 1 | Test choice description | C1 | choice1 | 1 |
| data | Database 1 | Test database description | C1 | data1 | 1 |
| feedback | Feedback 1 | Test feedback description | C1 | feedback1 | 1 |
| folder | Folder 1 | Test folder description | C1 | folder1 | 2 |
| forum | Forum 1 | Test forum description | C1 | forum1 | 2 |
| glossary | Glossary 1 | Test glossary description | C1 | glossary1 | 2 |
| imscp | Imscp 1 | Test imscp description | C1 | imscp1 | 3 |
| label | Label 1 | Test label description | C1 | label1 | 3 |
| lesson | Lesson 1 | Test lesson description | C1 | lesson1 | 3 |
| lti | Lti 1 | Test lti description | C1 | lti1 | 4 |
| page | Page 1 | Test page description | C1 | page1 | 4 |
| quiz | Quiz 1 | Test quiz description | C1 | quiz1 | 4 |
| resource | Resource 1 | Test resource description | C1 | resource1 | 5 |
| scorm | Scorm 1 | Test scorm description | C1 | scorm1 | 5 |
| survey | Survey 1 | Test survey description | C1 | survey1 | 5 |
| url | Url 1 | Test url description | C1 | url1 | 6 |
| wiki | Wiki 1 | Test wiki description | C1 | wiki1 | 6 |
| workshop | Workshop 1 | Test workshop description | C1 | workshop1 | 6 |
| assign | Assignment 1 | Test assignment description | C2 | assign21 | 0 |
And the following config values are set as admin:
| allowstealth | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Stealth activity.
And I click on "Hide" "link" in the "Forum 1" activity
And I click on "Make available" "link" in the "Forum 1" activity
# Hidden activity.
And I click on "Hide" "link" in the "Glossary 1" activity
# Hidden section.
And I hide section "5"
# Set up book.
And I follow "Book 1"
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Chapter 1 |
| Content | In the beginning... blah, blah, blah. |
And I press "Save changes"
And I log out
Scenario: Step through activities in the course as a teacher.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Assignment 1"
# The first activity won't have the previous activity link.
Then "#prev-activity-link" "css_element" should not exist
And I should see "Book 1" in the "#next-activity-link" "css_element"
And I follow "Book 1"
And I should see "Assignment" in the "#prev-activity-link" "css_element"
And I should see "Chat 1" in the "#next-activity-link" "css_element"
And I follow "Chat 1"
And I should see "Book 1" in the "#prev-activity-link" "css_element"
And I should see "Choice 1" in the "#next-activity-link" "css_element"
And I follow "Choice 1"
And I should see "Chat 1" in the "#prev-activity-link" "css_element"
And I should see "Database 1" in the "#next-activity-link" "css_element"
And I follow "Database 1"
And I should see "Choice 1" in the "#prev-activity-link" "css_element"
And I should see "Feedback 1" in the "#next-activity-link" "css_element"
And I follow "Feedback 1"
And I should see "Database 1" in the "#prev-activity-link" "css_element"
# The next link will be Folder 1 because Forum 1 is in stealth mode.
And I should see "Folder 1" in the "#next-activity-link" "css_element"
And I follow "Folder 1"
And I should see "Feedback 1" in the "#prev-activity-link" "css_element"
# Hidden activity will have a '(hidden)' text within the activity link.
And I should see "Glossary 1 (hidden)" in the "#next-activity-link" "css_element"
And I follow "Glossary 1 (hidden)"
And I should see "Folder 1" in the "#prev-activity-link" "css_element"
And I should see "Imscp 1" in the "#next-activity-link" "css_element"
And I follow "Imscp 1"
And I should see "Glossary 1" in the "#prev-activity-link" "css_element"
# The next link will be Lesson 1 because Label 1 doesn't have a view URL.
And I should see "Lesson 1" in the "#next-activity-link" "css_element"
And I follow "Lesson 1"
And I should see "Imscp 1" in the "#prev-activity-link" "css_element"
And I should see "Lti 1" in the "#next-activity-link" "css_element"
And I follow "Lti 1"
And I should see "Lesson 1" in the "#prev-activity-link" "css_element"
And I should see "Page 1" in the "#next-activity-link" "css_element"
And I follow "Page 1"
And I should see "Lti 1" in the "#prev-activity-link" "css_element"
And I should see "Quiz 1" in the "#next-activity-link" "css_element"
And I follow "Quiz 1"
And I should see "Page 1" in the "#prev-activity-link" "css_element"
# Hidden sections will have the activities render with the '(hidden)' text.
And I should see "Resource 1 (hidden)" in the "#next-activity-link" "css_element"
And I follow "Resource 1 (hidden)"
And I should see "Quiz 1" in the "#prev-activity-link" "css_element"
And I should see "Scorm 1 (hidden)" in the "#next-activity-link" "css_element"
And I follow "Scorm 1 (hidden)"
And I should see "Resource 1 (hidden)" in the "#prev-activity-link" "css_element"
And I should see "Survey 1 (hidden)" in the "#next-activity-link" "css_element"
And I follow "Survey 1 (hidden)"
And I should see "Scorm 1 (hidden)" in the "#prev-activity-link" "css_element"
And I should see "Url 1" in the "#next-activity-link" "css_element"
And I follow "Url 1"
And I should see "Survey 1 (hidden)" in the "#prev-activity-link" "css_element"
And I should see "Wiki 1" in the "#next-activity-link" "css_element"
And I follow "Wiki 1"
And I should see "Url 1" in the "#prev-activity-link" "css_element"
And I should see "Workshop 1" in the "#next-activity-link" "css_element"
And I follow "Workshop 1"
And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
# The last activity won't have the next activity link.
And "#next-activity-link" "css_element" should not exist
Scenario: Step through activities in the course as a student.
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Assignment 1"
# The first activity won't have the previous activity link.
Then "#prev-activity-link" "css_element" should not exist
And I should see "Book 1" in the "#next-activity-link" "css_element"
And I follow "Book 1"
And I should see "Assignment" in the "#prev-activity-link" "css_element"
And I should see "Chat 1" in the "#next-activity-link" "css_element"
And I follow "Chat 1"
And I should see "Book 1" in the "#prev-activity-link" "css_element"
And I should see "Choice 1" in the "#next-activity-link" "css_element"
And I follow "Choice 1"
And I should see "Chat 1" in the "#prev-activity-link" "css_element"
And I should see "Database 1" in the "#next-activity-link" "css_element"
And I follow "Database 1"
And I should see "Choice 1" in the "#prev-activity-link" "css_element"
And I should see "Feedback 1" in the "#next-activity-link" "css_element"
And I follow "Feedback 1"
And I should see "Database 1" in the "#prev-activity-link" "css_element"
# The next link will be Folder 1 because Forum 1 is in stealth mode.
And I should see "Folder 1" in the "#next-activity-link" "css_element"
And I follow "Folder 1"
And I should see "Feedback 1" in the "#prev-activity-link" "css_element"
# The next link will be Imscp 1 because hidden activities are not shown to students.
And I should see "Imscp 1" in the "#next-activity-link" "css_element"
And I follow "Imscp 1"
And I should see "Folder 1" in the "#prev-activity-link" "css_element"
# The next link will be Lesson 1 because Label 1 doesn't have a view URL.
And I should see "Lesson 1" in the "#next-activity-link" "css_element"
And I follow "Lesson 1"
And I should see "Imscp 1" in the "#prev-activity-link" "css_element"
And I should see "Lti 1" in the "#next-activity-link" "css_element"
And I follow "Lti 1"
And I should see "Lesson 1" in the "#prev-activity-link" "css_element"
And I should see "Page 1" in the "#next-activity-link" "css_element"
And I follow "Page 1"
And I should see "Lti 1" in the "#prev-activity-link" "css_element"
And I should see "Quiz 1" in the "#next-activity-link" "css_element"
And I follow "Quiz 1"
And I should see "Page 1" in the "#prev-activity-link" "css_element"
# Hidden sections will have the activities hidden so the links won't be available to students.
And I should see "Url 1" in the "#next-activity-link" "css_element"
And I follow "Url 1"
And I should see "Quiz 1" in the "#prev-activity-link" "css_element"
And I should see "Wiki 1" in the "#next-activity-link" "css_element"
And I follow "Wiki 1"
And I should see "Url 1" in the "#prev-activity-link" "css_element"
And I should see "Workshop 1" in the "#next-activity-link" "css_element"
And I follow "Workshop 1"
And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
# The last activity won't have the next activity link.
And "#next-activity-link" "css_element" should not exist
Scenario: Jump to another activity as a teacher
Given I log in as "teacher1"
When I am on "Course 1" course homepage
And I follow "Assignment 1"
Then "Jump to..." "field" should exist
# The current activity will not be listed.
And the "Jump to..." select box should not contain "Assignment 1"
# Stealth activities will not be listed.
And the "Jump to..." select box should not contain "Forum 1"
# Resources without view URL (e.g. labels) will not be listed.
And the "Jump to..." select box should not contain "Label 1"
# Check drop down menu contents.
And the "Jump to..." select box should contain "Book 1"
And the "Jump to..." select box should contain "Chat 1"
And the "Jump to..." select box should contain "Choice 1"
And the "Jump to..." select box should contain "Database 1"
And the "Jump to..." select box should contain "Feedback 1"
And the "Jump to..." select box should contain "Folder 1"
And the "Jump to..." select box should contain "Imscp 1"
And the "Jump to..." select box should contain "Lesson 1"
And the "Jump to..." select box should contain "Lti 1"
And the "Jump to..." select box should contain "Page 1"
And the "Jump to..." select box should contain "Quiz 1"
And the "Jump to..." select box should contain "Url 1"
And the "Jump to..." select box should contain "Wiki 1"
And the "Jump to..." select box should contain "Workshop 1"
# Hidden activities will be rendered with a '(hidden)' text.
And the "Jump to..." select box should contain "Glossary 1 (hidden)"
# Activities in hidden sections will be rendered with a '(hidden)' text.
And the "Jump to..." select box should contain "Resource 1 (hidden)"
And the "Jump to..." select box should contain "Scorm 1 (hidden)"
And the "Jump to..." select box should contain "Survey 1 (hidden)"
# Jump to an activity somewhere in the middle.
When I select "Page 1" from the "Jump to..." singleselect
Then I should see "Page 1"
And I should see "Lti 1" in the "#prev-activity-link" "css_element"
And I should see "Quiz 1" in the "#next-activity-link" "css_element"
# Jump to the first activity.
And I select "Assignment 1" from the "Jump to..." singleselect
And I should see "Book 1" in the "#next-activity-link" "css_element"
But "#prev-activity-link" "css_element" should not exist
# Jump to the last activity.
And I select "Workshop 1" from the "Jump to..." singleselect
And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
But "#next-activity-link" "css_element" should not exist
# Jump to a hidden activity.
And I select "Glossary 1" from the "Jump to..." singleselect
And I should see "Folder 1" in the "#prev-activity-link" "css_element"
And I should see "Imscp 1" in the "#next-activity-link" "css_element"
Scenario: Jump to another activity as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Assignment 1"
And "Jump to..." "field" should exist
# The current activity will not be listed.
And the "Jump to..." select box should not contain "Assignment 1"
# Stealth activities will not be listed for students.
And the "Jump to..." select box should not contain "Forum 1"
# Resources without view URL (e.g. labels) will not be listed.
And the "Jump to..." select box should not contain "Label 1"
# Hidden activities will not be listed for students.
And the "Jump to..." select box should not contain "Glossary 1"
# Activities in hidden sections will not be listed for students.
And the "Jump to..." select box should not contain "Resource 1"
And the "Jump to..." select box should not contain "Scorm 1"
And the "Jump to..." select box should not contain "Survey 1"
# Only activities visible to students will be listed.
And the "Jump to..." select box should contain "Book 1"
And the "Jump to..." select box should contain "Chat 1"
And the "Jump to..." select box should contain "Choice 1"
And the "Jump to..." select box should contain "Database 1"
And the "Jump to..." select box should contain "Feedback 1"
And the "Jump to..." select box should contain "Folder 1"
And the "Jump to..." select box should contain "Imscp 1"
And the "Jump to..." select box should contain "Lesson 1"
And the "Jump to..." select box should contain "Lti 1"
And the "Jump to..." select box should contain "Page 1"
And the "Jump to..." select box should contain "Quiz 1"
And the "Jump to..." select box should contain "Url 1"
And the "Jump to..." select box should contain "Wiki 1"
And the "Jump to..." select box should contain "Workshop 1"
# Jump to an activity somewhere in the middle.
When I select "Page 1" from the "Jump to..." singleselect
Then I should see "Page 1"
And I should see "Lti 1" in the "#prev-activity-link" "css_element"
And I should see "Quiz 1" in the "#next-activity-link" "css_element"
# Jump to the first activity.
And I select "Assignment 1" from the "Jump to..." singleselect
And I should see "Book 1" in the "#next-activity-link" "css_element"
But "#prev-activity-link" "css_element" should not exist
# Jump to the last activity.
And I select "Workshop 1" from the "Jump to..." singleselect
And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
But "#next-activity-link" "css_element" should not exist
Scenario: Open an activity in a course that only has a single activity
Given I log in as "student1"
And I am on "Course 2" course homepage
And I follow "Assignment 1"
Then "#prev-activity-link" "css_element" should not exist
And "#next-activity-link" "css_element" should not exist
And "Jump to..." "field" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_download_content_permissions.feature
@core @core_course
Feature: Access to downloading course content can be controlled
In order to allow or restrict access to download course content
As a trusted user
I can control access to the download course content feature
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Hockey 101 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following config values are set as admin:
| downloadcoursecontentallowed | 1 |
Scenario: Site admins can remove the download course content feature
Given I log in as "admin"
And I am on "Hockey 101" course homepage
And I navigate to "Settings" in current page administration
And I set the field "Enable download course content" to "Yes"
And I press "Save and display"
Then "Download course content" "link" should exist in current page administration
When the following config values are set as admin:
| downloadcoursecontentallowed | 0 |
And I am on "Hockey 101" course homepage
Then "Download course content" "link" should not exist in current page administration
And I navigate to "Settings" in current page administration
And I should not see "Enable download course content"
Scenario: Site admins can set the default value for whether download course content is enabled in courses
Given I log in as "admin"
And I am on "Hockey 101" course homepage
And "Download course content" "link" should not exist in current page administration
When I navigate to "Courses > Default settings > Course default settings" in site administration
And I set the field "Enable download course content" to "Yes"
And I press "Save changes"
And I am on "Hockey 101" course homepage
Then "Download course content" "link" should exist in current page administration
Scenario: A teacher can enable and disable the download course content feature when it is available
Given I log in as "teacher1"
When I am on "Hockey 101" course homepage
And "Download course content" "link" should not exist in current page administration
And I navigate to "Settings" in current page administration
And I should see "Enable download course content"
And I set the field "Enable download course content" to "Yes"
And I press "Save and display"
Then "Download course content" "link" should exist in current page administration
And I navigate to "Settings" in current page administration
And I set the field "Enable download course content" to "No"
And I press "Save and display"
Then "Download course content" "link" should not exist in current page administration
Scenario: Teachers require a capability to access the download course content feature or modify its availability in a course
Given the following config values are set as admin:
| config | value | plugin |
| downloadcontentsitedefault | 1 | moodlecourse |
# Check teacher can see download option and enable dropdown.
And I log in as "teacher1"
And I am on "Hockey 101" course homepage
Then "Download course content" "link" should exist in current page administration
And I navigate to "Settings" in current page administration
And "Enable download course content" "select" should exist
# Remove teacher's capabilities for download course content.
And the following "role capability" exists:
| role | editingteacher |
| moodle/course:downloadcoursecontent | prohibit |
| moodle/course:configuredownloadcontent | prohibit |
# Check teacher can no longer see download option, and that enable value is visible, but dropdown no longer available.
When I log in as "teacher1"
And I am on "Hockey 101" course homepage
Then "Download course content" "link" should not exist in current page administration
And I navigate to "Settings" in current page administration
And I should see "Enable download course content"
And I should see "Site default (Yes)"
And "Enable download course content" "select" should not exist
Scenario: Students require a capability to access the download course content feature in a course
Given I log in as "teacher1"
And I am on "Hockey 101" course homepage
And I navigate to "Settings" in current page administration
And I set the field "Enable download course content" to "Yes"
And I press "Save and display"
And I log out
# Check student can see the download link.
And I log in as "student1"
And I am on "Hockey 101" course homepage
And "Download course content" "link" should exist in current page administration
# Remove student's capability for download course content.
When the following "role capability" exists:
| role | student |
| moodle/course:downloadcoursecontent | prohibit |
# Check student can no longer see the download link.
And I log in as "student1"
And I am on "Hockey 101" course homepage
Then "Download course content" "link" should not exist in current page administration
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_chooser.feature
@core @core_course @javascript
Feature: Display and choose from the available activities in course
In order to add activities to a course
As a teacher
I should be enabled to choose from a list of available activities and also being able to read their summaries.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | startdate |
| Course | C | topics | |
| Course 2 | C2 | weeks | 95713920 |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C | editingteacher |
| teacher | C2 | editingteacher |
And the following config values are set as admin:
| enablemoodlenet | 0 | tool_moodlenet |
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
Scenario: The available activities are displayed to the teacher in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then I should see "Add an activity or resource" in the ".modal-title" "css_element"
And I should see "Assignment" in the ".modal-body" "css_element"
Scenario: The teacher can choose to add an activity from the activity items in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 4" "section"
When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
Then I should see "Adding a new Assignment"
And I set the following fields to these values:
| Assignment name | Test Assignment Topic 4 |
And I press "Save and return to course"
Then I should see "Test Assignment Topic 4" in the "Topic 4" "section"
Scenario: The teacher can choose to add an activity from the activity summary in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
When I click on "Add a new Assignment" "link" in the "help" "core_course > Activity chooser screen"
Then I should see "Adding a new Assignment"
Scenario: Show summary
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
Then I should see "Assignment" in the "help" "core_course > Activity chooser screen"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
# Confirm show summary also works for weekly format course
And I am on "C2" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section"
And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
And I should see "Assignment" in the "help" "core_course > Activity chooser screen"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
Scenario: Hide summary
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Information about the Assignment activity" "button" in the "modules" "core_course > Activity chooser screen"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "help" "core_course > Activity chooser screen"
And I should see "Back" in the "help" "core_course > Activity chooser screen"
When I click on "Back" "button" in the "help" "core_course > Activity chooser screen"
Then "modules" "core_course > Activity chooser screen" should be visible
And "help" "core_course > Activity chooser screen" should not be visible
And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen"
And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue"
# Confirm hide summary also works for weekly format course
And I am on "C2" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section"
And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
And I click on "Back" "button" in the "help" "core_course > Activity chooser screen"
And "modules" "core_course > Activity chooser screen" should be visible
And "help" "core_course > Activity chooser screen" should not be visible
And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen"
And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue"
Scenario: View recommended activities
When I log out
And I log in as "admin"
And I am on site homepage
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
And I click on ".activity-recommend-checkbox" "css_element" in the "Book" "table_row"
# Setup done, lets check it works with a teacher.
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
And I open the activity chooser
Then I should see "Recommended" in the "Add an activity or resource" "dialogue"
And I click on "Recommended" "link" in the "Add an activity or resource" "dialogue"
And I should see "Book" in the "recommended" "core_course > Activity chooser tab"
Scenario: Favourite a module in the activity chooser
Given I open the activity chooser
And I should not see "Starred" in the "Add an activity or resource" "dialogue"
And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
And I should see "Starred" in the "Add an activity or resource" "dialogue"
When I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
Then I should see "Assignment" in the "favourites" "core_course > Activity chooser tab"
And I click on "Information about the Assignment activity" "button" in the "favourites" "core_course > Activity chooser tab"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
Scenario: Add a favourite module and check it exists when reopening the chooser
Given I open the activity chooser
And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
And I click on "Star Forum activity" "button" in the "Add an activity or resource" "dialogue"
And I should see "Starred" in the "Add an activity or resource" "dialogue"
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
When I click on "Add an activity or resource" "button" in the "Topic 3" "section"
And I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
Then I should see "Forum" in the "favourites" "core_course > Activity chooser tab"
Scenario: Add a favourite and then remove it whilst checking the tabs work as expected
Given I open the activity chooser
And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
And I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
Then I should not see "Starred" in the "Add an activity or resource" "dialogue"
Scenario: The teacher can search for an activity by it's name
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I set the field "search" to "Lesson"
Then I should see "1 results found" in the "Add an activity or resource" "dialogue"
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
Scenario: The teacher can search for an activity by it's description
Given I open the activity chooser
When I set the field "search" to "The lesson activity module enables a teacher to deliver content"
Then I should see "1 results found" in the "Add an activity or resource" "dialogue"
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
Scenario: Search results are not returned if the search query does not match any activity name or description
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I set the field "search" to "Random search query"
Then I should see "0 results found" in the "Add an activity or resource" "dialogue"
And ".option" "css_element" should not exist in the ".searchresultitemscontainer" "css_element"
Scenario: Teacher can return to the default activity chooser state by manually removing the search query
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I set the field "search" to "Lesson"
And I should see "1 results found" in the "Add an activity or resource" "dialogue"
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
When I set the field "search" to ""
And I should not see "1 results found" in the "Add an activity or resource" "dialogue"
Then ".searchresultscontainer" "css_element" should not be visible
And ".optionscontainer" "css_element" should exist
Scenario: Teacher can not see a "clear" button if a search query is not entered in the activity chooser search bar
When I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then "Clear search input" "button" should not be visible
Scenario: Teacher can see a "clear" button after entering a search query in the activity chooser search bar
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I set the field "search" to "Search query"
Then "Clear search input" "button" should not be visible
Scenario: Teacher can not see a "clear" button if the search query is removed in the activity chooser search bar
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I set the field "search" to "Search query"
And "Clear search input" "button" should exist
When I set the field "search" to ""
# Waiting for the animation to hide the button to finish.
And I wait "1" seconds
Then "Clear search input" "button" should not be visible
Scenario: Teacher can instantly remove the search query from the activity search bar by clicking on the "clear" button
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I set the field "search" to "Search query"
And I should see "results found" in the "Add an activity or resource" "dialogue"
When I click on "Clear search input" "button"
Then I should not see "Search query"
And ".searchresultscontainer" "css_element" should not be visible
And ".optionscontainer" "css_element" should exist
Scenario: Teacher gets the base case for the Activity Chooser tab mode
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I should see "Activities" in the "Add an activity or resource" "dialogue"
When I click on "Activities" "link" in the "Add an activity or resource" "dialogue"
Then I should not see "Book" in the "activity" "core_course > Activity chooser tab"
And I click on "Resources" "link" in the "Add an activity or resource" "dialogue"
And I should not see "Assignment" in the "resources" "core_course > Activity chooser tab"
Scenario: Teacher gets the simple case for the Activity Chooser tab mode
Given I log out
And I log in as "admin"
And I am on site homepage
When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
And I select "Starred, All, Recommended" from the "Activity chooser tabs" singleselect
And I press "Save changes"
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then I should not see "Activities" in the "Add an activity or resource" "dialogue"
And I should not see "Resources" in the "Add an activity or resource" "dialogue"
Scenario: Teacher gets the final case for the Activity Chooser tab mode
Given I log out
And I log in as "admin"
And I am on site homepage
When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
And I select "Starred, Activities, Resources, Recommended" from the "Activity chooser tabs" singleselect
And I press "Save changes"
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then I should not see "All" in the "Add an activity or resource" "dialogue"
And I should see "Activities" in the "Add an activity or resource" "dialogue"
And I should see "Resources" in the "Add an activity or resource" "dialogue"
Scenario: Recommended tab is displayed in the right position depending on the activitychoosertabmode setting
Given I log out
And I log in as "admin"
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
And I click on ".activity-recommend-checkbox" "css_element" in the "Book" "table_row"
And the following config values are set as admin:
# 3 = Starred, Recommended, All, Activities, Resources
| activitychoosertabmode | 3 |
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
When I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 0 = Starred, All, Activities, Resources, Recommended
| activitychoosertabmode | 0 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 1 = Starred, All, Recommended
| activitychoosertabmode | 1 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And "Recommended" "link" should appear after "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 2 = Starred, Activities, Resources, Recommended
| activitychoosertabmode | 2 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 4 = Starred, Recommended, All
| activitychoosertabmode | 4 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 5 = Starred, Recommended, Activities, Resources
| activitychoosertabmode | 5 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And "Recommended" "link" should appear before "Activities" "link" in the "Add an activity or resource" "dialogue"
Scenario: Teacher can navigate through activity chooser in Topics format course
When I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Then I should see "All" in the "Add an activity or resource" "dialogue"
And I press the tab key
And I press the tab key
And I press the tab key
And I press the tab key
# Confirm right key works
And I press the right key
And I press the right key
And the focused element is "Chat" "menuitem" in the "Add an activity or resource" "dialogue"
# Confirm left key works
And I press the left key
And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue"
# Confirm clicking "x" button closes modal
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
And "Add an activity or resource" "dialogue" should not be visible
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
# Confirm escape key closes the modal
And I press the escape key
And "Add an activity or resource" "dialogue" should not be visible
Scenario: Teacher can navigate through activity chooser in Weekly format course
Given I am on "C2" course homepage with editing mode on
When I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section"
Then I should see "All" in the "Add an activity or resource" "dialogue"
And I press the tab key
And I press the tab key
And I press the tab key
And I press the tab key
# Confirm right key works
And I press the right key
And I press the right key
And the focused element is "Chat" "menuitem" in the "Add an activity or resource" "dialogue"
# Confirm left key works
And I press the left key
And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue"
# Confirm clicking "x" button closes modal
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
And "Add an activity or resource" "dialogue" should not be visible
And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section"
# Confirm escape key closes the modal
And I press the escape key
And "Add an activity or resource" "dialogue" should not be visible
Scenario: Teacher can access 'More help' from activity information in activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
# Confirm more help link exists
Then "More help" "link" should exist
# Confirm that corresponding help icon exist
And ".iconhelp" "css_element" should exist
# Confirm that link opens in new window
And "Opens in new window" "link" should be visible
# Confirm the same behaviour for weekly format course
And I am on "C2" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section"
And I should see "All" in the "Add an activity or resource" "dialogue"
And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
# Confirm more help link exists
And "More help" "link" should exist
# Confirm that corresponding help icon exist
And ".iconhelp" "css_element" should exist
# Confirm that link opens in new window
And "Opens in new window" "link" should be visible
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_format.feature
@core @core_course
Feature: Teacher can change the course format
In order to change course format
As a teacher
I should be able to edit a course
@javascript
Scenario: Teacher can change the course format
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
# Course format is initially set to Topics format
And the following "courses" exist:
| fullname | shortname | format | startdate |
| Course 1 | C1 | topics | ## 1 day ago ## |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
# Confirm that course format is Topics
When I am on the "Course 1" course page logged in as teacher1
Then I should see "Topic 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Fields that appear for Topics format exist
# Also confirm contents of Hidden sections and Course layout select box
And I should see "Hidden sections"
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
# Hidden sections default value is 1 (Hidden sections are completely invisible)
And the field "Hidden sections" matches value "1"
And I should see "Course layout"
And the "Course layout" select box should contain "Show all sections on one page"
And the "Course layout" select box should contain "Show one section per page"
# Course layout default value is 0 (Show all sections on one page)
And the field "Course layout" matches value "0"
# Set course format to Single activity format
And I set the field "Format" to "Single activity format"
And I expand all fieldsets
# Confirm that fields that appear for Single activity format appears
And I should see "Type of activity"
And I set the field "Type of activity" to "Glossary"
And I press "Save and display"
And I set the field "Name" to "Glossary 1"
And I press "Save and display"
# Confirm that course page displays single activity of type Glossary
And I should see "Browse the glossary using this index"
And I should not see "Topic 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Set course format to Weekly format
And I set the field "Format" to "Weekly format"
And I expand all fieldsets
# Confirm that fields that appear for Weekly format appears
# Also confirm contents of Hidden sections and Course layout select box
And I should see "Hidden sections"
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
# Hidden sections default value is 1 (Hidden sections are completely invisible)
And the field "Hidden sections" matches value "1"
And I should see "Course layout"
And the "Course layout" select box should contain "Show all sections on one page"
And the "Course layout" select box should contain "Show one section per page"
# Course layout default value is 0 (Show all sections on one page)
And the field "Course layout" matches value "0"
And I press "Save and display"
# Confirm that course page displays weekly sections
And I should see "This week"
And I should not see "Browse the glossary using this index"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Set course format to Social format
And I set the field "Format" to "Social format"
# Confirm that fields that appear for Social format appears
And I expand all fieldsets
And I should see "Number of discussions"
And the field "Number of discussions" matches value "10"
And I press "Save and display"
# Confirm that course page displays a forum
And I should see "There are no discussion topics yet in this forum"
And I should not see "This week"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_resource_delete.feature
@core @core_course
Feature: Delete activity and resource works correctly
As a teacher
I want to be able to delete an activity and resource
So that I can remove it from the course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | intro |
| label | C1 | Label 1 | Label 1 |
| glossary | C1 | Glossary 1 | Glossary 1 |
@javascript
Scenario: Activity and resource can be deleted properly
Given I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I open "Label 1" actions menu
When I click on "Delete" "link" in the "Label 1" activity
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
# Confirm that label is successfully deleted
Then I should not see "Label 1"
And I open "Glossary 1" actions menu
And I click on "Delete" "link" in the "Glossary 1" activity
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
# Confirm that glossary is successfully deleted
And I should not see "Glossary 1"
# Reload the page and confirm that both the label and glossary are really deleted
And I reload the page
And I should not see "Label 1"
And I should not see "Glossary 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_category_management_listing.feature
@core @core_course
Feature: Course category management interface performs as expected
In order to test JS enhanced display of categories and subcategories.
As a moodle admin
I need to expand and collapse categories.
@javascript
Scenario Outline: Test general look of management interface
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
And I select "<selected>" from the "Viewing" singleselect
And I should see "<heading>" in the "h2" "css_element"
And I should see "<selected>" in the "Viewing" "select"
And I should see "<pagecontent>" in the "#page-content" "css_element"
And I should see the "<selected>" management page
Examples:
| heading | selected | pagecontent |
| Manage course categories and courses | Course categories and courses | Course categories |
| Manage course categories | Course categories | Course categories |
| Manage courses | Courses | Cat 1 |
@javascript
Scenario: Test view mode functionality
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | CAT1 | topics |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Course categories" in the "Viewing" "select"
And the field "jump" matches value "Course categories and courses"
And I start watching to see if a new page loads
Then I should see "Course categories and courses" in the "Viewing" "select"
And I should see "Course categories" in the "Viewing" "select"
And I should see "Courses" in the "Viewing" "select"
And I should see "Category 1" in the "#course-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "No courses in this category" in the "#course-listing" "css_element"
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
And I should see "Cat 1" in the "#course-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Course 1" in the "#course-listing" "css_element"
Then I should see "Courses" in the "Viewing" "select"
And I select "Courses" from the "jump" singleselect
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Courses" management page
And I should see "Cat 1" in the "#course-listing h3" "css_element"
And I should see "Course 1" in the "#course-listing" "css_element"
And I click on course "Course 1" in the management interface
And a new page should have loaded since I started watching
And I should see the "Courses" management page with a course selected
And I should see "Cat 1" in the "#course-listing h3" "css_element"
And I should see "Course 1" in the "#course-listing" "css_element"
And I should see "Course 1" in the "#course-detail h3" "css_element"
And I should see "C1" in the "#course-detail .shortname" "css_element"
And I should see "Course 1" in the "#course-detail .fullname" "css_element"
And I should see "Topics" in the "#course-detail .format" "css_element"
And I should see "Cat 1" in the "#course-detail .category" "css_element"
Scenario: Test displaying of sub categories
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 1-1 | CAT1 | CAT3 |
| Cat 1-2 | CAT1 | CAT4 |
| Cat 1-1-1 | CAT3 | CAT5 |
| Cat 1-1-2 | CAT3 | CAT6 |
| Cat 2-1 | CAT2 | CAT7 |
| Cat 2-1-1 | CAT7 | CAT8 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | CAT1 |
| Course 2 | C2 | CAT1 |
| Course 3 | C3 | CAT3 |
| Course 4 | C4 | CAT3 |
| Course 5 | C5 | CAT5 |
| Course 6 | C6 | CAT5 |
| Course 7 | C7 | CAT8 |
| Course 8 | C8 | CAT8 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1-1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 2" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
# This is similar to the above scenario except here we are going to use AJAX
# to load the categories.
@javascript @_cross_browser
Scenario: Test AJAX loading of sub categories
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 1-1 | CAT1 | CAT3 |
| Cat 1-2 | CAT1 | CAT4 |
| Cat 1-1-1 | CAT3 | CAT5 |
| Cat 1-1-2 | CAT3 | CAT6 |
| Cat 2-1 | CAT2 | CAT7 |
| Cat 2-1-1 | CAT7 | CAT8 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | CAT1 |
| Course 2 | C2 | CAT1 |
| Course 3 | C3 | CAT3 |
| Course 4 | C4 | CAT3 |
| Course 5 | C5 | CAT5 |
| Course 6 | C6 | CAT5 |
| Course 7 | C7 | CAT8 |
| Course 8 | C8 | CAT8 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT3" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT2" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT7" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
@javascript
Scenario Outline: Top level categories are displayed correctly when resorted
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Social studies | Ext003 | 1 |
| 0 | Applied sciences | Sci001 | 2 |
| 0 | Extended social studies | Ext002 | 3 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I set the field "menuselectsortby" to "All categories"
And I set the field "menuresortcategoriesby" to <sortby>
And I press "Sort"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "Sort by Category name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Category name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Category ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Category ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
@javascript
Scenario Outline: Sub categories are displayed correctly when resorted
Given the following "categories" exist:
| category | name | idnumber | sortorder |
| 0 | Master cat | CAT1 | 1 |
| CAT1 | Social studies | Ext003 | 1 |
| CAT1 | Applied sciences | Sci001 | 2 |
| CAT1 | Extended social studies | Ext002 | 3 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on "Master cat" category in the management category listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on <sortby> action for "Master cat" in management category listing
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
Examples:
| sortby | cat1 | cat2 | cat3 |
| "resortbyname" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "resortbynamedesc" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "resortbyidnumber" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "resortbyidnumberdesc" | "Applied sciences" | "Social studies" | "Extended social studies" |
@javascript
Scenario Outline: Test courses are displayed correctly after being resorted.
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber | sortorder | timecreated |
| CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 |
| CAT1 | Applied sciences | Middle school | Sci001 | 2 | 1000000002 |
| CAT1 | Extended social studies | Junior school | Ext002 | 3 | 1000000003 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I open the action menu in ".course-listing-actions" "css_element"
And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element"
And I click on <sortby> "link" in the ".course-listing-actions" "css_element"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see course listing <course1> before <course2>
And I should see course listing <course2> before <course3>
Examples:
| sortby | course1 | course2 | course3 |
| "Sort by Course full name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Course full name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Course short name ascending" | "Extended social studies" | "Applied sciences" | "Social studies" |
| "Sort by Course short name descending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Course ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
| "Sort by Course time created ascending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course time created descending" | "Extended social studies" | "Applied sciences" | "Social studies" |
@javascript
Scenario: Test course pagination
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
| CAT1 | Course 4 | Course 4 | C4 |
| CAT1 | Course 5 | Course 5 | C5 |
| CAT1 | Course 6 | Course 6 | C6 |
| CAT1 | Course 7 | Course 7 | C7 |
| CAT1 | Course 8 | Course 8 | C8 |
| CAT1 | Course 9 | Course 9 | C9 |
| CAT1 | Course 10 | Course 10 | C10 |
| CAT1 | Course 11 | Course 11 | C11 |
| CAT1 | Course 12 | Course 12 | C12 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I open the action menu in ".course-listing-actions" "css_element"
And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 4"
And I should see course listing "Course 4" before "Course 5"
And I should see course listing "Course 5" before "Course 6"
And I should see course listing "Course 6" before "Course 7"
And I should see course listing "Course 7" before "Course 8"
And I should see course listing "Course 8" before "Course 9"
And I should see course listing "Course 9" before "Course 10"
And I should see course listing "Course 10" before "Course 11"
And I should see course listing "Course 11" before "Course 12"
And "#course-listing .pagination" "css_element" should not exist
And I open the action menu in ".courses-per-page" "css_element"
And I should see "5" in the ".courses-per-page" "css_element"
And I should see "10" in the ".courses-per-page" "css_element"
And I should see "20" in the ".courses-per-page" "css_element"
And I should see "All" in the ".courses-per-page" "css_element"
And I click on "5" "link" in the ".courses-per-page" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 4"
And I should see course listing "Course 4" before "Course 5"
And I should not see "Course 6"
And I should not see "Course 7"
And I should not see "Course 8"
And I should not see "Course 9"
And I should not see "Course 10"
And I should not see "Course 11"
And I should not see "Course 12"
And "#course-listing .pagination" "css_element" should exist
And I should see "Showing courses 1 to 5 of 12 courses"
And I should not see "First" in the "#course-listing .pagination" "css_element"
And I should not see "Prev" in the "#course-listing .pagination" "css_element"
And I should see "1" in the "#course-listing .pagination" "css_element"
And I should see "2" in the "#course-listing .pagination" "css_element"
And I should see "3" in the "#course-listing .pagination" "css_element"
And I should see "Next" in the "#course-listing .pagination" "css_element"
And I click on "2" "link" in the "#course-listing .pagination" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see "Course 10" in the "#course-listing" "css_element"
And I should not see "Course 2" in the "#course-listing" "css_element"
And I should not see "Course 3" in the "#course-listing" "css_element"
And I should not see "Course 4" in the "#course-listing" "css_element"
And I should not see "Course 5" in the "#course-listing" "css_element"
And I should see course listing "Course 6" before "Course 7"
And I should see course listing "Course 7" before "Course 8"
And I should see course listing "Course 8" before "Course 9"
And I should see course listing "Course 9" before "Course 10"
And I should not see "Course 11"
And I should not see "Course 12"
And "#course-listing .pagination" "css_element" should exist
And I should see "Showing courses 6 to 10 of 12 courses"
And I should see "Prev" in the "#course-listing .pagination" "css_element"
And I should see "1" in the "#course-listing .pagination" "css_element"
And I should see "2" in the "#course-listing .pagination" "css_element"
And I should see "3" in the "#course-listing .pagination" "css_element"
And I should see "Next" in the "#course-listing .pagination" "css_element"
And I click on "Next" "link" in the "#course-listing .pagination" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see "Course 11"
And I should not see "Course 2" in the "#course-listing" "css_element"
And I should not see "Course 3" in the "#course-listing" "css_element"
And I should not see "Course 4" in the "#course-listing" "css_element"
And I should not see "Course 5" in the "#course-listing" "css_element"
And I should not see "Course 6" in the "#course-listing" "css_element"
And I should not see "Course 7" in the "#course-listing" "css_element"
And I should not see "Course 8" in the "#course-listing" "css_element"
And I should not see "Course 9" in the "#course-listing" "css_element"
And I should not see "Course 10" in the "#course-listing" "css_element"
And I should see course listing "Course 11" before "Course 12"
And "#course-listing .pagination" "css_element" should exist
And I should see "Showing courses 11 to 12 of 12 courses"
And I should see "Prev" in the "#course-listing .pagination" "css_element"
And I should see "1" in the "#course-listing .pagination" "css_element"
And I should see "2" in the "#course-listing .pagination" "css_element"
And I should see "3" in the "#course-listing .pagination" "css_element"
And I should not see "Next" in the "#course-listing .pagination" "css_element"
And I click on "Prev" "link" in the "#course-listing .pagination" "css_element"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see "Course 10" in the "#course-listing" "css_element"
And I should not see "Course 2" in the "#course-listing" "css_element"
And I should not see "Course 3" in the "#course-listing" "css_element"
And I should not see "Course 4" in the "#course-listing" "css_element"
And I should not see "Course 5" in the "#course-listing" "css_element"
And I should see course listing "Course 6" before "Course 7"
And I should see course listing "Course 7" before "Course 8"
And I should see course listing "Course 8" before "Course 9"
And I should see course listing "Course 9" before "Course 10"
And I should not see "Course 11"
And I should not see "Course 12"
And "#course-listing .pagination" "css_element" should exist
And I should see "Showing courses 6 to 10 of 12 courses"
And I should see "Prev" in the "#course-listing .pagination" "css_element"
And I should see "1" in the "#course-listing .pagination" "css_element"
And I should see "2" in the "#course-listing .pagination" "css_element"
And I should see "3" in the "#course-listing .pagination" "css_element"
And I should see "Next" in the "#course-listing .pagination" "css_element"
Scenario: Test pagination is only shown when required
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
| CAT1 | Course 4 | Course 4 | C4 |
| CAT1 | Course 5 | Course 5 | C5 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I open the action menu in ".course-listing-actions" "css_element"
And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
# Redirect.
And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 4"
And I should see course listing "Course 4" before "Course 5"
And "#course-listing .pagination" "css_element" should not exist
And I click on "5" "link" in the ".course-listing-actions" "css_element"
# Redirect
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 4"
And I should see course listing "Course 4" before "Course 5"
And "#course-listing .pagination" "css_element" should not exist
# We need at least 30 courses for this next test.
@javascript
Scenario: Test many course pagination
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
| CAT1 | Course 4 | Course 4 | C4 |
| CAT1 | Course 5 | Course 5 | C5 |
| CAT1 | Course 6 | Course 6 | C6 |
| CAT1 | Course 7 | Course 7 | C7 |
| CAT1 | Course 8 | Course 8 | C8 |
| CAT1 | Course 9 | Course 9 | C9 |
| CAT1 | Course 10 | Course 10 | C10 |
| CAT1 | Course 11 | Course 11 | C11 |
| CAT1 | Course 12 | Course 12 | C12 |
| CAT1 | Course 13 | Course 13 | C13 |
| CAT1 | Course 14 | Course 14 | C14 |
| CAT1 | Course 15 | Course 15 | C15 |
| CAT1 | Course 16 | Course 16 | C16 |
| CAT1 | Course 17 | Course 17 | C17 |
| CAT1 | Course 18 | Course 18 | C18 |
| CAT1 | Course 19 | Course 19 | C19 |
| CAT1 | Course 20 | Course 20 | C20 |
| CAT1 | Course 21 | Course 21 | C21 |
| CAT1 | Course 22 | Course 22 | C22 |
| CAT1 | Course 23 | Course 23 | C23 |
| CAT1 | Course 24 | Course 24 | C24 |
| CAT1 | Course 25 | Course 25 | C25 |
| CAT1 | Course 26 | Course 26 | C26 |
| CAT1 | Course 27 | Course 27 | C27 |
| CAT1 | Course 28 | Course 28 | C28 |
| CAT1 | Course 29 | Course 29 | C29 |
| CAT1 | Course 30 | Course 30 | C30 |
| CAT1 | Course 31 | Course 31 | C31 |
| CAT1 | Course 32 | Course 32 | C32 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I open the action menu in ".course-listing-actions" "css_element"
And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 19" before "Course 20"
And I should not see "Course 21"
And I should see "Showing courses 1 to 20 of 32 courses"
And I open the action menu in ".courses-per-page" "css_element"
And I click on "100" "link" in the ".courses-per-page" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 100" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 19" before "Course 20"
And I should see course listing "Course 21" before "Course 22"
And I should see course listing "Course 31" before "Course 32"
And "#course-listing .pagination" "css_element" should not exist
And I open the action menu in ".courses-per-page" "css_element"
And I click on "5" "link" in the ".courses-per-page" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 4" before "Course 5"
And I should not see "Course 6"
And I should see "Showing courses 1 to 5 of 32 courses"
And I should not see "Prev" in the "#course-listing .pagination" "css_element"
And I should see "Next" in the "#course-listing .pagination" "css_element"
And I click on "4" "link" in the "#course-listing .pagination" "css_element"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
And I should not see "Course 15"
And I should see course listing "Course 16" before "Course 17"
And I should see course listing "Course 17" before "Course 18"
And I should see course listing "Course 18" before "Course 19"
And I should see course listing "Course 19" before "Course 20"
And I should not see "Course 21"
And I should see "Showing courses 16 to 20 of 32 courses"
Scenario: Test clicking to edit a course.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And I click on "edit" action for "Course 1" in management course listing
# Redirect
And I should see "Edit course settings"
And I should see "Course 1"
@javascript
Scenario: Test AJAX expanded categories stay open.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
| Cat 1-1 | CAT1 | CAT3 |
| Cat 1-2 | CAT1 | CAT4 |
| Cat 1-1-1 | CAT3 | CAT5 |
| Cat 1-1-2 | CAT3 | CAT6 |
| Cat 2-1 | CAT2 | CAT7 |
| Cat 2-1-1 | CAT7 | CAT8 |
| Cat 2-1-1-1 | CAT8 | CAT10 |
| Cat 2-1-2 | CAT7 | CAT9 |
| Cat 2-1-2-1 | CAT9 | CAT11 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT2" in the management interface
And a new page should not have loaded since I started watching
And I click to expand category "CAT7" in the management interface
And a new page should not have loaded since I started watching
And I click to expand category "CAT9" in the management interface
And a new page should not have loaded since I started watching
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1" category in the management category listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
And I click on "resortbyidnumber" action for "Cat 1" in management category listing
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
@javascript
Scenario: Test category expansion after deletion
Given the following "categories" exist:
| name | category | idnumber |
| Cat A (1) | 0 | CAT1 |
| Cat B (2) | 0 | CAT2 |
| Cat C (1-1) | CAT1 | CAT3 |
| Cat D (2-1) | CAT2 | CAT4 |
| Cat E (2-1-1) | CAT4 | CAT5 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat A (1)" in the "#course-category-listings ul" "css_element"
And I should see "Cat B (2)" in the "#course-category-listings ul" "css_element"
And I should not see "Cat C (1-1)" in the "#course-category-listings ul" "css_element"
And I should not see "Cat D (2-1)" in the "#course-category-listings ul" "css_element"
And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And I should see "Cat C (1-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click to expand category "CAT2" in the management interface
And I should see "Cat D (2-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click to expand category "CAT4" in the management interface
And I should see "Cat E (2-1-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click on "delete" action for "Cat B (2)" in management category listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see "Delete category: Cat B (2)"
And I should see "Contents of Cat B (2)"
And I press "Delete"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see "Delete category: Cat B (2)"
And I should see "Deleted course category Cat B (2)"
And I press "Continue"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see "Cat A (1)" in the "#course-category-listings ul" "css_element"
And I should not see "Cat B (2)" in the "#course-category-listings ul" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/keyholder.feature
@core @core_course
Feature: Keyholder role is listed as course contact
As a student I need to know who the keyholder is to enrol in a course
Background:
Given the following "role" exists:
| shortname | keyholder |
| name | Keyholder |
| context_coursecat | 1 |
| context_course | 1 |
| enrol/self:holdkey | allow |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| keyholder1 | Keyholder | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | category |
| Course 1 | C1 | topics | 0 | 5 | CAT1 |
And I log in as "admin"
And I add "Self enrolment" enrolment method in "Course 1" with:
| Custom instance name | Test student enrolment |
| Enrolment key | letmein |
And I navigate to "Appearance > Courses" in site administration
And I set the following fields to these values:
| Keyholder | 1 |
And I press "Save changes"
And I log out
Scenario: Keyholder assigned to a course
Given the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| keyholder1 | C1 | keyholder |
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
Then I should see "Keyholder 1"
Scenario: Keyholder assigned to a category
Given the following "role assigns" exist:
| user | role | contextlevel | reference |
| keyholder1 | keyholder | Category | CAT1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
Then I should see "Keyholder 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_relativedatesmode.feature
@core @core_course
Feature: Courses can be set up to display dates relative to the user's enrolment date
As a course creator
In order for me to set up courses
I need to be able to set up courses to display dates relative to the user's enrolment date
@javascript
Scenario: Create a course with relative dates feature disabled
Given the following config values are set as admin:
| enablecourserelativedates | 0 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I press "Add a new course"
And I wait until the page is ready
Then I should not see "Relative dates mode"
And I should not see "This cannot be changed once the course has been created."
@javascript
Scenario: Create a course with relative dates feature enabled
Given the following config values are set as admin:
| enablecourserelativedates | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
When I press "Add a new course"
Then I should see "Relative dates mode"
And I should see "Relative dates mode cannot be changed once the course has been created."
Scenario: Edit courses with relative dates feature enabled
Given the following config values are set as admin:
| enablecourserelativedates | 1 |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
| Relative dates mode | Yes |
And I create a course with:
| Course full name | Course 2 |
| Course short name | C2 |
| Relative dates mode | No |
And I am on "Course 1" course homepage
When I navigate to "Settings" in current page administration
Then the "Relative dates mode" "select" should be disabled
And the field "Relative dates mode" matches value "Yes"
And I am on "Course 2" course homepage
And I navigate to "Settings" in current page administration
And the "Relative dates mode" "select" should be disabled
And the field "Relative dates mode" matches value "No"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/max_number_sections.feature
@core @core_course
Feature: The maximum number of weeks/topics in a course can be configured
In order to set boundaries to courses size
As a manager
I need to limit the number of weeks/topics a course can have
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | [email protected] |
And the following "system role assigns" exist:
| user | course | role |
| manager1 | Acceptance test site | manager |
And I log in as "admin"
And I navigate to "Courses > Default settings > Course default settings" in site administration
@javascript
Scenario: The number of sections can be increased and the limits are applied to courses
Given I set the field "Maximum number of sections" to "100"
When I press "Save changes"
Then the field "Maximum number of sections" matches value "100"
And the "Number of sections" select box should contain "100"
And I log out
And I log in as "manager1"
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
| Number of sections | 90 |
| Format | Topics format |
And I should see "Topic 90"
@javascript
Scenario: The number of sections can be reduced to 0 and the limits are applied to courses
Given I set the field "Maximum number of sections" to "0"
When I press "Save changes"
Then the field "Maximum number of sections" matches value "0"
And the "Number of sections" select box should contain "0"
And the "Number of sections" select box should not contain "52"
And I log out
And I log in as "manager1"
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
| Number of sections | 0 |
| Format | Topics format |
And I should not see "Topic 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_report_display.feature
@core @core_course
Feature: Students can view their grades and activity reports
In order for students to view their grades and activity reports
As a teacher
I should be able to change the report display settings
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | [email protected] |
Scenario Outline: Grade reports can be displayed or hidden to students
Given the following "courses" exist:
| fullname | shortname | showgrades |
| Course 1 | C1 | <gradevisibility> |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
When I am on the "student1" "user > profile" page logged in as student1
And I click on "Course 1" "link"
Then I <gradelinkvisibility> see "Grades overview"
Examples:
| gradevisibility | gradelinkvisibility |
| 1 | should |
| 0 | should not |
Scenario Outline: Activity reports can be displayed or hidden to students
Given the following "courses" exist:
| fullname | shortname | showreports |
| Course 1 | C1 | <reportvisibility> |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
When I am on the "student1" "user > profile" page logged in as student1
And I click on "Course 1" "link"
Then I <reportlinkvisibility> see "Today's logs"
And I <reportlinkvisibility> see "All logs"
And I <reportlinkvisibility> see "Outline report"
And I <reportlinkvisibility> see "Complete report"
Examples:
| reportvisibility | reportlinkvisibility |
| 1 | should |
| 0 | should not |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_category_breadcrumbs.feature
@javascript @core_course
Feature: Course category breadcrumbs navigation
To navigate around the course category pages
As an admin user
I should see breadcrumbs
Background:
Given the following "blocks" exist:
| blockname | contextlevel | reference | defaultregion |
| navigation | System | 1 | side-post |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
Scenario: Admin user navigates to 'course category management' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
When I follow "Cat 1"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Manage course categories and courses" in the "region-main" "region"
Scenario: Admin user navigates to category 'view' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I click on "view" action for "Cat 1" in management category listing
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to 'add new course' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I click on "Create new course" "link"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Add a new course" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Add a new course" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to 'add category' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I click on "Create new category" "link"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Add a category" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Add new category" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to a subcategory 'management' page
Given the following "categories" exist:
| name | category | idnumber |
| Subcat 1 | CAT1 | SUBCAT1 |
And I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I follow "Subcat 1"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".page-context-header" "css_element"
And I should see "Manage course categories and courses" in the "region-main" "region"
Scenario: Admin user navigates to a subcategory 'view' page
Given the following "categories" exist:
| name | category | idnumber |
| Subcat 1 | CAT1 | SUBCAT1 |
And I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I follow "Subcat 1"
When I click on "view" action for "Subcat 1" in management category listing
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".page-context-header" "css_element"
And I should see "Subcat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to 'add new course' page within a subcategory
Given the following "categories" exist:
| name | category | idnumber |
| Subcat 1 | CAT1 | SUBCAT1 |
And I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I follow "Subcat 1"
When I click on "Create new course" "link"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Add a new course" in the ".breadcrumb" "css_element"
And I should see "Subcat 1" in the ".page-context-header" "css_element"
And I should see "Add a new course" in the "region-main" "region"
And I should see "Subcat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'settings' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Settings" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Settings" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Edit category settings" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'permissions' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Permissions" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Permissions" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Permissions in Category: Cat 1" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'assign roles' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Permissions" in current page administration
And I set the field "Participants tertiary navigation" to "Assign roles"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Assign roles" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Assign roles in Category: Cat 1" in the "region-main" "region"
Scenario: Admin user navigates to category 'check permissions' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Permissions" in current page administration
When I set the field "Participants tertiary navigation" to "Check permissions"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Check permissions" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Check permissions in Category: Cat 1" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'cohorts' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Cohorts" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Cohorts" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Cohorts" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'add new cohort' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Cohorts" in current page administration
When I follow "Add new cohort"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Cohorts" in the ".breadcrumb" "css_element"
And I should see "Add new cohort" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Add new cohort" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'upload cohorts' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Cohorts" in current page administration
When I follow "Upload cohorts"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Cohorts" in the ".breadcrumb" "css_element"
And I should see "Upload cohorts" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Upload cohorts" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'filters' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Filters" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Filters" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Filter settings in Category: Cat 1" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'restore course' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Restore course" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Restore course" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Import a backup file" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'manage backup files' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Restore course" in current page administration
When I press "Manage backup files"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Restore course" in the ".breadcrumb" "css_element"
And I should see "Manage backup files" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Manage backup files" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
Scenario: Admin user navigates to category 'content bank' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
When I navigate to "Content bank" in current page administration
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Content bank" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Content bank" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_controls.feature
@core @core_course
Feature: Course activity controls works as expected
In order to manage my course's activities
As a teacher
I need to edit, hide and show activities inside course sections
# The difference between these two scenario outlines is that one is with
# JS enabled and the other one with JS disabled; we can not use Background
# sections when using Scenario Outlines because of Behat framework restrictions.
# We are testing:
# * Javascript on and off
# * Topics and weeks course formats
# * Course controls without paged mode
# * Course controls with paged mode in the course home page
# * Course controls with paged mode in a section's page
@javascript @_cross_browser
Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | section | name |
| forum | C1 | 1 | Test forum name 1 |
| forum | C1 | 1 | Test forum name 2 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I click on <targetpage> "link" in the "region-main" "region"
And I add the "Recent activity" block
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I click on "Delete" "button" in the "Delete block?" "dialogue"
And <belowpage> "section" <should_see_other_sections> exist
And <belowpage> "section" <should_see_other_sections> exist
And I open "Test forum name 1" actions menu
And I click on "Edit settings" "link" in the "Test forum name 1" activity
And I should see "Updating Forum"
And I should see "Display description on course page"
And I set the following fields to these values:
| Forum name | Just to check that I can edit the name |
| Description | Just to check that I can edit the description |
| Display description on course page | 1 |
And I click on "Cancel" "button"
And <belowpage> "section" <should_see_other_sections> exist
And I open "Test forum name 1" actions menu
And I choose "Availability > Hide on course page" in the open action menu
And <belowpage> "section" <should_see_other_sections> exist
And I delete "Test forum name 1" activity
And I should not see "Test forum name 1" in the "region-main" "region"
And I duplicate "Test forum name 2" activity editing the new copy with:
| Forum name | Edited test forum name 2 |
And <belowpage> "section" <should_see_other_sections> exist
And I should see "Test forum name 2"
And I should see "Edited test forum name 2"
And I hide section "1"
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be hidden
And all activities in section "1" should be hidden
And I show section "1"
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be visible
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And <belowpage> "section" <should_see_other_sections> exist
And I should see "1 2 3 4 5" in the "Section links" "block"
And I click on "2" "link" in the "Section links" "block"
And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links | belowpage |
| topics | 0 | "General" | should | should | "Topic 2" |
| topics | 1 | "Topic 1" | should not | should not | "Topic 2" |
| topics | 1 | "General" | should | should not | "Topic 2" |
| weeks | 0 | "General" | should | should | "8 January - 14 January" |
| weeks | 1 | "1 January - 7 January" | should not | should not | "8 January - 14 January" |
| weeks | 1 | "General" | should | should not | "8 January - 14 January" |
Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected without javascript
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| forum | Test forum name 1 | C1 | 0001 | 1 |
| forum | Test forum name 2 | C1 | 0002 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I click on <targetpage> "link" in the "region-main" "region"
And I add the "Recent activity" block
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I press "Yes"
And <belowpage> "section" <should_see_other_sections> exist
And I click on "Edit settings" "link" in the "Test forum name 1" activity
And I should see "Updating Forum"
And I should see "Display description on course page"
And I press "Save and return to course"
And <belowpage> "section" <should_see_other_sections> exist
And I click on "Hide on course page" "link" in the "Test forum name 1" activity
And <belowpage> "section" <should_see_other_sections> exist
And I delete "Test forum name 1" activity
And <belowpage> "section" <should_see_other_sections> exist
And I should not see "Test forum name 1" in the "region-main" "region"
And I duplicate "Test forum name 2" activity editing the new copy with:
| Forum name | Edited test forum name 2 |
And <belowpage> "section" <should_see_other_sections> exist
And I should see "Test forum name 2"
And I should see "Edited test forum name 2"
And I hide section "1"
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be hidden
And all activities in section "1" should be hidden
And I show section "1"
And <belowpage> "section" <should_see_other_sections> exist
And section "1" should be visible
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And <belowpage> "section" <should_see_other_sections> exist
And I should see "1 2 3 4 5" in the "Section links" "block"
And I click on "2" "link" in the "Section links" "block"
And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links | belowpage |
| topics | 0 | "General" | should | should | "Topic 2" |
| topics | 1 | "Topic 1" | should not | should not | "Topic 2" |
| topics | 1 | "General" | should | should not | "Topic 2" |
| weeks | 0 | "General" | should | should | "8 January - 14 January" |
| weeks | 1 | "1 January - 7 January" | should not | should not | "8 January - 14 January" |
| weeks | 1 | "General" | should | should not | "8 January - 14 January" |
@javascript
Scenario Outline: Indentation should allow one level only
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Test forum name | Test forum description | C1 | forum1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I open "Test forum name" actions menu
Then "Move right" "link" should be visible
And "Move left" "link" should not be visible
And I click on "Move right" "link" in the "Test forum name" activity
And I open "Test forum name" actions menu
And "Move right" "link" should not be visible
And "Move left" "link" should be visible
And I click on "Move left" "link" in the "Test forum name" activity
And I open "Test forum name" actions menu
And "Move right" "link" should be visible
And "Move left" "link" should not be visible
Examples:
| courseformat |
| topics |
| weeks |
@javascript
Scenario Outline: Admins could disable indentation
Given the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Test forum name | Test forum description | C1 | forum1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I open "Test forum name" actions menu
And "Move right" "link" should be visible
And "Move left" "link" should not be visible
And I click on "Move right" "link" in the "Test forum name" activity
When the following config values are set as admin:
| indentation | 0 | format_<courseformat> |
And I am on "Course 1" course homepage with editing mode on
And I open "Test forum name" actions menu
Then "Move right" "link" should not exist
And "Move left" "link" should not exist
Examples:
| courseformat |
| topics |
| weeks |
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_change_visibility.feature
@core @core_course
Feature: We can change the visibility of courses in the management interface.
As a moodle admin
I need to test hiding and then showing a course.
I need to test hiding a course and then hiding and showing the category its within.
# Test hiding and showing a course.
Scenario: Test toggling course visibility through the management interfaces.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of course "C1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be dimmed "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
# Test hiding and showing a course with JS, same as the above test.
@javascript
Scenario: Test using AJAX to hide a course through the management interfaces.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul" "css_element"
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be dimmed "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And category in management listing should be visible "CAT1"
And course in management listing should be dimmed "C1"
And I toggle visibility of category "CAT1" in management listing
And I toggle visibility of course "C1" in management listing
And I select "Courses" from the "Viewing" singleselect
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And course in management listing should be dimmed "C1"
And I toggle visibility of course "C1" in management listing
And course in management listing should be visible "C1"
And a new page should not have loaded since I started watching
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activities_edit_completion.feature
@core @core_course @core_completion
Feature: Edit completion settings of an activity
In order to edit completion settings without accidentally breaking user data
As a teacher
I need to edit the activity and use the unlock button if required
Background:
Given the following "courses" exist:
| fullname | shortname | enablecompletion |
| Course 1 | C1 | 1 |
And the following "activities" exist:
| activity | course | idnumber | intro | name | completion | completionview |
| page | C1 | p1 | x | TestPage | 2 | 1 |
Scenario: Completion is not locked when the activity has not yet been viewed
Given I am on the TestPage "Page Activity editing" page logged in as admin
When I expand all fieldsets
Then I should see "Completion conditions"
And I should not see "Completion options locked"
Scenario: Completion is locked after the activity has been viewed
Given I am on the TestPage "Page Activity" page logged in as admin
When I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
Then I should see "Completion options locked"
@javascript
Scenario: Pressing the unlock button allows the user to edit completion settings
Given I am on the TestPage "Page Activity" page logged in as admin
When I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
And I press "Unlock completion settings"
And I expand all fieldsets
Then I should see "Completion options unlocked"
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "Students must manually mark the activity as done" matches value "1"
@javascript
Scenario: Even when completion is locked, the user can still set the date
Given I am on the TestPage "Page Activity" page logged in as admin
And I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
When I click on "id_completionexpected_enabled" "checkbox"
And I set the field "id_completionexpected_year" to "2013"
And I press "Save and display"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_completionexpected_year" matches value "2013"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/navigate_course_list.feature
@core @core_course
Feature: Browse course list and return back from enrolment page
In order to navigate between course list consistently
As a user
I need to be able to return back from enrolment page
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | [email protected] |
| user2 | User | 2 | [email protected] |
And the following "categories" exist:
| name | category | idnumber |
| Sample category | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category |
| Sample course | C1 | 0 |
| Course 1 | COURSE1 | CAT1 |
Scenario: A user can return to the category page from enrolment page
When I log in as "user2"
And I am on course index
And I follow "Category 1"
And I follow "Sample course"
And I press "Continue"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I click on "Courses" "link" in the ".breadcrumb" "css_element"
And I follow "Sample category"
And I am on "Course 1" course homepage
And I press "Continue"
And I should see "Sample category" in the ".breadcrumb" "css_element"
@javascript
Scenario: A user can return to the previous page from enrolment page by clicking navigation links
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
When I log in as "user2"
And I change window size to "large"
And I open my profile in edit mode
And I expand "Courses" node
And I expand "Sample category" node
And I follow "Course 1"
And I press "Continue"
Then I should see "Edit profile" in the ".breadcrumb" "css_element"
Scenario: User can return to the choice activity from enrolment page
Given the following "roles" exist:
| name | shortname | description | archetype |
| Non-enrolled | custom1 | My custom role 1 | user |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | custom1 | Course | C1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| choice | Test choice | Test choice description | C1 | choice1 |
And the following "role capability" exists:
| role | custom1 |
| moodle/course:view | allow |
When I log in as "user1"
And I am on course index
And I follow "Category 1"
And I follow "Sample course"
And I follow "Test choice"
And I should see "Sorry, only enrolled users are allowed to make choices."
And I press "Enrol me in this course"
And I press "Continue"
Then I should see "Test choice" in the ".breadcrumb" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/sectionzero_title.feature
@core @core_course
Feature: Section 0 default/custom title
In order to set up a course
As a teacher
I need to be able to use/change default section 0 title
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| data | Test database name | Test database description | C1 | database1 | 2 |
| forum | Test forum name | | C1 | forum1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Default section 0 title is General
Given I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
Then I should see "General" in the "li#section-0" "css_element"
@javascript
Scenario: Editing section 0 title
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I edit the section "0" and I fill the form with:
| Custom | 1 |
| New value for Section name | Edited section 0 |
And I should see "Edited section 0" in the "li#section-0" "css_element"
When I set the field "Edit topic name" in the "li#section-0" "css_element" to ""
Then I should not see "Edited section 0" in the "li#section-0" "css_element"
And I should see "General" in the "li#section-0" "css_element"
And "New name for topic" "field" should not exist
And I set the field "Edit topic name" in the "li#section-0" "css_element" to "Edited section 0"
And I should see "Edited section 0" in the "li#section-0" "css_element"
And I edit the section "0" and I fill the form with:
| Custom | 0 |
And I should not see "Edited section 0" in the "li#section-0" "css_element"
And I should see "General" in the "li#section-0" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/customfields_visibility.feature
@core @core_course @core_customfield @javascript
Feature: The visibility of fields control where they are displayed
In order to display custom fields on course listing
As a manager
I can change the visibility of the fields
Background:
Given the following "custom field categories" exist:
| name | component | area | itemid |
| Category for test | core_course | course | 0 |
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Display course custom fields on homepage
When I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
| Visible to | Everyone |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Test field | testcontent |
And I press "Save and display"
And I am on site homepage
Then I should see "Test field: testcontent"
Scenario: Do not display course custom fields on homepage
When I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
| Visible to | Nobody |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Test field | testcontent |
And I press "Save and display"
And I am on site homepage
And I should not see "Test field: testcontent"
Scenario: Display course custom fields on homepage only to course editors
When I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field |
| Short name | testfield |
| Visible to | Teachers |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Test field | testcontent |
And I press "Save and display"
When I am on site homepage
And I should see "Test field: testcontent"
And I log out
When I log in as "student"
When I am on site homepage
And I should not see "Test field: testcontent"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/frontpage_topic_section.feature
@core @core_course
Feature: Site home topic section
In order to show a display activities in the frontpage
As an admin
I need to edit the frontpage topic section
Background:
Given the following config values are set as admin:
| numsections | 1 |
Scenario: Activities should appear in frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
When I log in as "admin"
And I am on site homepage
Then I should see "Frontpage assignment" in the "region-main" "region"
@javascript
Scenario: Topic name does appears in frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I click on "Edit summary" "link" in the "region-main" "region"
And I click on "Custom" "checkbox"
And I set the field "New value for Section name" to "New section name"
When I press "Save changes"
And I should see "New section name" in the "region-main" "region"
Then I turn editing mode off
And I should see "New section name" in the "region-main" "region"
@javascript
Scenario: Topic description appears in the frontpage
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I click on "Edit summary" "link" in the "region-main" "region"
And I set the field "Summary" to "New section description"
When I press "Save changes"
And I should see "New section description" in the "region-main" "region"
Then I turn editing mode off
And I should see "New section description" in the "region-main" "region"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_navigation_with_restrictions.feature
@core @core_course
Feature: Activity navigation involving activities with access restrictions
In order to quickly switch to another activity that has access restrictions
As a student
I need to be able to use the activity navigation feature to access the activity after satisfying its access conditions
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | enablecompletion |
| Course 1 | C1 | topics | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| page | Page 1 | Test page description 1 | C1 | page1 | 0 |
| page | Page 2 | Test page description 2 | C1 | page2 | 0 |
| page | Page 3 | Test page description 3 | C1 | page3 | 0 |
| page | Page 4 | Test page description 4 | C1 | page4 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Set completion for Page 2.
And I open "Page 2" actions menu
And I click on "Edit settings" "link" in the "Page 2" activity
And I expand all fieldsets
And I set the field "Add requirements" to "1"
And I set the following fields to these values:
| Add requirements | 1 |
| View the activity | 1 |
And I press "Save and return to course"
# Require Page 2 to be completed first before Page 3 can be accessed.
And I open "Page 3" actions menu
And I click on "Edit settings" "link" in the "Page 3" activity
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field "Activity or resource" to "Page 2"
And I press "Save and return to course"
And I log out
@javascript
Scenario: Activity navigation involving activities with access restrictions
Given I am on the "Page 1" "page activity" page logged in as student1
Then I should see "Page 2" in the "#next-activity-link" "css_element"
# Activity that has access restriction should not show up in the dropdown.
And the "Jump to..." select box should not contain "Page 3"
And I select "Page 4" from the "Jump to..." singleselect
# Page 2 should be shown in the previous link since Page 3 is not yet available.
And I should see "Page 2" in the "#prev-activity-link" "css_element"
And the "Jump to..." select box should not contain "Page 3"
# Navigate to Page 2.
And I click on "Page 2" "link" in the "page-content" "region"
# Since Page 2 has now been viewed and deemed completed, Page 3 can now be accessed.
And I should see "Page 3" in the "#next-activity-link" "css_element"
And the "Jump to..." select box should contain "Page 3"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/move_sections.feature
@core @core_course
Feature: Sections can be moved
In order to rearrange my course contents
As a teacher
I need to move sections up and down
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| forum | Test forum name | C1 | forum1 | 1 |
And I log in as "teacher1"
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
When I move down section "1"
Then I should see "Test forum name" in the "Topic 2" "section"
And I move up section "2"
And I should see "Test forum name" in the "Topic 1" "section"
Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode
Given I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I move down section "1"
Then I should see "Test forum name" in the "Topic 2" "section"
And I move up section "2"
And I should see "Test forum name" in the "Topic 1" "section"
Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode
Given I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I follow "Topic 2"
Then "Topic 1" "section" should not exist
And "Topic 3" "section" should not exist
And "Move down" "link" should not exist
And "Move up" "link" should not exist
@javascript
Scenario: Move section with javascript
When I open section "1" edit menu
And I click on "Move" "link" in the "Topic 1" "section"
And I click on "Topic 3" "link" in the ".modal-body" "css_element"
Then I should see "Test forum name" in the "Topic 3" "section"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_collapse_sections.feature
@core @core_course @core_courseformat
Feature: Collapse course sections
In order to quickly access the course structure
As a user
I need to collapse/extend sections for Topics/Weeks formats.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
| numsections | 5 |
| startdate | 957139200 |
| enablecompletion | 1 |
| hiddensections | 0 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | completion |
| assign | Assignment 1 | Test assignment description1 | C1 | assign1 | 1 | 1 |
| assign | Assignment 2 | Test assignment description2 | C1 | assign2 | 2 | 1 |
| book | Book 2 | | C1 | book2 | 2 | 1 |
| book | Book 3 | | C1 | book3 | 3 | 1 |
| forum | Forum 4 | | C1 | forum4 | 4 | 1 |
| forum | Forum 5 | | C1 | forum5 | 5 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I edit the section "4"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the field "direction" to "until"
And I set the field "x[year]" to "2013"
And I press "Save changes"
And I hide section "5"
@javascript
Scenario: No chevron on site home
Given the following activity" exists:
| activity | forum |
| course | Acceptance test site |
| section | 1 |
| name | Test forum post backup name |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I click on "Edit summary" "link" in the "region-main" "region"
And I click on "Custom" "checkbox"
And I set the field "New value for Section name" to "New section name"
When I press "Save changes"
Then "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
@javascript
Scenario: Expand/collapse sections for Topics format.
Given I am on the "Course 1" course page logged in as student1
And "[data-toggle=collapse]" "css_element" should exist in the "region-main" "region"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should see "Book 3" in the "region-main" "region"
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
And I should not see "Forum 4"
And I should see "Not available" in the "#section-5" "css_element"
And I should not see "Forum 5"
When I click on "#collapssesection3" "css_element"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should not see "Book 3" in the "region-main" "region"
And I click on "#collapssesection1" "css_element"
And I click on "#collapssesection2" "css_element"
And I click on "#collapssesection4" "css_element"
And I click on "#collapssesection5" "css_element"
Then I should not see "Assignment 1" in the "region-main" "region"
And I should not see "Assignment 2" in the "region-main" "region"
And I should not see "Book 2" in the "region-main" "region"
And I should not see "Book 3" in the "region-main" "region"
And I should not see "Available until" in the "section-4" "core_availability > Section availability"
And I click on "#collapssesection1" "css_element"
And I click on "#collapssesection2" "css_element"
And I click on "#collapssesection3" "css_element"
And I click on "#collapssesection4" "css_element"
And I click on "#collapssesection5" "css_element"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should see "Book 3" in the "region-main" "region"
And I should see "Available until" in the "section-4" "core_availability > Section availability"
@javascript
Scenario: Expand/collapse sections for Weeks format.
Given I am on the "Course 1" course page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Format | Weekly format |
And I press "Save and display"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should see "Book 3" in the "region-main" "region"
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
And I should see "Forum 4"
And I should see "Hidden from students" in the "#section-5" "css_element"
And I should see "Forum 5"
When I click on "#collapssesection3" "css_element"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should not see "Book 3" in the "region-main" "region"
And I click on "#collapssesection1" "css_element"
And I click on "#collapssesection2" "css_element"
And I click on "#collapssesection4" "css_element"
And I click on "#collapssesection5" "css_element"
Then I should not see "Assignment 1" in the "region-main" "region"
And I should not see "Assignment 2" in the "region-main" "region"
And I should not see "Book 2" in the "region-main" "region"
And I should not see "Book 3" in the "region-main" "region"
And I should not see "Available until" in the "section-4" "core_availability > Section availability"
And I should not see "Not available" in the "#section-5" "css_element"
And I click on "#collapssesection1" "css_element"
And I click on "#collapssesection2" "css_element"
And I click on "#collapssesection3" "css_element"
And I click on "#collapssesection4" "css_element"
And I click on "#collapssesection5" "css_element"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
And I should see "Book 3" in the "region-main" "region"
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
And I should see "Forum 4"
And I should see "Hidden from students" in the "#section-5" "css_element"
And I should see "Forum 5"
@javascript
Scenario: Users don't see chevron on one section per page for Topics format
Given I am on the "Course 1" course page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
Then "Topic 1" "section" should not exist
And "Topic 3" "section" should not exist
And I am on "Course 1" course homepage with editing mode on
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
And I should see "Forum 4"
And I should see "Hidden from students" in the "#section-5" "css_element"
And I should see "Forum 5"
@javascript
Scenario: Users don't see chevron on one section per page for Weeks format
Given I am on the "Course 1" course page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Course layout | Show one section per page |
| Format | Weekly format |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
And I click on "8 May - 14 May" "link" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
Then "1 May - 7 May" "section" should not exist
And "15 May - 21 May" "section" should not exist
And I am on the "Course 1" course page logged in as student1
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
And I should not see "Forum 4"
And I should see "Not available" in the "#section-5" "css_element"
And I should not see "Forum 5"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_download_content_cm.feature
@core @core_course
Feature: Activities content download can be controlled
In order to allow or restrict access to download activity content
As a teacher
I can disable the content download of an activity
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
| manager1 | Manager | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| manager1 | C1 | manager |
And the following "activities" exist:
| activity | name | intro | introformat | course |
| page | Page1 | PageDesc1 | 1 | C1 |
And the following "activities" exist:
| activity | name | intro | introformat | course | downloadcontent |
| folder | Folder1 | FolderDesc1 | 1 | C1 | 0 |
And I log in as "admin"
And the following config values are set as admin:
| downloadcoursecontentallowed | 1 |
And I log out
Scenario: "Include in course content download" field default is set to "Yes" if nothing has been set
Given I am on the Page1 "Page Activity editing" page logged in as admin
Then the field "Include in course content download" matches value "Yes"
Scenario: "Include in course content download" field is not visible if course content is disabled on site level
Given I log in as "admin"
And the following config values are set as admin:
| downloadcoursecontentallowed | 0 |
And I am on the Page1 "Page Activity editing" page
Then "Include in course content download" "select" should not exist
Scenario: "Include in course content download" field is visible even if course content is disabled on course level
Given I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
When I set the field "Enable download course content" to "No"
And I press "Save and display"
And I am on the Page1 "Page Activity editing" page
Then "Include in course content download" "select" should exist
Scenario: "Include in course content download" field should be visible but not editable for users without configuredownloadcontent capability
Given I log in as "manager1"
And I am on the Folder1 "Folder Activity editing" page
And "Include in course content download" "field" should exist
And the following "role capability" exists:
| role | manager |
| moodle/course:configuredownloadcontent | prohibit |
When I am on the Folder1 "Folder Activity editing" page
Then I should see "Include in course content download"
And I should see "No"
And "Include in course content download" "select" should not exist
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activities_edit_name.feature
@core @core_course
Feature: Edit activity name in-place
In order to quickly edit activity name
As a teacher
I need to use inplace editing
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
| idnumber | forum1 |
@javascript
Scenario: Edit activity name in-place
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Rename activity
And I set the field "Edit title" in the "Test forum name" "activity" to "Good news"
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 1" course homepage
And I should see "Good news"
And I should not see "Test forum name"
# Cancel renaming
And I click on "Edit title" "link" in the "[data-value='Good news']" "css_element"
And I type "Terrible news"
And I press the escape key
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 1" course homepage
And I should see "Good news"
And I should not see "Terrible news"
@javascript
Scenario: Edit activity name in-place ensuring correct encoding
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I set the field "Edit title" in the "Test forum name" "activity" to "Good & bad news"
Then I should not see "Test forum name" in the ".course-content" "css_element"
And I should see "Good & bad news" in the ".course-content" "css_element"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/general_section.feature
@format @format_topics
Feature: General section does not show in navigation when empty
In order to keep my navigation links relevant
As a teacher
The general section links should not appear in the navigation when the section is empty
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| forum | Test forum name | C1 | forum1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
Scenario: General section is visible in navigation when it is not empty
When I move "Test forum name" activity to section "0"
And I am on "Course 1" course homepage
Then I should see "General" in the "Navigation" "block"
Scenario: General section is not visible in navigation when it is empty
When I move "Test forum name" activity to section "3"
And I am on "Course 1" course homepage
Then I should not see "General" in the "Navigation" "block"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/search_recommended_activities.feature
@core @core_course
Feature: Search recommended activities
As an admin I am able to search for activities in the "Recommended activities" admin setting page
Scenario: Search results are returned if the search query matches any activity names
Given I log in as "admin"
And I am on site homepage
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
When I set the field "search" to "assign"
And I click on "Submit search" "button"
Then I should see "Search results"
And "Assignment" "table_row" should exist
And "Book" "table_row" should not exist
Scenario: Search results are not returned if the search query does not match with any activity names
Given I log in as "admin"
And I am on site homepage
And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
When I set the field "search" to "random query"
And I click on "Submit search" "button"
Then I should see "Search results: 0"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/customfields_locked.feature
@core @core_course @core_customfield @javascript
Feature: Fields locked control who is able to edit it
In order to display custom fields on course listing
As a manager
I can change the visibility of the fields
Background:
Given the following "custom field categories" exist:
| name | component | area | itemid |
| Category for test | core_course | course | 0 |
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario: Editing locked and not locked custom fields
When I log in as "admin"
And I navigate to "Courses > Default settings > Course custom fields" in site administration
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field1 |
| Short name | testfield1 |
| Locked | No |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I click on "Add a new custom field" "link"
And I click on "Short text" "link"
And I set the following fields to these values:
| Name | Test field2 |
| Short name | testfield2 |
| Locked | Yes |
And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Test field1 | testcontent1 |
| Test field2 | testcontent2 |
And I press "Save and display"
And I am on site homepage
Then I should see "Test field1: testcontent1"
And I should see "Test field2: testcontent2"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "Test field1" matches value "testcontent1"
And I should not see "Test field2"
And I press "Save and display"
And I am on site homepage
And I should see "Test field1: testcontent1"
And I should see "Test field2: testcontent2"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_contact.feature
@core @core_course
Feature: Test if displaying the course contacts works correctly:
As a user I need to see the course contacts of a course.
As an admin I need to be able to control the appearance of the course contacts.
Background:
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | CAT1 | topics |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| teacher2 | Teacher | 2 | [email protected] |
| teacher3 | Teacher | 3 | [email protected] |
| manager1 | Manager | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C1 | teacher |
| teacher2 | C1 | teacher |
| teacher3 | C1 | editingteacher |
| manager1 | C1 | manager |
Scenario: Test general course contacts functionality for all user roles
Given I log in as "admin"
And I navigate to "Appearance > Courses" in site administration
And I set the following fields to these values:
| Manager | 0 |
| Teacher | 1 |
| Non-editing teacher | 0 |
| Display all course contact roles | 0 |
And I press "Save changes"
When I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher 2" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
When I log out
And I log in as "manager1"
And I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher 2" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
When I log out
And I log in as "teacher1"
And I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher 2" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
When I log out
And I log in as "student1"
And I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher 2" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
Scenario: Test course contact roles without displaying all roles
Given I log in as "admin"
And I navigate to "Appearance > Courses" in site administration
And I set the following fields to these values:
| Manager | 0 |
| Teacher | 1 |
| Non-editing teacher | 1 |
| Display all course contact roles | 0 |
And I press "Save changes"
When I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should see "Teacher 2" in the ".teachers" "css_element"
And I should see "Teacher 3" in the ".teachers" "css_element"
And I should see "Teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher, Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
Scenario: Test course contact roles with displaying all roles and standard sorting
Given I log in as "admin"
And I navigate to "Appearance > Courses" in site administration
And I set the following fields to these values:
| Manager | 0 |
| Teacher | 1 |
| Non-editing teacher | 1 |
| Display all course contact roles | 1 |
And I press "Save changes"
When I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should see "Teacher 2" in the ".teachers" "css_element"
And I should see "Teacher 3" in the ".teachers" "css_element"
And I should see "Teacher, Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
And I should see teacher "Teacher 1" before "Teacher 3" in the course contact listing
And I should see teacher "Teacher 3" before "Teacher 2" in the course contact listing
And I should not see teacher "Teacher 1" after "Teacher 3" in the course contact listing
And I should not see teacher "Teacher 3" after "Teacher 2" in the course contact listing
Scenario: Test course contact roles with displaying all roles and modified sorting
Given I log in as "admin"
And I navigate to "Appearance > Courses" in site administration
And I set the following fields to these values:
| Manager | 0 |
| Teacher | 1 |
| Non-editing teacher | 1 |
| Display all course contact roles | 1 |
And I press "Save changes"
And I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Move up" "link" in the "//td[text()[contains(.,'Non-editing teacher')]]/parent::tr/td[contains(@class, 'lastcol')]" "xpath_element"
When I am on course index
And I should see "Cat 1" in the "#region-main" "css_element"
And I follow "Cat 1"
And I wait until the page is ready
And I should see "Course 1" in the "#region-main" "css_element"
Then I should see "Teacher 1" in the ".teachers" "css_element"
And I should see "Teacher 2" in the ".teachers" "css_element"
And I should see "Teacher 3" in the ".teachers" "css_element"
And I should see "Non-editing teacher, Teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
And I should not see "Manager 1" in the ".teachers" "css_element"
And I should see teacher "Teacher 1" before "Teacher 2" in the course contact listing
And I should see teacher "Teacher 2" before "Teacher 3" in the course contact listing
And I should not see teacher "Teacher 1" after "Teacher 2" in the course contact listing
And I should not see teacher "Teacher 2" after "Teacher 3" in the course contact listing
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/edit_settings.feature
@core @core_course
Feature: Edit course settings
In order to set the course according to my teaching needs
As a teacher
I need to edit the course settings
@javascript
Scenario: Edit course settings
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname | summary | format |
| Course 1 | C1 | <p>Course summary</p> | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following config values are set as admin:
| courselistshortnames | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course full name | Edited course fullname |
| Course short name | Edited course shortname |
| Course summary | Edited course summary |
And I press "Save and display"
And I am on site homepage
Then I should not see "Course 1"
And I should not see "C1"
And I should see "Edited course fullname"
And I should see "Edited course shortname"
And I am on "Edited course fullname" course homepage
And I navigate to "Settings" in current page administration
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 site homepage
And I should see "Edited course fullname"
Scenario: Edit course settings and return to the management interface
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Categories" management page
And I click on category "Cat 1" in the management interface
And I should see the "Course categories and courses" management page
When I click on "edit" action for "Course 1" in management course listing
And I set the following fields to these values:
| Course full name | Edited course fullname |
| Course short name | Edited course shortname |
| Course summary | Edited course summary |
And I press "Save and return"
Then I should see the "Course categories and courses" management page
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_resort.feature
@core @core_course
Feature: Test we can resort course in the management interface.
As a moodle admin
I need to test we can resort courses within a category.
I need to test we can manually sort courses.
# Test resorting courses with
Scenario Outline: Resort courses.
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber | sortorder | timecreated |
| CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 |
| CAT1 | Applied sciences | Middle school | Sci001 | 2 | 1000000002 |
| CAT1 | Extended social studies | Junior school | Ext002 | 3 | 1000000003 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Sort courses" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element"
And I click on <sortby> "link" in the ".course-listing-actions" "css_element"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see course listing <course1> before <course2>
And I should see course listing <course2> before <course3>
Examples:
| sortby | course1 | course2 | course3 |
| "Sort by Course full name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Course full name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Course short name ascending" | "Extended social studies" | "Applied sciences" | "Social studies" |
| "Sort by Course short name descending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Course ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
| "Sort by Course time created ascending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course time created descending" | "Extended social studies" | "Applied sciences" | "Social studies" |
@javascript
Scenario Outline: Resort courses with JavaScript enabled.
Given the following "categories" exist:
| name | category 0| idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber | sortorder | timecreated |
| CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 |
| CAT1 | Applied sciences | Middle school | Sci001 | 2 | 1000000002 |
| CAT1 | Extended social studies | Junior school | Ext002 | 3 | 1000000003 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Sort courses" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course full name descending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course short name descending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element"
And I should not see "Sort by Course time created descending" in the ".course-listing-actions" "css_element"
And I open the action menu in ".course-listing-actions" "css_element"
And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element"
And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element"
And I click on <sortby> "link" in the ".course-listing-actions" "css_element"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
And I should see course listing <course1> before <course2>
And I should see course listing <course2> before <course3>
Examples:
| sortby | course1 | course2 | course3 |
| "Sort by Course full name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" |
| "Sort by Course full name descending" | "Social studies" | "Extended social studies" | "Applied sciences" |
| "Sort by Course short name ascending" | "Extended social studies" | "Applied sciences" | "Social studies" |
| "Sort by Course short name descending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" |
| "Sort by Course ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" |
| "Sort by Course time created ascending" | "Social studies" | "Applied sciences" | "Extended social studies" |
| "Sort by Course time created descending" | "Extended social studies" | "Applied sciences" | "Social studies" |
Scenario: Test moving courses up and down by one.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I open the action menu in ".course-listing-actions" "css_element"
And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I click to move course "C1" down one
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And I should see course listing "Course 2" before "Course 1"
And I should see course listing "Course 1" before "Course 3"
And I click to move course "C3" up one
# Redirect.
And I should see the "Course categories and courses" management page with a course selected
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 1"
# Like the above test but with JavaScript enabled.
@javascript
Scenario: Test using AJAX to move courses up and down by one.
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| category | fullname | shortname | idnumber |
| CAT1 | Course 1 | Course 1 | C1 |
| CAT1 | Course 2 | Course 2 | C2 |
| CAT1 | Course 3 | Course 3 | C3 |
And I log in as "admin"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I open the action menu in ".course-listing-actions" "css_element"
And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
And I should see course listing "Course 1" before "Course 2"
And I should see course listing "Course 2" before "Course 3"
And I click to move course "C1" down one
And a new page should not have loaded since I started watching
And I should see course listing "Course 2" before "Course 1"
And I should see course listing "Course 1" before "Course 3"
And I click to move course "C3" up one
And a new page should not have loaded since I started watching
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 1"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/activity_resource_description_display.feature
@core @core_course
Feature: Display activity and resource description
In order to display activity and resource description
As teacher
I should be able to enable "Display description on course page"
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario Outline: Display activity and resource descriptions
# Generate activity/resource with description
Given the following "activities" exist:
| activity | course | name | intro | showdescription |
| <acttype> | C1 | <actname> | <actname> intro | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "<actname>" in the "region-main" "region"
And I should see "<actname> intro" in the "region-main" "region"
Examples:
| acttype | actname |
| assign | Assign 1 |
| book | Book 1 |
| chat | Chat 1 |
| data | Database 1 |
| feedback | Feedback 1 |
| forum | Forum 1 |
| label | Label 1 |
| lti | LTI 1 |
| page | Page 1 |
| quiz | Quiz 1 |
| resource | Resource 1 |
| imscp | IMSCP 1 |
| folder | Folder 1 |
| glossary | Glossary 1 |
| scorm | Scorm 1 |
| lesson | Lesson 1 |
| survey | Survey 1 |
| url | URL 1 |
| wiki | Wiki 1 |
| workshop | Workshop 1 |
Scenario: Display url activity description with pop-up display
# Generate url activity with description and popup appearance
Given the following "activities" exist:
| activity | course | name | intro | showdescription | display | popupwidth | popupheight |
| url | C1 | URL 1 | URL 1 intro | 1 | 6 | 620 | 450 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "URL 1" in the "region-main" "region"
And I should see "URL 1 intro" in the "region-main" "region"
Scenario: Display activity with image description
# Generate page activity with image embedded in description
Given the following "activities" exist:
| activity | course | name | intro | showdescription |
| page | C1 | Page 1 | Page 1 intro with image: <img src="http://download.moodle.org/unittest/test.jpg"> | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "Page 1" in the "region-main" "region"
And I should see "Page 1 intro with image:" in the "region-main" "region"
# Confirm that image element exists
And "//img[contains(@src, 'http://download.moodle.org/unittest/test.jpg')]" "xpath_element" should exist in the "region-main" "region"
# File: OPENSOURCE/LMS/MOODLE_403_STABLE//course/tests/behat/course_download_content.feature
@core @core_course
Feature: Course content can be downloaded
In order to retain a backup offline copy of course activity/resource data
As a user
I can download a course's content
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | [email protected] |
| student1 | Student | 1 | [email protected] |
And the following "courses" exist:
| fullname | shortname |
| Hockey 101 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I navigate to "Courses > Download course content" in site administration
And I set the following fields to these values:
| Download course content feature available | 1 |
And I press "Save changes"
And I navigate to "Courses > Default settings > Course default settings" in site administration
And I set the field "Enable download course content" to "Yes"
And I press "Save changes"
And I log out
@javascript
Scenario: A student can download course content when the feature is enabled in their course
Given I log in as "student1"
When I am on "Hockey 101" course homepage
And I navigate to "Download course content" in current page administration
Then I should see "You are about to download a zip file"
# Without the ability t
@luukverhoeven
Copy link
Author

./concat_features.sh OPENSOURCE/LMS/MOODLE_403_STABLE/

#!/bin/bash

# Usage: ./concat_features.sh [directory_to_scan] [output_file]

# Set the directory to scan and the output file
DIRECTORY_TO_SCAN=${1:-"./"}  # Default is current directory if not provided
OUTPUT_FILE=${2:-"all_features_combined.feature"}  # Default output file name

# Make sure output file is empty or create a new one
> "$OUTPUT_FILE"

# Find all .feature files in the directory and subdirectories
find "$DIRECTORY_TO_SCAN" -type f -name "*.feature" | while read -r FEATURE_FILE
do
    echo "Processing: $FEATURE_FILE"
    echo "# File: $FEATURE_FILE" >> "$OUTPUT_FILE"
    cat "$FEATURE_FILE" >> "$OUTPUT_FILE"
    echo -e "\n\n" >> "$OUTPUT_FILE"  # Add newline for separation
done

echo "All .feature files have been concatenated into $OUTPUT_FILE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment