Behat is passing after this change.
Part of MDL-45774.
}
}
-if ($user->id != $USER->id) {
+if (!empty($user) && ($user->id != $USER->id)) {
$PAGE->navigation->extend_for_user($user);
$PAGE->navbar->includesettingsbase = true;
}
When I perform a quick backup of course "Course 2"
Then I should see "Restore course"
And I should see "Course backup area"
- And I should see "backup-moodle2-course-"
\ No newline at end of file
+ And I should see "backup-moodle2-course-"
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
- $this->getSession()->visit($this->locate_path('/'));
+ $this->getSession()->visit($this->locate_path('/?redirect=0'));
// Click the course link.
$this->find_link($backupcourse)->click();
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
- $this->getSession()->visit($this->locate_path('/'));
+ $this->getSession()->visit($this->locate_path('/?redirect=0'));
// Click the course link.
$this->find_link($backupcourse)->click();
// table elements are used, and we need to catch exceptions contantly.
// Go to homepage.
- $this->getSession()->visit($this->locate_path('/'));
+ $this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->wait();
// Click the course link.
| assign | C3 | assign1 | Test assign name | Assign description | 1 |
| data | C3 | data1 | Test database name | Database description | 2 |
And I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| wiki | Frontpage wiki name | Frontpage wiki description | Acceptance test site | wiki0 |
| workshop | Frontpage workshop name | Frontpage workshop description | Acceptance test site | workshop0 |
- And I am on homepage
+ And I am on site homepage
When I follow "Turn editing 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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 homepage
+ 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"
Background:
Given I log in as "admin"
+ And I am on site homepage
And I navigate to "Edit settings" node in "Front page settings"
And I set the following fields to these values:
| summary | Proved the summary block works! |
# 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 homepage
+ When I am on site homepage
Then "Course/site summary" "block" should exist
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
When I log in as "admin"
- And I am on homepage
+ And I am on site homepage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I click on "Edit" "link" 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 homepage
+ And I am on site homepage
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
| 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 click on "Turn editing on" "link" in the "Administration" "block"
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
@javascript
Scenario: Configuring the HTML block with Javascript on
Given I log in as "admin"
+ And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
And I configure the "(new HTML block)" block
Scenario: Configuring the HTML block with Javascript off
Given I log in as "admin"
+ And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
And I configure the "(new HTML block)" block
Background:
Given I log in as "admin"
+ And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
And I add the "HTML" block
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | student1@asd.com |
And I log in as "admin"
+ And I am on site homepage
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "Login" block
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 follow "Course 2"
And I turn editing mode on
And I click on "Edit settings" "link" in the "Administration" "block"
@javascript
Scenario: As the admin user I expand the courses and category nodes to see courses.
When I log in as "admin"
- And I should see "Home" in the "Navigation" "block"
+ 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"
@javascript
Scenario: As teacher1 I expand the courses and category nodes to see courses.
When I log in as "teacher1"
- And I should see "Home" in the "Navigation" "block"
+ 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"
@javascript
Scenario: As student1 I expand the courses and category nodes to see courses.
When I log in as "student1"
- And I should see "Home" in the "Navigation" "block"
+ 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"
@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 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
\ No newline at end of file
+ And navigation node "c4" should not be expandable
| user | course | role |
| student1 | C101 | student |
And I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add the "People" block
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
When I add the "Blog menu" block
| user | course | role |
| manager1 | Acceptance test site | manager |
And I log in as "manager1"
+ And I am on site homepage
And I follow "Turn editing on"
And I add the "Comments" block
And I configure the "Comments" block
When I follow "Course 1"
Then I should see "Comments" in the "Comments" "block"
And I should see "Save comment" in the "Comments" "block"
- And I am on homepage
+ 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) |
@javascript
Scenario: Blocks can safely be customised
Given I log in as "admin"
- And I click on "My home" "link" in the "Navigation" "block"
+ And I click on "Dashboard" "link" in the "Navigation" "block"
And I press "Customise this page"
And I add the "HTML" block
And I configure the "(new HTML block)" block
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I follow "Turn editing on"
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I follow "Turn editing on"
And I add a "Survey" to section "1" and I fill the form with:
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
| block/activity_modules:addinstance | Prohibit |
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
+ And I am on site homepage
When I follow "Course 1"
And I follow "Turn editing on"
And I add the "Tags" block
@javascript
Scenario: System manager can see all cohorts defined in the above contexts
When I log in as "user1"
+ And I am on site homepage
And I follow "Course 1"
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I set the field "Add method" to "Cohort sync"
@javascript
Scenario: Category manager can see all cohorts defined in his category and visible cohorts defined above
When I log in as "user2"
+ And I am on site homepage
And I follow "Course 1"
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I set the field "Add method" to "Cohort sync"
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I add "Cohort sync" enrolment method with:
| Cohort | Cohort 1 |
- And I am on homepage
+ And I am on site homepage
And I follow "Course 2"
And I add "Cohort sync" enrolment method with:
| Cohort | Cohort 2 |
And I click on "Assign" "link" in the "Cohort 2" "table_row"
And the "Current users" select box should contain "Mary Smith (marysmith@example.com)"
And the "Current users" select box should contain "Alice Smith (alicesmith@example.com)"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Enrolled users"
And I should see "Tom Jones"
And I should see "Bob Jones"
And I should not see "Mary Smith"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 2"
And I expand "Users" node
And I follow "Enrolled users"
Scenario: Set activity description to required then add an activity supplying only the name
Given I set the following administration settings values:
| requiremodintro | Yes |
- When I follow "Home"
+ When I am on site homepage
And I follow "Course 1"
And I add a "Database" to section "3" and I fill the form with:
| Name | Test name |
| legacyfilesinnewcourses | 1 |
| legacyfilesaddallowed | 1 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Legacy course files"
And I follow "Legacy course files"
| legacyfilesinnewcourses | 1 |
| legacyfilesaddallowed | 0 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Legacy course files"
And I follow "Legacy course files"
| user | role | contextlevel | reference |
| manager1 | manager | System | |
And I log in as "manager1"
+ And I am on site homepage
And I follow "Course 1"
And I go to "Test assignment 1 name" advanced grading definition page
And I set the following fields to these values:
When I press "Message"
And I set the field "Message to send" to "Lorem ipsum sa messagus textus"
And I press "Send message"
+ And I am on homepage
And I follow "Messages" in the user menu
And I set the field "Search people and messages" to "User Two"
And I press "Search people and messages"
And I should see "Group 1" in the "Student 1" "table_row"
And I should see "Group 1" in the "Student 2" "table_row"
And I should see "Submitted for grading" in the "Student 1" "table_row"
- And I should see "Submitted for grading" in the "Student 2" "table_row"
\ No newline at end of file
+ And I should see "Submitted for grading" in the "Student 2" "table_row"
@mod @mod_lesson
-Feature: In My home, a student can see their current status on all lessons with an upcoming due date
+Feature: In Dashboard, a student can see their current status on all lessons with an upcoming due date
In order to know my status on a lesson
As a student
- I need to see it in My home
+ I need to see it in Dashboard
Background:
Given the following "users" exist:
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
And I should see "Completed, You can re-attempt this lesson"
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should not see "You have lessons that are due"
@javascript
And I press "Next page"
And I should see "Second page contents"
And I press "End of lesson"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
And I should see "Completed, You can re-attempt this lesson"
And I press "Next page"
And I should see "Second page contents"
And I press "End of lesson"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should not see "You have lessons that are due"
@javascript
| False | 1 |
And I press "Submit"
And I press "Continue"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
And I should see "Lesson has been started, but not yet completed"
And I should see "First page contents"
And I press "Next page"
And I should see "Second page contents"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
And I should see "Lesson has been started, but not yet completed"
And I press "Save page"
And I log out
And I log in as "student1"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
And I should see "No attempts have been made on this lesson"
And I press "Save page"
And I log out
And I log in as "student1"
- When I click on "My home" "link" in the "Navigation" "block"
+ When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have lessons that are due"
And I click on ".collapsibleregioncaption" "css_element"
- And I should see "No attempts have been made on this lesson"
\ No newline at end of file
+ And I should see "No attempts have been made on this lesson"
| question | page |
| TF1 | 1 |
| TF2 | 2 |
+ And I am on site homepage
When I follow "Course 1"
And I turn editing mode on
And I duplicate "Quiz 1" activity editing the new copy with:
@javascript @_file_upload
Scenario: Restore a Moodle 2.8 quiz backup
+ And I am on site homepage
When I follow "Course 1"
And I navigate to "Restore" node in "Course administration"
And I press "Manage backup files"
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
- When I navigate to "My private files" node in "My profile"
+ When I follow "Manage my 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"