MDL-82034 core_course: Fix Activity chooser opening issues on behat
This commit is contained in:
@@ -13,6 +13,6 @@ Feature: Make test scenario can execute specific steps
|
||||
And I press "Import"
|
||||
And I should see "Scenario: Course with some disabled plugins"
|
||||
When I am on "C1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "Section 1" "section"
|
||||
And I open the activity chooser
|
||||
Then I should see "Page" in the "Add an activity or resource" "dialogue"
|
||||
And I should not see "Book" in the "Add an activity or resource" "dialogue"
|
||||
|
||||
@@ -43,7 +43,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
|
||||
| completionview_assign | 0 |
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add content" "button" in the "New section" "section"
|
||||
And I click on "Activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
# Completion tracking 2 = Add requirements.
|
||||
@@ -83,7 +84,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
|
||||
Then I should see "Changes saved"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add content" "button" in the "New section" "section"
|
||||
And I click on "Activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
# Completion tracking 2 = Add requirements.
|
||||
@@ -122,7 +124,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-glossary']" "css_element"
|
||||
Then I should see "Changes saved"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add content" "button" in the "New section" "section"
|
||||
And I click on "Activity or resource" "button" in the "New section" "section"
|
||||
And I click on "Add a new Glossary" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
# Completion tracking 2 = Add requirements.
|
||||
|
||||
@@ -21,7 +21,6 @@ Feature: Courses can be created in Single Activity mode
|
||||
| moodle/course:manageactivities | allow |
|
||||
| moodle/course:viewparticipants | allow |
|
||||
| moodle/role:assign | allow |
|
||||
And I enable "subsection" "mod" plugin
|
||||
When I log in as "kevin"
|
||||
And I am on site homepage
|
||||
And I press "Add a new course"
|
||||
|
||||
@@ -14,7 +14,6 @@ Feature: Edit format course to Single Activity format
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I enable "subsection" "mod" plugin
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Settings" in current page administration
|
||||
|
||||
@@ -36,7 +36,9 @@ Feature: Verify edit utils availability
|
||||
Given I log in as "teacher1"
|
||||
When I am on "Course 1" course homepage
|
||||
And I turn editing mode on
|
||||
And I open the activity chooser
|
||||
Then I should see "Add an activity or resource"
|
||||
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
|
||||
And I open "Activity sample 1" actions menu
|
||||
And I should see "Edit settings"
|
||||
And ".section_action_menu" "css_element" should exist in the "Section 1" "section"
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
type="button"
|
||||
id="dropdownMenuButton-{{#modid}}{{modid}}{{/modid}}{{^modid}}{{uniqid}}{{/modid}}"
|
||||
data-toggle="dropdown"
|
||||
data-action="open-addingcontent"
|
||||
{{#modid}}
|
||||
data-beforemod="{{modid}}"
|
||||
{{/modid}}
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
aria-label="{{#str}}insertcontentbefore, core, { "activityname": {{#quote}} {{activityname}} {{/quote}} } {{/str}}"
|
||||
|
||||
@@ -22,39 +22,40 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
|
||||
Then I should see "New Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Assignment name | Test Assignment |
|
||||
And I press "Save and return to course"
|
||||
Then I should see "Test Assignment" in the "New section" "section"
|
||||
Then I should see "Test Assignment" in the "General" "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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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 "New Assignment"
|
||||
|
||||
Scenario: Show summary
|
||||
Given I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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 "Add content" "button" in the "13 January - 19 January" "section"
|
||||
And I click on "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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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"
|
||||
@@ -65,7 +66,8 @@ Feature: Display and choose from the available activities in course
|
||||
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 "Add content" "button" in the "13 January - 19 January" "section"
|
||||
And I click on "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
|
||||
@@ -104,7 +106,8 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
And I click on "Add content" "button" in the "New section" "section"
|
||||
And I click on "Activity or resource" "button" in the "New section" "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"
|
||||
|
||||
@@ -116,7 +119,7 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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"
|
||||
@@ -128,13 +131,13 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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"
|
||||
@@ -144,16 +147,16 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
When I open the activity chooser
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
And I set the field "search" to "Search query"
|
||||
And "Clear search input" "button" should exist
|
||||
When I set the field "search" to ""
|
||||
@@ -162,7 +165,7 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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"
|
||||
@@ -171,7 +174,7 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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"
|
||||
@@ -188,7 +191,7 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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"
|
||||
|
||||
@@ -202,7 +205,7 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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"
|
||||
@@ -218,41 +221,41 @@ Feature: Display and choose from the available activities in course
|
||||
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 "New section" "section"
|
||||
When I open the activity chooser
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
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 "New section" "section"
|
||||
When I open the activity chooser
|
||||
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
|
||||
@@ -268,14 +271,15 @@ Feature: Display and choose from the available activities in course
|
||||
# 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 "New section" "section"
|
||||
And I open the activity chooser
|
||||
# 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"
|
||||
And I click on "Add content" "button" in the "13 January - 19 January" "section"
|
||||
When I click on "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
|
||||
@@ -291,13 +295,14 @@ Feature: Display and choose from the available activities in course
|
||||
# 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"
|
||||
And I click on "Add content" "button" in the "13 January - 19 January" "section"
|
||||
And I click on "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 "New section" "section"
|
||||
Given I open the activity chooser
|
||||
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
|
||||
@@ -307,7 +312,8 @@ Feature: Display and choose from the available activities in course
|
||||
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 click on "Add content" "button" in the "13 January - 19 January" "section"
|
||||
And I click on "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
|
||||
|
||||
@@ -26,14 +26,15 @@ Feature: Use the activity chooser to insert activities anywhere in a section
|
||||
|
||||
Scenario: The activity chooser icon is hidden by default and be made visible on hover
|
||||
Given I hover ".navbar-brand" "css_element"
|
||||
And "Insert an activity or resource before 'Test Forum'" "button" should not be visible
|
||||
When I hover "Insert an activity or resource before 'Test Forum'" "button"
|
||||
Then "Insert an activity or resource before 'Test Forum'" "button" should be visible
|
||||
And "Insert content before 'Test Forum'" "button" should not be visible
|
||||
When I hover "Insert content before 'Test Forum'" "button"
|
||||
Then "Insert content before 'Test Forum'" "button" 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"
|
||||
Given I change window size to "large"
|
||||
And I hover "Insert content before 'Test Forum'" "button"
|
||||
And I press "Insert content before 'Test Forum'"
|
||||
And I click on "Activity or resource" "button" in the ".dropdown .show" "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 |
|
||||
|
||||
@@ -275,8 +275,10 @@ class behat_course extends behat_base {
|
||||
|
||||
$this->require_javascript('Please use the \'the following "activity" exists:\' data generator instead.');
|
||||
|
||||
$infrontpage = false;
|
||||
if ($this->getSession()->getPage()->find('css', 'body#page-site-index') && (int) $sectionnum <= 1) {
|
||||
// We are on the frontpage.
|
||||
$infrontpage = true;
|
||||
if ($sectionnum) {
|
||||
// Section 1 represents the contents on the frontpage.
|
||||
$sectionxpath = "//body[@id='page-site-index']" .
|
||||
@@ -292,6 +294,14 @@ class behat_course extends behat_base {
|
||||
|
||||
// Clicks add activity or resource section link.
|
||||
$sectionnode = $this->find('xpath', $sectionxpath);
|
||||
if (!$infrontpage) {
|
||||
$this->execute('behat_general::i_click_on_in_the', [
|
||||
"//button[@data-action='open-addingcontent' and not(@data-beforemod)]",
|
||||
'xpath',
|
||||
$sectionnode,
|
||||
'NodeElement',
|
||||
]);
|
||||
}
|
||||
$this->execute('behat_general::i_click_on_in_the', [
|
||||
"//button[@data-action='open-chooser' and not(@data-beforemod)]",
|
||||
'xpath',
|
||||
@@ -2157,8 +2167,11 @@ class behat_course extends behat_base {
|
||||
* @Given /^I open the activity chooser$/
|
||||
*/
|
||||
public function i_open_the_activity_chooser() {
|
||||
// Open the "Activity or resource and Subsection" dropdown first.
|
||||
$this->execute('behat_general::i_click_on',
|
||||
array('//button[@data-action="open-chooser"]', 'xpath_element'));
|
||||
['//button[@data-action="open-addingcontent"]', 'xpath_element']);
|
||||
$this->execute('behat_general::i_click_on',
|
||||
['//button[@data-action="open-chooser"]', 'xpath_element']);
|
||||
|
||||
$node = $this->get_selected_node('xpath_element', '//div[@data-region="modules"]');
|
||||
$this->ensure_node_is_visible($node);
|
||||
|
||||
@@ -38,6 +38,6 @@ Feature: Restrict activities availability
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
When I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
Then "Add a new Assignment" "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"
|
||||
|
||||
@@ -24,8 +24,8 @@ Feature: Assignments can have default grades and scales defined
|
||||
When I am on the "Course 1" course page logged in as teacher1
|
||||
And I wait until the page is ready
|
||||
And I switch editing mode on
|
||||
And I click on "Add an activity or resource" "button"
|
||||
And I follow "Assignment"
|
||||
And I open the activity chooser
|
||||
And 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:
|
||||
| name | Test assignment |
|
||||
Then the following fields match these values:
|
||||
|
||||
@@ -20,7 +20,7 @@ Feature: Teachers can enable comments only if comments are enabled at site level
|
||||
|
||||
@javascript
|
||||
Scenario: Teacher can enable comments if they are enabled at site level
|
||||
Given I press "Add an activity or resource"
|
||||
Given I open the activity chooser
|
||||
And I click on "Add a new Database" "link" in the "Add an activity or resource" "dialogue"
|
||||
When I expand all fieldsets
|
||||
And "Allow comments on entries" "field" should exist
|
||||
@@ -34,7 +34,7 @@ Feature: Teachers can enable comments only if comments are enabled at site level
|
||||
# Disable comments in site config.
|
||||
Given the following config values are set as admin:
|
||||
| usecomments | 0 |
|
||||
And I press "Add an activity or resource"
|
||||
And I open the activity chooser
|
||||
And I click on "Add a new Database" "link" in the "Add an activity or resource" "dialogue"
|
||||
When I expand all fieldsets
|
||||
And I set the field "Name" to "Test Database name 2"
|
||||
|
||||
@@ -171,7 +171,7 @@ Feature: Manage course tools
|
||||
| teacher1 | C2 | editingteacher |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
|
||||
@@ -181,7 +181,7 @@ Feature: Manage course tools
|
||||
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
|
||||
And I click on "Show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
|
||||
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
|
||||
@@ -189,7 +189,7 @@ Feature: Manage course tools
|
||||
|
||||
# Should not affect other courses.
|
||||
And I am on "Course 2" course homepage
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
|
||||
@@ -200,7 +200,7 @@ Feature: Manage course tools
|
||||
And I click on "Show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
|
||||
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
|
||||
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
|
||||
@@ -221,7 +221,7 @@ Feature: Manage course tools
|
||||
| Course Tool 2 | /mod/lti/tests/fixtures/tool_provider.php | C1 | 1 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should see "Course Tool 1" in the ".modal-body" "css_element"
|
||||
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
|
||||
And I click on "Close" "button" in the ".modal-dialog" "css_element"
|
||||
@@ -229,7 +229,7 @@ Feature: Manage course tools
|
||||
And I click on "Don't show in activity chooser" "field" in the "Course Tool 1" "table_row"
|
||||
And I click on "Show in activity chooser" "field" in the "Course Tool 2" "table_row"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should not see "Course Tool 1" in the ".modal-body" "css_element"
|
||||
And I should see "Course Tool 2" in the ".modal-body" "css_element"
|
||||
And I click on "Close" "button" in the ".modal-dialog" "css_element"
|
||||
@@ -237,7 +237,7 @@ Feature: Manage course tools
|
||||
And I click on "Show in activity chooser" "field" in the "Course Tool 1" "table_row"
|
||||
And I click on "Don't show in activity chooser" "field" in the "Course Tool 2" "table_row"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
||||
And I open the activity chooser
|
||||
And I should see "Course Tool 1" in the ".modal-body" "css_element"
|
||||
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
|
||||
|
||||
@@ -279,7 +279,7 @@ Feature: Manage course tools
|
||||
And I restore "test_backup.mbz" backup into a new course using this options:
|
||||
| Schema | Course name | Restored course |
|
||||
And I should see "Restored course"
|
||||
And I click on "Add an activity or resource" "button" in the "General" "section"
|
||||
And I open the activity chooser
|
||||
Then I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
|
||||
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
|
||||
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
|
||||
|
||||
@@ -19,7 +19,7 @@ Feature: Scorm activity default completion
|
||||
Scenario: Completion conditions when there is no default set at site or course level.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I press "Add an activity or resource"
|
||||
And I open the activity chooser
|
||||
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
Then the field "None" matches value "1"
|
||||
@@ -40,7 +40,7 @@ Feature: Scorm activity default completion
|
||||
| completionstatusrequired_scorm[2] | 0 |
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I press "Add an activity or resource"
|
||||
And I open the activity chooser
|
||||
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
Then the field "None" matches value "0"
|
||||
@@ -62,7 +62,7 @@ Feature: Scorm activity default completion
|
||||
| completionstatusrequired_scorm[2] | 0 |
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I press "Add an activity or resource"
|
||||
And I open the activity chooser
|
||||
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
Then the field "None" matches value "0"
|
||||
@@ -86,7 +86,7 @@ Feature: Scorm activity default completion
|
||||
| course | module | completion |
|
||||
| C1 | scorm | 1 |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I press "Add an activity or resource"
|
||||
And I open the activity chooser
|
||||
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
Then the field "None" matches value "0"
|
||||
@@ -105,7 +105,8 @@ Feature: Scorm activity default completion
|
||||
| completionstatusrequired_scorm[2] | 1 |
|
||||
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I press "Add an activity or resource"
|
||||
# When I add a "Teaching Tool 1" to section "1" using the activity chooser
|
||||
And I open the activity chooser
|
||||
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
|
||||
And I expand all fieldsets
|
||||
Then the field "None" matches value "0"
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Testing subsection_access_restrictions in mod_subsection
|
||||
I need to set subsection conditions which prevent student access
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname |
|
||||
| teacher1 | Teacher | 1 |
|
||||
| student1 | Student | 1 |
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: The module menu replaces the delegated section menu
|
||||
I need to see the delegated section action menu instead of module menu.
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Users view subsections on course page
|
||||
I need to view subsections on course page
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Courses should not lose subsection contents when mod_subsection is disa
|
||||
Courses needs to be usable with mod_subsection disabled
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname |
|
||||
| teacher1 | Teacher | 1 |
|
||||
| student1 | Student | 1 |
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Teacher can only add subsection when certain conditions are met
|
||||
I need to create subsections only when possible
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Teachers navigate to subsections
|
||||
I need to navigate to subsections
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Subsection does not have completion.
|
||||
I need to use subsection activity without completion
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Teachers can rename subsections
|
||||
I need to sync subsection and activity names
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Teachers create and destroy subsections on section page
|
||||
I need to create and destroy subsections
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
@@ -34,9 +33,10 @@ Feature: Teachers create and destroy subsections on section page
|
||||
Given the following "activities" exist:
|
||||
| activity | name | course | idnumber | section |
|
||||
| subsection | Subsection1 | C1 | forum1 | 1 |
|
||||
When I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Subsection1" "link" in the "region-main" "region"
|
||||
And I add a "Assignment" to section "3" using the activity chooser
|
||||
When I am on the "C1 > Subsection1" "course > section" page
|
||||
And I turn editing mode on
|
||||
And I click on "Add an activity or resource" "button"
|
||||
And I click on "Add a new Assignment" "link"
|
||||
And I set the following fields to these values:
|
||||
| Assignment name | Test assignment name |
|
||||
| ID number | Test assignment name |
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Subsection visibility should work as a module
|
||||
I need subsections to behave as any other module
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "course" exists:
|
||||
Given the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
| category | 0 |
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Subsections visibility badges
|
||||
I need to see edit visibility from the section card badges when possible.
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
Feature: Subsection behavior in Log report.
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "courses" exist:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category | numsections | initsections |
|
||||
| Course 1 | C1 | 0 | 2 | 1 |
|
||||
And the following "users" exist:
|
||||
|
||||
@@ -90,8 +90,7 @@ Feature: View an outline report
|
||||
And I should see "-" in the "Book name" "table_row"
|
||||
|
||||
Scenario: The outline report can represent courses with subsections
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "activities" exist:
|
||||
Given the following "activities" exist:
|
||||
| activity | name | course | section | visible | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
|
||||
| assign | Activity1 | C1 | 1 | 1 | 1 | 0 |
|
||||
And the following "activities" exist:
|
||||
|
||||
@@ -5,8 +5,7 @@ Feature: Subsections are shown in reports
|
||||
I need to see sections and subsections structure in reports
|
||||
|
||||
Background:
|
||||
Given I enable "subsection" "mod" plugin
|
||||
And the following "users" exist:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
Reference in New Issue
Block a user