Part of MDL-45774.
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "admin"
- And I am on homepage
+ And I am on site homepage
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "input[title=Hide]" "css_element" in the "Restriction by grade" "table_row"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
@javascript
Scenario: Basic contents assertions
Given I log in as "admin"
- And I am on homepage
+ And I am on site homepage
And I expand "Users" node
And I follow "Groups"
And I press "Create group"
Then I should see "I'm the description"
And "Grouping" "select" in the "region-main" "region" should be visible
And "Group" "select" should be visible
- And "Messaging" "link" in the "Administration" "block" should not be visible
- And "Change password" "link" should not be visible
+ And "Activity report" "link" in the "Administration" "block" should not be visible
+ And "Event monitoring rules" "link" should not be visible
And I should see "Filter groups by"
And I should not see "Filter groupssss by"
And I should see "Group members" in the "#region-main table th.c1" "css_element"
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
When I dock "Administration" block
Then I should not see "Question bank" in the ".block-region" "css_element"
| Course 2 | COURSE2 | CAT3 |
| Course 3 | COURSE3 | 0 |
When I log in as "admin"
+ And I am on site homepage
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
| Grouping 1 | C1 | GG1 |
| Grouping 2 | C1 | GG2 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
| mod/forum:editanypost | Allow | student | Course | C1 |
| mod/forum:replynews | Prevent | editingteacher | Course | C1 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
| user3 | editingteacher | Course | C1 |
| user5 | custom2 | System | |
When I log in as "user1"
+ And I am on site homepage
Then I should see "Front page settings"
And I log out
And I log in as "user2"
+ And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user3"
+ And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user4"
+ And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And I log out
And I log in as "user5"
And I should see "You are logged in as"
+ And I am on site homepage
And I follow "Course 1"
And I should see "You can not enrol yourself in this course."
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
| grouping | group |
| GG1 | G1 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Courses"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Grades"
And I expand "Setup" node
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Grades"
And I follow "Scales"
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
- And I follow "Home"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
- And I follow "Home"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Grades"
And I expand "Setup" node
# Select (multi-select) - We will check "I set the field...".
And I set the field "otagsadd" to "OT1, OT2, OT3, OT4, OT5"
And I press "Add official tags"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I follow "Test this one"
@javascript
Scenario: Basic forms manipulation
Given I log in as "admin"
- And I navigate to "Edit profile" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Edit profile"
When I set the field "First name" to "Field value"
- And I set the field "Text editor" to "Plain text area"
+ And I set the field "Select a country" to "Japan"
And I set the field "Unmask" to "1"
And I expand all fieldsets
Then the field "First name" matches value "Field value"
- And the "Text editor" select box should contain "Plain text area"
+ And the "Select a country" select box should contain "Japan"
And the field "Unmask" matches value "1"
And I set the field "Unmask" to ""
And the field "Unmask" matches value ""
| fullname | shortname | category |
| Course 1 | C1 | 0 |
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 "Quiz" to section "1"
I need to apply some transformations to the steps arguments
Background:
- Given I am on homepage
+ Given I am on site homepage
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
- And I navigate to "Edit profile" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Edit profile"
+ @javascript
Scenario: Use nasty strings on steps arguments
When I set the field "Surname" to "$NASTYSTRING1"
And I set the field "Description" to "$NASTYSTRING2"
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"
+ @javascript
Scenario: Use nasty strings on table nodes
When I set the following fields to these values:
| Surname | $NASTYSTRING1 |
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"
+ @javascript
Scenario: Use double quotes
When I set the following fields to these values:
| First name | va"lue1 |
I need to use the test environment instead of the regular environment
Scenario: Accessing the site
- When I am on homepage
+ When I am on site homepage
Then I should see "Acceptance test site"
| Custom description | Froggy file |
And I press "Save changes"
# Create a resource activity and add it to a course
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
When I add a "File" to section "1"
And I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I click on "Enable" "link"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I press "Add a new rule"
Scenario: Add a rule on course level
Given I log in as "teacher1"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
When I press "Add a new rule"
And I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I click on "Enable" "link"
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I press "Add a new rule"
Scenario: Subscribe to a rule on course level
Given I log in as "teacher1"
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
And I set the field "Select a course" to "Course 1"
When I follow "Subscribe to rule \"New rule course level\""
Then I should see "Subscription successfully created"
Scenario: Delete a subscription on course level
Given I log in as "teacher1"
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
And I set the field "Select a course" to "Course 1"
And I follow "Subscribe to rule \"New rule course level\""
And I should see "Subscription successfully created"
Scenario: Subscribe to a rule on site level
Given I log in as "admin"
- And I navigate to "Event monitoring" node in "My profile settings"
- And I set the field "Select a course" to "Site"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Acceptance test site"
When I follow "Subscribe to rule \"New rule site level\""
Then I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
Scenario: Delete a subscription on site level
Given I log in as "admin"
- And I navigate to "Event monitoring" node in "My profile settings"
- And I set the field "Select a course" to "Site"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Acceptance test site"
And I follow "Subscribe to rule \"New rule site level\""
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
Scenario: Receiving notification on site level
Given I log in as "admin"
- And I navigate to "Messaging" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Messaging"
And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
And I press "Update profile"
- And I am on homepage
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
- And I set the field "Select a course" to "Site"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Acceptance test site"
And I follow "Subscribe to rule \"New rule site level\""
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
- And I am on homepage
+ And I am on site homepage
And I trigger cron
- And I am on homepage
- When I navigate to "Messages" node in "My profile"
+ And I am on site homepage
+ When I follow "Messages" in the user menu
And I follow "Do not reply to this email (1)"
Then I should see "The course was viewed."
Scenario: Receiving notification on course level
Given I log in as "teacher1"
- And I navigate to "Messaging" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Messaging"
And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
And I press "Update profile"
- And I am on homepage
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
And I set the field "Select a course" to "Course 1"
And I follow "Subscribe to rule \"New rule course level\""
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
- And I am on homepage
+ And I am on site homepage
And I follow "Course 1"
And I trigger cron
- And I am on homepage
- When I navigate to "Messages" node in "My profile"
+ And I am on site homepage
+ When I follow "Messages" in the user menu
And I follow "Do not reply to this email (1)"
Then I should see "The course was viewed."
Scenario: Navigating via quick link to rules
Given I log in as "admin"
- When I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ When I follow "Event monitoring"
+ And I set the field "Select a course" to "Course 1"
Then I should see "You can manage rules from the Event monitoring rules page."
And I follow "Event monitoring rules"
And I should see "You can subscribe to rules from the Event monitoring page."
And I log out
And I log in as "teacher1"
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Course 1"
And I should see "You can manage rules from the Event monitoring rules page."
And I follow "Event monitoring rules"
And I should see "You can subscribe to rules from the Event monitoring page."
And I click on "//a[text()='Event monitoring']" "xpath_element"
And the field "courseid" matches value "Course 1"
- And I set the field "courseid" to "Site"
+ And I set the field "courseid" to "Choose..."
And I should not see "You can manage rules from the Event monitoring rules page."
And I log out
And I log in as "teacher2"
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Course 1"
And I should not see "You can manage rules the from the Event monitoring rules page."
Scenario: No manage rules link when user does not have permission
- Given I log in as "teacher1"
- When I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ Given I log in as "admin"
+ And I set the following system permissions of "Non-editing teacher" role:
+ | tool/monitor:managerules | Prohibit |
+ And I log out
+ And I log in as "teacher1"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ When I set the field "Select a course" to "Course 1"
Then I should see "You can manage rules from the Event monitoring rules page."
+ And I set the field "Select a course" to "Course 2"
+ And I should not see "You can manage rules from the Event monitoring rules page."
And I log out
And I log in as "teacher2"
- And I follow "Course 1"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I follow "My preferences" in the user menu
+ And I follow "Event monitoring"
+ And I set the field "Select a course" to "Course 1"
And I should not see "You can manage rules from the Event monitoring rules page."
- And I follow "Home"
- And I follow "Course 2"
- And I navigate to "Event monitoring" node in "My profile settings"
+ And I set the field "Select a course" to "Course 2"
And I should see "You can manage rules from the Event monitoring rules page."
- And I log out
- And I log in as "teacher1"
- And I follow "Course 2"
- And I navigate to "Event monitoring" node in "My profile settings"
- And I should not see "You can manage rules from the Event monitoring rules page."
And I should see "Courses total: 3"
And I should see "Courses created: 2"
And I should see "Courses errors: 1"
- And I follow "Home"
+ And I am on site homepage
And I should see "Course 2"
And I should see "Course 3"
And I should see "Courses total: 3"
And I should see "Courses created: 3"
And I should see "Courses errors: 0"
- And I follow "Home"
+ And I am on site homepage
And I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
And I should see "Courses updated: 1"
And I should see "Courses created: 0"
And I should see "Courses errors: 2"
- And I follow "Home"
+ And I am on site homepage
And I should see "Course 1"
And I should not see "Course 2"
And I should not see "Course 3"