Skip to content

Commit

Permalink
Merge branch 'wip-mdl-49150' of https://github.com/rajeshtaneja/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Mar 29, 2016
2 parents d4f69a4 + a1d3a94 commit 213fdb1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 39 deletions.
2 changes: 0 additions & 2 deletions admin/tests/behat/filter_users.feature
Expand Up @@ -27,7 +27,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I follow "Browse list of users"

@javascript
Scenario: Filter user accounts by role and cohort
When I set the following fields to these values:
| courserole_rl | Student |
Expand All @@ -51,7 +50,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I should see "User Three"
And I should see "User Four"

@javascript
Scenario: Filter user accounts by confirm and authentication method
When I set the following fields to these values:
| Confirmed | No |
Expand Down
3 changes: 1 addition & 2 deletions admin/tool/monitor/tests/behat/disabled.feature
@@ -1,10 +1,9 @@
@javascript @tool @tool_monitor
@tool @tool_monitor
Feature: Enable/disable managment of the event monitor
In order to manage event monitoring
As an admin
I need to enable/disable it

@javascript
Scenario: Tool is disabled by default.
Given I log in as "admin"
When I navigate to "Event monitoring rules" node in "Site administration > Reports"
Expand Down
9 changes: 3 additions & 6 deletions cohort/tests/behat/access_visible_cohorts.feature
Expand Up @@ -44,12 +44,11 @@ Feature: Access visible and hidden cohorts
| user | course | role |
| teacher | C1 | editingteacher |

@javascript
Scenario: Teacher can see visible cohorts defined in the above contexts
When I log in as "teacher"
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"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should not contain "Cohort hidden in category 1"
Expand All @@ -71,13 +70,12 @@ Feature: Access visible and hidden cohorts
And the "Select members from cohort" select box should not contain "Cohort empty in category 1"
And the "Select members from cohort" select box should not contain "System empty cohort"

@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"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should contain "Cohort hidden in category 1"
Expand All @@ -99,13 +97,12 @@ Feature: Access visible and hidden cohorts
And the "Select members from cohort" select box should not contain "Cohort empty in category 1"
And the "Select members from cohort" select box should not contain "System empty cohort"

@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"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should contain "Cohort hidden in category 1"
Expand Down
3 changes: 0 additions & 3 deletions cohort/tests/behat/add_cohort.feature
Expand Up @@ -21,15 +21,13 @@ Feature: Add cohorts of users
| Description | Test cohort description |
And I press "Save changes"

@javascript
Scenario: Add a cohort
When I follow "Cohorts"
Then I should see "Test cohort name"
And I should see "333"
And I should see "Test cohort description"
And I should see "Created manually"

@javascript
Scenario: Add users to a cohort selecting them from the system users list
When I add "First User (first@example.com)" user to "333" cohort members
And I add "Second User (second@example.com)" user to "333" cohort members
Expand All @@ -39,7 +37,6 @@ Feature: Add cohorts of users
And the "Current users" select box should contain "Second User (second@example.com)"
And the "Current users" select box should not contain "Forth User (forth@example.com)"

@javascript
Scenario: Add users to a cohort using a bulk user action
When I follow "Bulk user actions"
And I set the field "Available" to "Third User"
Expand Down
33 changes: 10 additions & 23 deletions cohort/tests/behat/behat_cohort.php
Expand Up @@ -59,29 +59,16 @@ public function i_add_user_to_cohort_members($user, $cohortidnumber) {
if (!$this->getSession()->getPage()->find('css', 'input#cohort_search_q')) {

// With JS enabled we should expand a few tree nodes.
if ($this->running_javascript()) {
$parentnodes = get_string('administrationsite') . ' > ' .
get_string('users', 'admin') . ' > ' .
get_string('accounts', 'admin');
$steps = array_merge(
array(
new Given('I am on homepage'),
new Given('I navigate to "' . get_string('cohorts', 'cohort') . '" node in "' . $parentnodes . '"')
),
$steps
);

} else {
// JS disabled.
$steps = array_merge(
array(
new Given('I am on homepage'),
new Given('I follow "' . get_string('administrationsite') . '" node'),
new Given('I follow "' . get_string('cohorts', 'cohort') . '"')
),
$steps
);
}
$parentnodes = get_string('administrationsite') . ' > ' .
get_string('users', 'admin') . ' > ' .
get_string('accounts', 'admin');
$steps = array_merge(
array(
new Given('I am on homepage'),
new Given('I navigate to "' . get_string('cohorts', 'cohort') . '" node in "' . $parentnodes . '"')
),
$steps
);
}

return $steps;
Expand Down
3 changes: 0 additions & 3 deletions cohort/tests/behat/view_cohorts.feature
Expand Up @@ -27,7 +27,6 @@ Feature: View cohort list
| user1 | manager | System | |
| user2 | manager | Category | CAT1 |

@javascript
Scenario: Admin can see system cohorts and all cohorts
When I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
Expand All @@ -40,7 +39,6 @@ Feature: View cohort list
And I should see "Cohort in category 3"
And I log out

@javascript
Scenario: Manager can see system cohorts and all cohorts
When I log in as "user1"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
Expand All @@ -53,7 +51,6 @@ Feature: View cohort list
And I should see "Cohort in category 3"
And I log out

@javascript
Scenario: Manager in category can see cohorts in the category
When I log in as "user2"
And I follow "Courses"
Expand Down

0 comments on commit 213fdb1

Please sign in to comment.